Skip to content

fix(runtime): normalize Gemini service URLs consistently - #1051

Open
Afloat16 wants to merge 1 commit into
Tencent:mainfrom
Afloat16:fix/gemini-base-url
Open

Afloat16 wants to merge 1 commit into
Tencent:mainfrom
Afloat16:fix/gemini-base-url

Conversation

@Afloat16

Copy link
Copy Markdown

What changed

Model discovery removes a trailing /v1beta, but Antigravity execution previously passed it through to a Gemini SDK which appends the version itself. The same saved credential could therefore list models successfully and fail execution with a doubled version path.

Use one domain URL normalizer in discovery and execution. Preserve reverse-proxy path prefixes, normalize trailing version/slash variants, and reject operation URLs such as /v1beta/interactions with an actionable error. Add coverage for both exported Gemini environment variables and invalid endpoint shapes.

Addresses the backend URL inconsistency reported in #1040; this does not change the credential form.

Scope

  • Platform core / API / runner

Compatibility

No schema, API, dependency, or runner-protocol changes.

Validation

  • Passed regression tests: go test ./internal/domain ./internal/runtime ./internal/httpapi -run 'TestNormalizeGeminiBaseURL|TestAntigravity|TestDiscoverGeminiModels|TestAgentCLI' -count=1.
  • Passed bash scripts/build-chatbot.sh (56 frontend test files, 388 tests, production build).
  • Passed full internal/domain package.
  • Broader go test -p=2 ./internal/domain ./internal/runtime ./internal/httpapi -count=1 -timeout=180s did not pass: existing runtime tests require functional Chromium, Docker images/commands, and Unix sockets unavailable here; the full HTTP API package exceeded the 180-second timeout. The affected targeted tests above passed.
  • Passed git diff --check.
  • Full platform/browser CI was not run locally.

Safety

  • I did not include credentials, internal endpoints, production data, or organization-specific infrastructure.
  • I preserved user files and unrelated changes.
  • No generated Classic bundles or third-party content changed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant