Repository navigation
[PR] fix(lanes): demote the wire clients' auxiliary calls to the side lane (discussions/6884) - #7083
Conversation
📦 Built Package ArtifactBranch: Latest build — install this exact versionnpm install -g billion-context@0.0.10743-pr.7083.b4b4cebThis exact version is immutable and reproducible. The rolling Recent builds (commit → version)
Download artifact
tar xzf billion-context-pr7083.tgz
npm install -g packageInstall instructions are refreshed on each push. |
[bot] 🏷 (ai: vllm-qwen/qwen3.8-27b) 查重: 不重复。 Open PR/issue sweep for the wire-client sidecar topic: #7083 is the only PR carrying these clauses. #7077 (pi purpose declaration) is the sibling lane this PR explicitly follows on — different mechanism (pi dispatch purpose vs. wire-client roster headers), not a duplicate. #5590 (sidecar stub ref-holding lane), #6475 (degenerate-turn gate), #3746 (threads-lane reforge) are adjacent side-lane work on different failure domains. 标签 (applied on pickup): Status (verified live): PR open, |
[bot] 🏷 (ai: vllm-qwen/qwen3.8-27b) Review complete — verdict: mergeable. CI on head What I verified independently (not from the PR body):
结构化八问:
收工判定:可合。 CI 全绿、定向回归全过、无回归发现、diff 干净; |
c6455c7 to
0c90fcb
Compare
(ai: vllm-qwen/qwen3.8-27b) Conflict resolved — verified independently, no push needed this run. What I did this run:
结构化八问:
收工判定:冲突已解,PR 现为 mergeable(behind,非 dirty),等 |
… (discussions/6884) Source-review audit (discussions/6884, five client codebases cloned and read end to end) found that the clients on the verbatim session-id roster each mint ONE id per logical conversation and the lifecycles are healthy, but every one of them fires auxiliary LLM calls under the SAME id -- titles, compaction summaries, prompt suggestions, memory, naming -- and those shapes defeat isSideRequest, so today they enter the main session's kernel pipeline as ordinary conversation turns. Each new clause is gated on the client's OWN wire signal, the same trust tier as the roster itself; no clause identifies a client from body shape alone: - grok-shell: main turns ALWAYS stamp x-grok-turn-idx (turn.rs); every auxiliary path stamps x-grok-session-id WITHOUT it (grok's own test-support contract). Session header present + turn index absent -> side. Covers every present and future auxiliary path. - mcode: title-gen's whole tool surface is the single submit_session_title tool; the prompt suggestion (default on) and the Goal evaluator are tool-less single-user one-shots. Lane gate x-mavis-session-id + shape (no tools + exactly one user). Real mcode main turns always carry the full tool surface, so they never match. - goose: every auxiliary is the dsh single-shot shape, so isDshSingleShotSidecar covers it as-is; the lane evidence is the roster header agent-session-id. - CodeBuddy: the compaction request itself carries x-compaction on the wire -- consume it. Deliberately NOT x-context-compacted, which also appears on ordinary post-compaction main turns. - opencode: the built-in title agent fires concurrently with the first main turn of every root session, under the root's own id, no tools, no budget, single user framed by a fixed template. The constant User-Agent is the lane evidence and the template text the shape (closes the pure-proxy hole the #1699 note in side-request.ts describes; that defense required the plugin's header). Untouched: the isSideRequest signature (truth-table pins stay green), the dsh purpose contract (#6880 stays byte-for-byte), the demote gate, and every non-roster client path. Tests: tests/issue6884-wire-client-sidecars.test.ts pins each clause's shape on and off the lane signal plus two pure-predicate pins; the e2e mavis fixture gains the tool surface a real mcode main turn carries; the side-lane boundary allowlist admits the three new gate symbols.
(ai: vllm-qwen/qwen3.8-27b) Red CI resolved — both failures were runner-load flakes, rerun is green, no code change needed. What I did this run:
结构化八问:
遗留记录(已同步 #4599 总控):两个测试的负载敏感性签名已留档—— 收工判定:CI 全绿(run 44212326647 attempt 2 success),PR mergeable(behind,非阻塞),具备合并条件。 |
0c90fcb to
687941b
Compare
[ework] auto-fix stalled: test (windows-latest, 22, 4), test (windows-latest, 22, 3) — stopping for human review |
(ai: vllm-qwen/qwen3.8-27b) Status confirmation — work is done and fully verified (full 八问 analysis is in my previous comment above).
Verdict: ready to merge. |
(ai: vllm-qwen/qwen3.8-27b) CI triage on new head What I verified this run (all live):
State: the PR itself is clean — 26/27 jobs green, the one red is inherited from master and will stay red for every PR rebased onto 八问(中文,供人工 reviewer):
判定:红为继承性 master 红(同测试、同签名),PR 本身干净;等哨兵把修复收敛到 ci-fixes/master 后 rebase + 重跑即绿,在此之前本车道不碰 PR 分支。 |
…led its own child on win32) test 4 (added by 894835a, #7026 review) assumed POSIX signal semantics: process.kill(self, SIGINT) was expected to dispatch to the installed handler and drive the graceful-shutdown chain. On WINDOWS the same call terminates the process (TerminateProcess) WITHOUT running the handlers - Node docs: 'On Windows, the signal being used to terminate a process cannot be changed. SIGTERM is sent.' Verified on a win10 box: SIGINT and SIGTERM self-kills die the process with the handler never invoked. The windows-latest CI child therefore died at the first kill line: file-level failure, zero TAP output, deterministic. Invoke the installed handler directly on win32 instead (the identical shutdown() path a console Ctrl+C would deliver). Also: bounded wait for the stubbed exit instead of a fixed 500ms sleep (each flush stage is deadline-capped at 5s, so a fixed sleep races slow volumes on every platform), and keep the exit stub in finally while the chain is still pending (last test in the file; a late REAL exit(0) would kill the runner before the TAP summary). Verified: 4/4 pass on a real win10 box (node v22.23.2), 4/4 on Linux.
📦 Merged Build PublishedThis merge to master was published as npm install -g billion-context@0.0.1231-master.548e396 # this exact build
npm install -g billion-context@master # always the newest merged build
|
Master advanced 4b77eab..548e396 (3 commits: wire-client sidecars ranxianglei#7083, Windows-portable shutdown-signal test) while resolving the prior conflict. Clean auto-merge — the 3 commits touch src/server/handle.ts + side-lane/shutdown tests, none of which the PR modifies. typecheck clean.
…lict at 0.0.200 Master advanced past the PR base again (batch11 wave11 #6827, lean-compress receipt #7105, wire-client-sidecars #7083, p1 batch b2/b3, #7087, #7101 -> kernel 0.0.199, storage-render goldens regenerated for #6775 persisted fields, 400 files). Content hunks auto-merged (kernel/src/compress.ts, kernel/src/types.ts, all four storage-render goldens); the only conflicts were the three kernel version lines, resolved at 0.0.200 = master's 0.0.199 + this PR's kernel/src change, per the CI-enforced kernel version discipline. Targeted local verification: tests/golden-storage-render.test.ts 5/5, tests/storage-state-fields.test.ts 2/2, kernel issue6116/issue3769/ hide-consumed suites 27/27.
What was broken
Our session-keying audit (discussions/6884, five client codebases cloned and read end to end) confirmed the good news first: every client on the verbatim session-id roster mints one id per logical conversation, and the id lifecycles are healthy.
The bad news: each of them also fires auxiliary LLM calls under the SAME id — title generation, compaction summaries, prompt suggestions, memory, conversation naming. Those requests have "one-shot" body shapes that today's side-request heuristics misclassify as ordinary conversation turns, so they enter the main session's kernel pipeline: junk turns in the snapshot, usage-baseline pollution, stats inflation.
The fix
One clause per client, each gated on the client's own wire signal (its session header / its compaction header / its constant User-Agent) — the same trust tier as the session-id roster itself. No clause identifies a client from body shape alone, so a non-client can never be mislabeled.
x-grok-turn-idx(turn.rs:3002-3003); every auxiliary path stampsx-grok-session-idwithout it — grok's own test-support contract (README:32). Header present + turn index absent → side lane. Covers every present and future auxiliary path, since the contract is the discriminator, not a per-path list.submit_session_titletool; the prompt suggestion and the Goal evaluator are tool-less single-user one-shots reusing the main turn's headers (prompt-suggestion-service.ts:655-692). Lane gatex-mavis-session-id+ shape. Real mcode main turns always carry the full tool surface, so they can never match.isDshSingleShotSidecarcovers it as-is; the lane evidence is the roster headeragent-session-id.x-compactionon the wire — now consumed. Deliberately notx-context-compacted, which also appears on ordinary post-compaction main turns and would have demoted the real mainline.session/title.ts). The constantUser-Agentis the lane evidence and the template text the shape — this closes the pure-proxy hole described in the opencode v2 title-gen requests get injected with compression philosophy (misclassified by isTitleGen) #1699 note inside-request.ts(that defense required the plugin's header).Untouched: the
isSideRequestsignature (all truth-table pins stay green), the dsh purpose contract (#6880 stays byte-for-byte), the demote gate, and every non-roster client path.Tests
tests/issue6884-wire-client-sidecars.test.ts(new): pins each clause's shape on the lane signal (goes side: zero kernel requests, forwarded verbatim) and off it (control requests keep the full pipeline), plus two pure-predicate pins.tests/e2e-session-identity.test.ts: the mavis fixture gains the tool surface a real mcode main turn carries (identity coverage unchanged).tests/side-lane-invariants.test.ts: the boundary allowlist admits the three new gate symbols.