Skip to content

feat(google): support Cloud Code /v1internal:*generateContent (Antigravity, Gemini CLI) - #265

Open
drakonkat wants to merge 2 commits into
teamchong:mainfrom
drakonkat:feat/cloud-code-v1internal
Open

drakonkat wants to merge 2 commits into
teamchong:mainfrom
drakonkat:feat/cloud-code-v1internal

Conversation

@drakonkat

@drakonkat drakonkat commented Sep 2, 2026

Copy link
Copy Markdown

Summary

Support native Google inference requests rerouted through pxpipe from clients and providers using the Google wire format:

  • /v1/models/{model}:generateContent and /v1beta/models/{model}:streamGenerateContent (both methods on both versions), alongside existing Google AI Studio gateway paths.
  • Cloud Code /v1internal:generateContent and :streamGenerateContent, including request and generateContentRequest envelopes.
  • Preserve Google OAuth/API credentials without injecting Anthropic credentials. Skip Cloud Code countTokens probes.
  • GOOGLE_UPSTREAM overrides the shared upstream for Google inference; retain explicit Cloudflare gateway routing and daily Cloud Code host detection.
  • Merge current main, retaining model opt-out, thought signatures, and Cloud Code response accounting.
  • Fix Windows TypeScript build entry resolution using Node path utilities.

This routes Google-format requests; it does not translate OpenAI Responses or Chat Completions payloads into Google payloads.

Validation

  • TypeScript typecheck passed.
  • Full Vitest suite: 1,224 tests passed.
  • After final upstream-precedence adjustment: 23 routing tests passed.
  • Build and bundled CLI version smoke check passed on Windows / Node 24.
  • GitHub reports MERGEABLE with no conflicts at e342aeb.
  • GitHub CI requires maintainer approval for this fork: https://github.com/teamchong/pxpipe/actions/runs/34201881084
  • Live Google/OAuth requests were not exercised; routing tests use stubbed fetch.

drakonkat and others added 2 commits September 2, 2026 10:47
…avity, Gemini CLI)

Adds the Cloud Code internal route used by Antigravity and Gemini CLI. The body is a { model, project, request } envelope; the inner generateContent request is transformed and the envelope is preserved. Forwards to cloudcode-pa.googleapis.com by default (GOOGLE_UPSTREAM / googleUpstream override), forwards the client bearer, never injects the Anthropic key, skips the upstream countTokens probe.
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