Repository navigation
[PR] fix: wire-neutral affinity projection for parallel tool rounds (#6659) - #6675
ranxianglei wants to merge 0 commit into
Conversation
📦 Built Package ArtifactBranch: Latest build — install this exact versionnpm install -g billion-context@0.0.9938-pr.6675.dfd7f7eThis exact version is immutable and reproducible. The rolling Recent builds (commit → version)
Download artifact
tar xzf billion-context-pr6675.tgz
npm install -g packageInstall instructions are refreshed on each push. |
7d3f543 to
f43545f
Compare
(ai: vllm-qwen/qwen3.8-27b) 查重: 100% 重复 #6660 — 同一 issue #6659、同一症状、同一机制、同一根因,且 #6660 先到(2026-11-14 06:32 UTC,外部贡献者 Afloat16),本 PR 后到(08:14 UTC,晚 1h42m)。按先来后到政策:后到的本 PR 应关闭、先到的 #6660 保留。按 no-close/no-relabel 政策我未关闭也未改标签,处置请你拍板。 证据(两分支逐行 diff 核对,非凭标题判断):
本 PR 独立技术审核(结论:技术上成立,若你决定保留它,审核已就绪):
八问(针对修复本身 —— 两个 PR 代码语义相同,答案对两者都成立):
选项对比(八问之后):
推荐:按先来后到,保留 #6660、关闭本 PR。若保留 #6660,它还有三件小事:rebase 到最新 master、补标签、核实那两个 Windows 失败是否继承自 master(#4599 最新评论停在 10-24,无法直接确认)。若你倾向保留本 PR(CI 在跑、已打标、已 rebase),那是对先来后到的偏离,需要你明确拍板。不决定的默认行为:两个 PR 都挂着,最终由你处置。 |
f43545f to
e7a42ba
Compare
(ai: vllm-qwen/qwen3.8-27b) Conflict resolved — and the PR ended up fully superseded: its entire content is already in master, so it is now closed (unmerged). What I did this run (all verified live):
One judgment call, flagged: the PR's 3 unit-test variants (all-four-wires identity, session-retention across responses/google switches, over-merge guard) were dropped with the commit — master's #6660 tests already pin the same behavior (2 focused unit tests + the extended e2e crosswire test with a parallel round). If you want those specific variants kept, say so and I'll add them as a small follow-up. 八问:
判定: 冲突已解除,PR 已因内容完全并入 master 而关闭,无残留 CI 红项,无需再合并。 |
Problem
A parallel tool round with no assistant commentary projected to different turns on the Responses wire and the Gemini wire than on OpenAI/Anthropic, so re-rendering the same logical history on an affected wire changed the identity chain. A stateless client switching protocol minted a fresh anonymous
pfa-*session and orphaned its fold state.function_callitem when no commentary opened a pending run → an extra assistant turn per call.functionResponsebody in a user message'spartssurvived → the earlier results were dropped from the neutral projection.Fix (host affinity projection only — no kernel, no wire-payload mutation)
function_callitems in one pending assistant run even when no commentary opened the run, so a parallel round projects to a single calls turn. Sequential rounds (call → output → call) still flush on the intervening tool output and stay separate turns.functionResponsepart body in order, not just the last.Existing result-wrapper normalization, result boundaries, trailing user text, and the OpenAI/Anthropic projections are all preserved (covered by the existing single-call and commentary-parallel tests, which still pass).
Tests
tests/affinity-neutral.test.ts: three new focused cases — (1) a parallel round projects to identical turns on all four wires; (2) the same anonymous session is retained across Responses and Gemini switches (prefix match, not fork); (3) sequential single-call rounds stay separate turns (over-merge guard). Cases 1–2 fail on the unchanged source; case 3 passes on both.tests/affinity-crosswire-fold.test.ts: the existing loopback proxy/fold test is extended with a parallel round on the established session; the Responses + Gemini phases now render the round in the affected wire shapes. On the unchanged source it observes twopfa-*sessions after the Responses switch (the exact reported symptom); with the fix it retains one session, both tool outputs, its fold blocks, and its summary carrier, with no extra fold request.Behavior change (flagged per policy)
The neutral projection of a parallel tool round on the Responses/Gemini wires changes (that is the fix). Consequence: a session that was established and stayed on the Responses or Gemini wire with a parallel round in its history will fork once on upgrade, because its old noted chain used the pre-fix projection. This is the same one-time fork + fold re-pay the bug already caused on every wire switch, now also triggered by an upgrade. Sessions without parallel rounds, and sessions on the OpenAI/Anthropic wires, are byte-identical and unaffected. No version bump: the change is a bug fix inside the existing v2 neutral domain, and bumping to v3 would fork every session on upgrade.
Verification
affinity-neutral(8/8),affinity-crosswire-fold(2/2),prefix-affinity+ simhash + orphan + neutral-skeleton + anonymous-anchor + anon-provenance (80/80), affinity persist/snapshot/unified-store + relay-affinity + order persist/unified-store (36/36), skeleton/responses-ordering/persona/order-centric/tool-pair (77/77).npm run typecheckclean;npm run buildOK.Closes #6659