Repository navigation
fix: apply the effective render strategy consistently across all lanes (#2483) - #2485
Conversation
[bot] 🏷 上游冲突已解决并推送( 1. 是什么问题:系统转发上游冲突唤醒——本 PR 分支与 master 产生文本冲突。master 在分支切出点(f2b84b6)之后前进到 4d5dab9(release v0.1.189 及后续),其中 #2432(compress circuit breaker cause-awareness)恰好改动了本 PR 触碰的同一行区域: 2. 什么原因导致的:两个独立变更落在同一行邻域——本 PR 把 3. 影响范围与严重程度:冲突本身零运行时影响——风险只在解决方式上:若只保留一侧,要么丢掉 breaker 的 nudge 熔断门(master 行为回归),要么丢掉策略变量(PR 目的落空)。按「两侧意图取并集」解决后无影响面。 4. 怎么修复的:按 house style 用 merge commit(非 rebase/force-push)把 origin/master 合入分支;三处冲突逐处取并集——保留本 PR 的策略变量( 5. 是否有回归问题:无。验证证据:① 合并树 vs PR head 对三个文件的 diff 恰好等于 master 侧新增(breaker import、#2432 dsh native-compaction rebase、#1933/#2407 billed-caliber denominator 等),两侧内容零丢失;② typecheck 绿(kernel + pi-subagents pre-hook 构建通过);③ 定向测试 38/38 绿——本 PR 自己的 6. 是否破坏缓存:不涉及。缓存/重试/增量游标逻辑未触碰;cache-ledger 改动仅新增一行提示文本(PROVIDER-SIDE MISS 段,报告输出)。 7. 是否改了设计方向:不涉及。仍为原 PR 机制家族;核心诉求(per-route 8. 是否引入了新的配置:不涉及。复用既有 顺手小修(独立标注 commit 结论:可合。 冲突已清、两侧意图完整保留、定向验证全绿;待 CI 对新 head 跑完即可由人工合并。 |
📦 Built Package ArtifactBranch: Option A — Install this exact build (recommended)npm install -g billion-context@0.0.2908-pr.2485.be1797fThis exact version is immutable and reproducible. The rolling Option B — Download artifact
tar xzf billion-context-pr2485.tgz
npm install -g packageInstall instructions are refreshed on each push. |
7f1a2ce to
854eabf
Compare
…2483) - google lane honored renderNone not at all (dead config on /v1beta): processTurn, Prepared.renderTags, countTokens hardcoded "text-only" and the #1881 tagsOnly gate had no knob check; now mirrors openai lane - diagTagSummary call sites hardcoded "text-only" in all four lanes, so the processTurn log line lied under renderNone; pass the effective value - cache report PROVIDER-SIDE MISS section names the stateful-upstream failure mode (#2483) and points at diagnostics.renderNone=true - e2e tests pin default tagging AND renderNone byte-identity on both the OpenAI-chat and Gemini-native wires
854eabf to
0690f4f
Compare
|
Rebased onto current master (0690f4f) — was DIRTY against the four Conflict resolution notes (semantic union, both sides preserved):
Verified: typecheck 0; issue2483-render-strategy 4/4 (new e2e pins), issue2490-ledger-floor-doomed-probe, issue2122-clamp-calibration 7/7, issue2636 model-switch, e2e-plugin-grow-compress, compress-observability — all green. CI running. |
…epared returns) — re-introduced by rebase
[bot] 🏷 收到 rebase 报告,已对 rebase 后的 head( 1. 是什么问题:确认你报告的 rebase——分支已被 force-update 为单 commit 2. 什么原因导致的:rebase 重建时未携带我之前的 style commit(它只改空格、无内容价值,被正常丢弃),导致两处空格瑕疵重新出现;非语义问题。 3. 影响范围与严重程度:仅内部实现/外观,零运行时影响。 4. 怎么修复的:核验结论——① rebase 后 head vs 其父 commit 的 diff 恰好是原 PR 的 7 个文件、+311/-16,stat 与原始 PR 完全一致,无内容丢失;② 四处 5. 是否有回归问题:审了 rebase 触碰的全部既有行为——nudge 注入守卫链(breaker/autoFold/growthFolding/codex-ratio)、anthropic cache-controls 字段、google ledger-floor clamp 与本 PR renderNone 的共存,均为两侧意图并集,与你的 notes 逐条对上;无语义漂移、无阈值/时序变化。默认配置 wire 字节不变。 6. 是否破坏缓存:不涉及。 7. 是否改了设计方向:不涉及。 8. 是否引入了新的配置:不涉及。 当前状态: |
📦 Merged Build PublishedThis merge to master was published as npm install -g billion-context@0.0.238-master.6064a0e # this exact build
npm install -g billion-context@master # always the newest merged build
|
…der-strategy consistency) All four wires gain a constant +65 bytes per outbound body from turn 0 (#2485 applies the effective render strategy consistently across lanes); nudge/stats/state sections shift accordingly. foldAt/editedAt/blockContents unchanged. Regenerated at branch HEAD (4b3e3b4 + storage-mode stamp).
…der-strategy consistency) All four wires gain a constant +65 bytes per outbound body from turn 0 (#2485 applies the effective render strategy consistently across lanes); nudge/stats/state sections shift accordingly. foldAt/editedAt/blockContents unchanged. Regenerated at branch HEAD (4b3e3b4 + storage-mode stamp).
…der-strategy consistency) All four wires gain a constant +65 bytes per outbound body from turn 0 (#2485 applies the effective render strategy consistently across lanes); nudge/stats/state sections shift accordingly. foldAt/editedAt/blockContents unchanged. Regenerated at branch HEAD (4b3e3b4 + storage-mode stamp).
Part of #2483 — the immediately-actionable consistency fixes from the issue thread. The core ask (per-route render-tags control for stateful upstreams, e.g. magpie / Claude Code relays) awaits owner sign-off on the proposed
compress.renderTagsdesign discussed in the issue; this PR ships the rest of the mechanism family.Changes
renderNone(src/server/prepare-google.ts).ACP_RENDER_NONE/diagnostics.renderNonewas dead config on/v1beta:processTurn,Prepared.renderTagsandcountTokensall hardcoded"text-only", and the [bug] ACP 标签泄漏:<acp tokens=...> 标签被模型原样复述到回复正文,仅靠系统提示劝阻不足 #1881 tagsOnly prompt gate had no knob check (unlike the other three lanes). Now mirrors the openai lane: one strategy const drives processTurn, the diag log, Prepared and the tagsOnly gate.diagTagSummary(messages, sessionId, strategy)takes a strategy parameter, but every call site hardcoded"text-only"— so theprocessTurn:line kept printingrenderTags=text-onlywhile the tag counts provednonewas active (the reporter's Minor complaint). Each lane now passes its effective value.src/cache-ledger.ts). ThePROVIDER-SIDE MISSsection now names the stateful-upstream failure mode (render tags on echoed assistant text break session continuity on stateful upstreams (magpie / Claude Code), causing full-history cache misses #2483): a gateway validating echoed history against its own transcript rejects bili's render tags even though bili's list is unchanged → points atdiagnostics.renderNone=true, notes the expected single replay when flipping mid-session.Behavior changes (disclosed)
ACP_RENDER_NONE/diagnostics.renderNone; default is byte-identical (pinned by new e2e tests)processTurn:log linerenderTags=text-onlyconstant/acp-cachePROVIDER-SIDE MISSNo config surface change (reuses existing
diagnostics.renderNone; no new fields/env vars). No kernel change. No wire change under default configuration.Preflight audit (left unchanged, verified safe)
src/preflight.ts:1172/:1274also hardcoderenderTags: "text-only", but preflight's rendered view is estimation-only: after any compression the server re-runsrunPrepare()and forwards the PREPARE-rendered body (src/server.ts:4677), so those bytes never reach the wire. Preflight already estimates with its own deliberate view (noEmergencyTruncateconfig); undernoneits estimate is conservatively larger by the tag bytes (~tens of bytes per tagged message) — folds marginally earlier, never later. No fix needed.Tests
tests/issue2483-render-strategy.test.ts(new, ungated, hermetic): e2e through the real proxy on both the OpenAI-chat and Gemini-native wires — default still tags assistant/model text (behavior pin); underACP_RENDER_NONE=1forwarded text is byte-identical to the model's raw output and the NEVER-echo section disappears (both lanes).tests/cache-seam-detector.test.ts: pins the new hint line in the PROVIDER-SIDE MISS section.