Background & Motivation
When executing the wpt-gen-manual-test skill within the Gemini CLI using the gemini provider, the skill fails to function correctly. This issue, discovered by @szy196, occurs because the GOOGLE_GEMINI_BASE_URL environment variable is set to a localhost port by the Gemini CLI. Consequently, requests intended for the public Gemini API are incorrectly routed to the local port, causing the API calls during wpt-gen generate to fail. Resolving this is necessary to ensure the testing workflows function properly for anyone using the Gemini CLI with its default local proxy configuration.
Proposed Changes
We need to temporarily clear or ignore the GOOGLE_GEMINI_BASE_URL environment variable specifically during the execution of the wpt-gen generate command, and safely restore it immediately afterward.
Specific changes would include:
- Identify the entry point or execution wrapper where the
wpt-gen-manual-test skill invokes wpt-gen generate or initializes its LLM clients.
- Before invoking the
generate process, read and store the current value of GOOGLE_GEMINI_BASE_URL from os.environ (if it exists).
- Remove
GOOGLE_GEMINI_BASE_URL from the active environment variables. If invoking a subprocess, ensure the environment dictionary passed to subprocess.run does not contain this variable.
- Implement a
try...finally block or a Python context manager to guarantee that GOOGLE_GEMINI_BASE_URL is re-established in os.environ to its original value after the execution finishes, regardless of whether the generation succeeded or threw an error.
Acceptance Criteria
This issue description was drafted by Gemini
Background & Motivation
When executing the
wpt-gen-manual-testskill within the Gemini CLI using thegeminiprovider, the skill fails to function correctly. This issue, discovered by @szy196, occurs because theGOOGLE_GEMINI_BASE_URLenvironment variable is set to a localhost port by the Gemini CLI. Consequently, requests intended for the public Gemini API are incorrectly routed to the local port, causing the API calls duringwpt-gen generateto fail. Resolving this is necessary to ensure the testing workflows function properly for anyone using the Gemini CLI with its default local proxy configuration.Proposed Changes
We need to temporarily clear or ignore the
GOOGLE_GEMINI_BASE_URLenvironment variable specifically during the execution of thewpt-gen generatecommand, and safely restore it immediately afterward.Specific changes would include:
wpt-gen-manual-testskill invokeswpt-gen generateor initializes its LLM clients.generateprocess, read and store the current value ofGOOGLE_GEMINI_BASE_URLfromos.environ(if it exists).GOOGLE_GEMINI_BASE_URLfrom the active environment variables. If invoking a subprocess, ensure the environment dictionary passed tosubprocess.rundoes not contain this variable.try...finallyblock or a Python context manager to guarantee thatGOOGLE_GEMINI_BASE_URLis re-established inos.environto its original value after the execution finishes, regardless of whether the generation succeeded or threw an error.Acceptance Criteria
wpt-gen-manual-testskill executes successfully within the Gemini CLI when using thegeminiprovider.GOOGLE_GEMINI_BASE_URLis temporarily bypassed during thewpt-gen generateprocess to prevent incorrect local routing.This issue description was drafted by Gemini