Repository navigation
test: pin fold re-request / next-turn prefix parity guard (#2929) - #2933
Conversation
📦 Built Package ArtifactBranch: Option A — Install this exact build (recommended)npm install -g billion-context@0.0.3269-pr.2933.42abdc6This exact version is immutable and reproducible. The rolling Option B — Download artifact
tar xzf billion-context-pr2933.tgz
npm install -g packageInstall instructions are refreshed on each push. |
Issue #2929 found a systematic cache double-miss after folds whose post-fold prefix was first served on an intra-turn loop re-request: the next client turn hit only the instructions baseline. Static audit plus this probe show the two construction paths (loop refreshFolded rebuild vs steady prepare-responses forward) are byte-equivalent through the summary anchor on current master for production-faithful clients (native item ids, reasoning items, nudge, proxy tool round). This guard pins that parity so future changes to either path fail loudly instead of regressing into the #1548/#1592 seam family.
05ec446 to
2cba06e
Compare
[bot] 🏷 Review 完成(这是本 agent 在 #2929 上开的防护性测试 PR,按 [PR] 流程核对代码 + 验证 + 收口,未重做)。已把分支 rebase 到当前 master 并补了一个小修,CI 在新 head 上运行中。 ① 方向关(审原 issue):#2929 的结论链成立——6/6 Type-A fold 的「基线-only 命中 + 一轮恢复」签名、bili 侧全路径静态审计 + 本地探针字节级实测均指向 relay 多实例缓存语义而非 bili wire 缺陷;「不变量当前成立但无钉」→ 用 hermetic 回归测试钉住,是正确的最小交付。同意不硬造行为修复。 ② 重复判定:与既有 seam 家族 pin 有交集但非重复—— ③ 代码审查:单文件 顺手小修(已推独立标注 commit rebase + 定向验证:PR 原 base 落后 master ~20 提交(含 #2735 preflight-codex-shape,动了 codex wire 形状,与本家族相邻)→ 已 rebase 到
CI:新 head 结构化八问
判定:可合——待 CI 全绿(合并由人执行:#2933 )。#2929 本体保持打开,等 dump 复现会话/relay 方答复做最终归因。 |
📦 Merged Build PublishedThis merge to master was published as npm install -g billion-context@0.0.333-master.d9de589 # this exact build
npm install -g billion-context@master # always the newest merged build
|
References #2929 (codex hit-rate analysis) — this is the bili-side deliverable of that analysis; the issue itself stays open pending relay-side data.
What this is
A single new hermetic test (
tests/issue2929-codex-fold-double-miss.test.ts) that pins the prefix-parity invariant between the two outbound-body construction paths that share one session:refreshFolded→ adapterbuildRequest), andprepare-responses).It asserts both bodies are byte-identical through the summary anchor (the exact property whose violation produces the #1548/#1592/#377 seam family — "post-fold cache floor reset to the stable head").
Why (from #2929)
The reported 79% codex hit rate turned out to be dominated by a systematic pattern: after any fold whose post-fold prefix was FIRST served on an intra-turn loop re-request, the next client turn cached only the instructions baseline (~14.5K), then recovered fully on the following turn (6/6 folds behaved identically). Folds whose first exposure was a steady forward chained perfectly.
Full static audit of every candidate asymmetry (strict-echo gating, nudge placement, stripKernelSummaries carrier logic, repairResponsesAssistantOrdering, dropReasoning mirroring, item-id handling — both paths share
patchResponsesInputWithToolImages) plus this probe (run with production-faithful fixtures: native ids on all items, persisted reasoning items, nudge + proxy-tool round + mid-turn compress) shows current master emits identical bytes on both paths — no reproducible bili-side wire defect remains. The residual evidence points at the upstream relay's cache routing/sharding semantics (the deployment is multi-instance per #1724 logs; baseline-only hits plus invisible baseline drift 14508→10948 are inconsistent with a single byte-prefix store).So there is no behavior fix to ship here — but the invariant above is load-bearing and currently un-pinned. If any future change to either path breaks it, this test fails with the first divergent item index instead of the regression surfacing as production cache misses.
Scope
listen(0)ports, no env gates, runs in <5s.