Repository navigation
[PR] feat: wire google lane into snapshot render (#3764) - #3770
Conversation
📦 Built Package ArtifactBranch: Option A — Install this exact build (recommended)npm install -g billion-context@0.0.4469-pr.3770.46a7f89This exact version is immutable and reproducible. The rolling Option B — Download artifact
tar xzf billion-context-pr3770.tgz
npm install -g packageInstall instructions are refreshed on each push. |
(ai: vllm-qwen/qwen3.8-27b) 查重:不重复。 检索了 open+closed 的 issue 与 PR:无其他 snapshot-render / google 车道相关条目在途。本 PR 与 #3756(设计)→ #3759(openai/anthropic/responses 三车道实现,已合并)→ #3764(缺陷报告:google 车道缺位)是上下游关系,不是重复立项;本 PR 即 #3764 的修复交付物,无并列的重复修复。 标签:bug · gemini · scope/wiring · p2(#3764 缺陷类补全;客户端为 Gemini native wire;改动面在协议接入层 prepare-google.ts;rollout 默认关、当前无线上影响,但启用后 google 整条 wire 才获得其他三车道的 #3752 保护 → p2)。 审核进行中,先报状态:
|
(ai: vllm-qwen/qwen3.8-27b) 总判定:代码通过审查;合并被一个与本项目无关的 CI 红阻塞(该红是 #3759 引入的 master 既有问题,已跟踪于 #3771、修复 PR #3774 在途)。建议:#3774 落地(并覆盖 google 车道,见下)→ 本 PR rebase → 全量矩阵转绿后合并。功能有 rollout 门控(默认关),不紧急。 八问:
行为变更披露(按规范):启用 交叉事项(均已处置):
收工判定:代码质量达标(单模块、parity 正确、测试有牙、无回归、无新配置面),review 侧放行;合并等待 #3774 覆盖 turnGoogle 并落地 + 本 PR rebase 后矩阵转绿。 |
prepareGoogle now consumes maybeSnapshotView for effectiveTokenCount and core.processTurn (reconcileFoldCoverage keeps observing the client view), mirroring the openai/anthropic/responses lanes landed in #3759. Reasoning-drop is deliberately absent on this wire (#651: Gemini validates thoughtSignature), so only two consumers switch, not three. Adds google variants to tests/snapshot-render.test.ts driven over the native Gemini wire: steady-state prefix byte-stable, seed-upgrade prefix byte-identical across the #3752 identity re-mint (via __setMessageIdSaltForTests), and the D-off control showing the legacy path still churns. Rollout-gated behind BILI_ROLLOUT_SNAPSHOT_RENDER and default-off, so no behavior change until enabled.
322502e to
3d7a069
Compare
📦 Merged Build PublishedThis merge to master was published as npm install -g billion-context@0.0.597-master.2b40342 # this exact build
npm install -g billion-context@master # always the newest merged build
|
#3772) A `labeled` event for any non-ci:full label starts a run whose gate/plan job immediately decides skip, but it shared the per-ref concurrency group of in-flight real runs with cancel-in-progress=true — so the vacuous skip-run cancelled the real matrix mid-flight and then recorded success with an empty matrix (false green + 40+ cancelled runs per label burst; #3770 repro). Append a `-skip` suffix to the concurrency group for exactly those trigger-time events (pull_request + labeled + label != ci:full — the same predicate each gate/plan job already uses), so skip-runs can never cancel in-flight runs; they finish in ~20s as a harmless trace. ci:full labeled runs stay in the base group and still supersede in-flight core runs (#3295); schedule/dispatch/push events are unaffected (suffix is ''). All 13 workflows with a labeled trigger AND a cancel-in-progress group: ci.yml, ci-image.yml, ci-e2e.yml, ci-registry.yml, ci-zcode-real.yml, ci-e2e-dsh.yml, ci-e2e-dsh-native.yml, ci-e2e-codex-persona.yml, ci-e2e-native.yml, ci-e2e-native-opencode.yml, ci-e2e-pi-ws.yml, ci-windows-codex.yml, ci-e2e-fake.yml. ci-theorem.yml excluded: no concurrency block, nothing to cancel there.
Wires the google lane into the #3759 snapshot-render feature, closing the gap left as a v1 non-goal and now orphaned after #3752 closed.
What / why
prepareGooglenow consumesmaybeSnapshotView(session, msgs, …)for its two consumers (effectiveTokenCount+core.processTurn), exactly mirroring the openai/anthropic/responses prepares landed in #3759.reconcileFoldCoveragekeeps observing the client view, same as those lanes.Before this change the google lane rode the legacy path: a google session's fold overlay stayed anchored to the client-resent bytes, so the #3752/#3751 id-churn family existed intact on the google lane, and the
BILI_ROLLOUT_SNAPSHOT_RENDERswitch had no effect on google sessions (the engine entry point wasn't in this prepare at all).Only two consumers switch here, not three: the google wire deliberately has no reasoning-drop (#651 — Gemini validates
thoughtSignatureon replayed parts, and dropping a thought part takes its signature with it → 400). This divergence is documented in the prepare.The engine is wire-agnostic (it eats core
BiliMessage); zero engine changes were needed. The one projection seam worth noting: the syntheticacp_summary_<blockId>anchor is a mid-stream system core, andcoreToGooglerides non-assistant cores onto the user side (Gemini has no system role insidecontents) — so the anchor renders without needingsystemToUser.Tests
Adds google variants to
tests/snapshot-render.test.ts, driven over the native Gemini wire (streamGenerateContent?alt=sse):metadata.snapshotRenderTurnslatch counting.__setMessageIdSaltForTests("upgrade-v2")seam; prefix stays byte-identical across the 0.1.200 → 0.1.201 upgrade (#3658 identity change) mass-unfolds persisted sessions incl. Anthropic lane; downgrade re-churns #3752 re-mint, block survives, no destroy verdict.Prefix stability is asserted on the joined text sliced through the summary rather than element-wise, because
coreToGooglemerges same-side runs (the anchor can share a contents entry with the live tail).Local:
npm run typecheckclean;tests/snapshot-render.test.ts+tests/e2e-google-compress.test.ts= 14/14 pass (the real e2e-google-compress regression suite confirms the prepare change doesn't disturb existing google compression). Full-suite verdict comes from CI on the pushed head.Behavior change (flagged)
Rollout-gated behind the existing
BILI_ROLLOUT_SNAPSHOT_RENDER; default-off ⇒ no behavior change until enabled. When enabled, google sessions' outbound prefix renders from the unified transcript (server-authoritative, fold-time ids) instead of re-deriving identity from client bytes — identical semantics to the three lanes already shipped. No new config surface (reuses the existing rollout gate; no config field added).Scope gates
src/server/prepare-google.ts+ its test). Nokernel/change, no config schema change, no version bump.Closes #3764