Skip to content

feat: add bili antigravity launcher lane (#2115) - #2134

Merged
ranxianglei merged 3 commits into
masterfrom
2026-10-05_antigravity-launcher
Oct 5, 2026
Merged

ranxianglei merged 3 commits into
masterfrom
2026-10-05_antigravity-launcher

Conversation

@ranxianglei

Copy link
Copy Markdown
Owner

Closes #2115

What

First-class Google Antigravity support as a launcher client (bili antigravity), following the existing per-client pattern (gemini/iflow lanes). The launcher drives the official CLI binary agy (successor of Gemini CLI, which was discontinued in 2026-06).

Mechanism

  • Antigravity's model channel runs inside its closed-source Go language_server, which honors an undocumented CLOUD_CODE_URL env override (verified by static analysis of the official v2.19.1 build: binary string "Overriding CloudCodeServerURL via CLOUD_CODE_URL environment variable"). Same shape as gemini-cli's base-URL hook.
  • Launcher sets CLOUD_CODE_URL=<proxy>/bili/<upstream> — stock upstream https://cloudcode-pa.googleapis.com; a user-exported CLOUD_CODE_URL is relayed through the proxy instead (claude relay-wrap semantics). No MITM, no CA install.
  • The proxy recognizes the wire by path: :streamGenerateContent / :generateContent / :countTokens route to the google adapter, so compression works exactly like bili gemini. If the server uses gRPC method paths (/google.internal.cloud.code.v1internal.CloudCode/*) those are not recognized and relay verbatim without compression — a graceful degrade, fixable later via a per-lane protocol declaration ([feature] configurable wire-path table (per-provider custom paths) - Claude Desktop's claude.ai private protocol as motivating case #1909) once confirmed against live traffic.
  • Fallback documented if Google removes the env hook: cert-MITM (the language_server honors HTTPS_PROXY and does not pin certificates): add cloudcode-pa.googleapis.com to "mitm".domains and trust bili's root CA.

Built-in-plugin feasibility (owner question)

Antigravity DOES ship a user plugin system (~/.gemini/config/plugins/<name>/: plugin.json, hooks.json, mcp_config.json, rules/, skills/, JS sidecars with a Sidecar SDK; /builtin/plugins/ ship with the product; enabled via plugins.<dir> in config.json). But every surface is additive only — tools, prompts, UI, event callbacks. Nothing can intercept or rewrite the model request/response stream, which stays entirely inside the closed language_server; MCP tools cannot reach its internal session state. So wire-only integration via the network layer is the ceiling for v1 — the launcher lane is the mechanism, not a workaround.

Config surface

No bili config fields added. CLOUD_CODE_URL is a client-side (Antigravity) env var, not a bili setting. The launcher reads the user's pre-existing CLOUD_CODE_URL from the process env purely to decide what to relay (same as GOOGLE_GEMINI_BASE_URL for bili gemini). No new BILI_* vars, no new config.json fields, no CLI flags beyond the standard ones.

Behavior changes

Additive only: one new launcher entry antigravity. No existing lane, default, threshold, timing, output format, or cache behavior touched. Web UI gains one launcher chip + zh/en i18n notes.

Verification

  • npm run typecheck clean; targeted suites green locally: tests/launcher-gemini-family.test.ts (28 tests incl. 10 new antigravity cases), tests/web-i18n.test.ts + tests/web-routing.test.ts (14 tests, incl. the Web UI 英文翻译开关(i18n)— 社区 PR #807 (@amirzamli) #1024 i18n key-parity gate). Full suite + build left to CI per local-testing discipline.
  • Static-analysis evidence: official Antigravity v2.19.1 .deb (sha512 verified against the auto-updater manifest); language_server strings analysis performed in-workspace during development, artifacts removed before this commit.
  • Live end-to-end NOT yet verified (needs a logged-in Antigravity session, unavailable here): whether CLOUD_CODE_URL takes effect on the model stream, and which transport (REST/SSE vs gRPC) carries it. If gRPC turns out to be the model-stream transport, this lane degrades to verbatim passthrough until a protocol declaration or MITM route lands — the code already handles both gracefully. Live-verification asks posted in the issue thread for anyone with a running Antigravity setup (@Hiccup543).

feat -> human merge per AGENTS.md 7.4.

@ranxianglei

Copy link
Copy Markdown
Owner Author

🤖 Powered by ework · qwen3.8-27b

[bot] 🏷 Reviewing this PR now (not redoing it): pulled pr-2134 head locally, cross-checked against current master, reading the diff + original #2115 design questions. CI is still pending at this moment — I'll report the full structured review once checks land. Early signal: diff is additive (launcher/client-config/web/docs/tests only, no server pipeline touched), merge-tree shows no textual conflicts vs master.

ranxianglei pushed a commit that referenced this pull request Oct 5, 2026
@ranxianglei
ranxianglei force-pushed the 2026-10-05_antigravity-launcher branch from 3bc5baa to 177bf44 Compare October 5, 2026 02:00
@github-actions

github-actions Bot commented Oct 5, 2026 •

Copy link
Copy Markdown
Contributor

📦 Built Package Artifact

Branch: 2026-10-05_antigravity-launcher (a6269b5)

Option A — Install this exact build (recommended)

npm install -g billion-context@0.0.2180-pr.2134.121d8fa

This exact version is immutable and reproducible. The rolling pr tag tracks the newest test build across all PRs.

Option B — Download artifact

  1. Download the artifact from the Actions run
  2. Extract the tarball and install:
tar xzf billion-context-pr2134.tgz
npm install -g package

Install instructions are refreshed on each push.

@ranxianglei

Copy link
Copy Markdown
Owner Author

🤖 Powered by ework · qwen3.8-27b

[bot] 🏷 Review 中期更新 — 方向认定成立,已把分支修到可合并状态,等 CI 全绿后给最终七问结论。

审核认定(方向关):机制选型正确 —— Antigravity 的模型通道在闭源 Go language_server 内,用户插件面(additive-only)确实拦不到模型流,wire-only 经网络层是 v1 上限,launcher lane 是正解不是妥协。CLOUD_CODE_URL 未公开钩子有 v2.19.1 二进制字符串证据;按 path 识别 wire(:streamGenerateContent/:generateContent/:countTokens → google adapter)与 bili gemini 同构,gRPC path 原样透传属优雅降级且有 #1909 后路。无 bili 配置面新增(纯客户端 env),PR 披露诚实(含 live e2e 未验证的明示)。纯 additive:不碰 server pipeline/两种压缩模式/阈值/时序/缓存。

发现并已当场修掉(3bc5baa → 177bf44,已推回 PR 分支):

  1. stale base 冲突(拦点):base 停在 e6b2857,master 已前进 ~30 commits(kernel 迁移 acp-kernel 并入billion-context并保持相对独立 #2092、config-docs-gen feat: single-source config docs generated from YAML seeds (#2107) #2114 等),真实测试合并报冲突(GitHub dirty 判定属实)。已 rebase 到当前 master:唯一文本冲突在 CLIENTS.md(master 新加的 codex pins-embedded [Codex launcher] 预算参数 -c 注入导致 Codex 0.159.3 回退到 embedded mode 并显示 shared background server warning #1867 小节 vs 本 PR 改名的 Gemini 系标题),按意图并集解决 —— 两节都保留。其余文件(src/launcher.ts、src/web/* 等 master 侧也动过的)自动合并干净。
  2. src/cli.ts 帮助文本缩进漂移:qwen/mcode 两行在 usage 块和 examples 块各多了一个前导空格,antigravity 行随之错位 —— 恢复原对齐(antigravity 行因名字最长,start 列比块内其他行右移一位,已是最佳贴合)。独立 commit:fix: align antigravity/qwen/mcode help-text lines with block indent。
  3. src/launcher.ts 两处注释指向错误文档:MITM 退路配方写的是 "see CONFIGURATION.md",但 CONFIGURATION.md 里没有任何 antigravity/cloudcode 内容,配方实际在 CLIENTS.md(Gemini 系小节,en+zh)。指针改为 CLIENTS.md。独立 commit:docs: point antigravity MITM-fallback comments at CLIENTS.md。

本地定向验证(rebased head 177bf44):npm run typecheck clean;定向套件 42/42 绿(launcher-gemini-family 28 含 10 个新 antigravity case + web-i18n + web-routing,含 #1024 i18n key-parity gate)。全量回归 + build 交给远程 CI(本地测试纪律)。

CI 现状:mergeable=True(冲突已消);kernel-guard / version-guard / docs-sync / docs-coverage / build-artifact / codex-e2e / dsh-lane / pi-lane / OpenCode-V2-WS 均已 success,test 矩阵与 registry e2e 还在跑。全绿后补最终结构化七问结论。

ework-agent added 3 commits October 5, 2026 10:06
First-class Google Antigravity support as a launcher client:

- LAUNCH_CLIENTS/BaseClientName gain antigravity; resolveClientCommand
  finds the official CLI binary agy (PATH, ~/.local/bin/agy, or
  %LOCALAPPDATA%\agy\bin on Windows)
- discoverRoutes/buildAntigravityEnv set CLOUD_CODE_URL=<proxy>/bili/<upstream>
  (stock upstream https://cloudcode-pa.googleapis.com; a user-exported
  CLOUD_CODE_URL is relayed instead) - the undocumented override verified
  in the v2.19.1 language_server binary. No MITM, no CA install; the proxy
  recognizes the wire by path (:streamGenerateContent et al. -> google
  adapter), gRPC-style paths relay verbatim as a graceful degrade
- client-config: AntigravityConfig.baseUrl reads CLOUD_CODE_ENV; ModelWindowScope
  gains antigravity (no collector branch - nothing readable)
- web UI launcher chip + i18n notes (zh/en); cli usage/help lines
- docs: README zh/en table+examples, CLIENTS zh/en Gemini-family section
  incl. the built-in-plugin feasibility verdict (additive-only surfaces)
- tests: 10 new cases in launcher-gemini-family (registry, route discovery,
  env build, MCP exclusion, env config read/load)
@ranxianglei

Copy link
Copy Markdown
Owner Author

🤖 Powered by ework · qwen3.8-27b

[bot] 🏷 Review 最终结论(结构化七问) —— 审核通过,无拦点。feat 类按 §7.4 由人合并。

1. 是什么问题:功能请求 —— 给 Google Antigravity(agy CLI,Gemini CLI 继任者)加一等 launcher lane。核心难点:其模型通道在闭源 Go language_server 内,产品自带的用户插件系统全面 additive-only(工具/提示词/UI/事件回调),没有任何面能拦截或改写模型请求流。

2. 什么原因导致的:非 bug,是机制约束 —— Antigravity 对外只暴露一个网络层入口:未公开的 CLOUD_CODE_URL env override(v2.19.1 官方二进制有字符串证据 "Overriding CloudCodeServerURL via CLOUD_CODE_URL environment variable"),形态与 gemini-cli 的 base-URL 钩子同构。wire-only 经网络层是 v1 上限,launcher lane 是正解而非妥协。

3. 怎么修复的:launcher 设 CLOUD_CODE_URL=<proxy>/bili/<upstream>(默认上游 cloudcode-pa.googleapis.com;用户自导出的值按 claude relay 语义中继过代理);代理按 path 识别 wire(:streamGenerateContent/:generateContent/:countTokens → google 原生适配器,压缩行为与 bili gemini 完全一致);若服务端走 gRPC method path 则原样透传不压缩 —— 优雅降级,确认后可用 #1909 按-lane protocol 声明钉死;Google 移除 env 钩子的退路(cert-MITM)mitm.domains 配方已写入 CLIENTS.md en+zh。Review 侧另修三处(独立标注 commit):① stale base —— PR base 停在 e6b2857,master 已前进 ~30 commits,真实测试合并报冲突(GitHub dirty 判定属实),已两次 rebase 到最新 master(c7c10ba),唯一文本冲突 CLIENTS.md(master 新加 codex pins-embedded #1867 小节 vs 本 PR 改名的 Gemini 系标题)按意图并集解决、两节都保留;② src/cli.ts 帮助文本 qwen/mcode/antigravity 六行缩进漂移,恢复块对齐;③ src/launcher.ts 两处注释把 MITM 退路指向 CONFIGURATION.md,但配方实际在 CLIENTS.md(前者零提及),指针已改对。

4. 是否有回归问题:逐项审过既有行为:纯 additive。新 LAUNCH_CLIENTS 条目;discoverRoutes 分支仅 base==="antigravity" 触发;buildAntigravityEnv 与 buildGeminiEnv 同签名同模式(含同样未用的 caPath 形参,gemini 系既有惯例);web chip + i18n key 双语齐备(#1024 parity gate 绿);ModelWindowScope union 扩值但该 scope 无需收集 case(与 gemini/iflow 相同,返回空)。现有各 lane、默认值、阈值、时序、输出格式、缓存策略零触碰;server pipeline 未动 → plugin/proxy 两种压缩模式均不受影响。本版本引入回归:无。 一处 cosmetic 披露:帮助文本中 antigravity 行因名字最长,描述列比块内其他行右移一位(最小间距,无法对齐到统一列)。

5. 是否破坏缓存:不涉及 —— session identity、prefix cache、重试/去重机制全部未动。

6. 是否改了设计方向:不涉及 —— 严格沿用既有 per-client launcher 模式(gemini/iflow 一脉);wire 识别复用 google 适配器既有 path 路由,无架构转向。

7. 是否引入了新的配置:无 —— 零 bili config 字段、零 BILI_* env、零新 CLI flag。CLOUD_CODE_URL 是客户端(Antigravity)env var,launcher 仅从进程 env 读取以决定中继什么(与 GOOGLE_GEMINI_BASE_URL 同语义)。

验证:rebased head 本地定向验证 typecheck clean + 42/42(launcher-gemini-family 28 含 10 个新 antigravity case、web-i18n、web-routing);最终 head a6269b55 远程 CI 18/18 全绿,mergeable=clean。诚实披露:live e2e 仍未验证(需登录态 Antigravity 环境确认 CLOUD_CODE_URL 对模型流生效及 REST/gRPC 传输判定;代码两条路都已优雅处理,最坏退化为原样透传),合并后建议继续跟 issue thread 里的 live 验证请求。

相关立项:rebase 分析中发现 master 的 CLIENTS.zh-CN.md 缺 codex pins-embedded(#1867)小节的中文镜像(en/zh 内容差集,cbb7ba27 引入时漏译)—— 属本 PR 范围外,已单独立项 #2136(带来源标记),不混入本 diff。

收工判定:审核通过,可合。#2134 a6269b55,CI 全绿,mergeable=clean)—— 请人工合并。

@ranxianglei
ranxianglei merged commit f984400 into master Oct 5, 2026
18 checks passed
@github-actions

github-actions Bot commented Oct 5, 2026

Copy link
Copy Markdown
Contributor

📦 Merged Build Published

This merge to master was published as 0.0.45-master.f984400 (rolling master tag).

npm install -g billion-context@0.0.45-master.f984400  # this exact build
npm install -g billion-context@master  # always the newest merged build

npm view billion-context@master prints the current version at any time.

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.

feat: support Antigravity (CLI / extension) — first-class integration

1 participant