Skip to content

Bug: wpt-gen-manual-test fails in Gemini CLI with gemini provider #428

@DanielRyanSmith

Description

@DanielRyanSmith

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

  • The wpt-gen-manual-test skill executes successfully within the Gemini CLI when using the gemini provider.
  • The GOOGLE_GEMINI_BASE_URL is temporarily bypassed during the wpt-gen generate process to prevent incorrect local routing.
  • The environment variable is consistently restored to its original state after execution completes.
  • Tests are added or updated to verify the correct handling and restoration of the environment variables.

This issue description was drafted by Gemini

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions