Repository navigation
[PR] fix(server): side-lane requests skip the degenerate-turn gate (#6466) - #6475
ranxianglei wants to merge 3 commits into
Conversation
…#6466) A side-lane request (dsh title-gen / auto-review / single-shot) is a best-effort utility call that rides the non-injected streaming branch. It previously received a live continuation refetch, so the pipe's degenerate-turn gate (#732/#821 retry + #870 in-band error) fired for it: a title request that came back with no visible text (reasoning-only under effort=max) was re-issued (double-billing a utility call) and, on a second empty response, the client got an in-band stream error that DSH wrote into the session title. Pass refetch=undefined for sidePassthrough requests, which disables the pipe's degenerate gate AND the cut retries. The non-side-lane non-injected path keeps the gate unchanged (the ternary is a no-op for it). The non-streaming JSON pipe and the commandcode JSONL pipe take no refetch, so no other call site is affected.
Drive a degenerate (echo-only) SSE turn through the relay hermetically: - side lane (dsh title sidecar, stream): ends as-is — 1 upstream hit, no retry, no #870 in-band error. - control (non-side-lane non-injected main turn, stream): still retries once and escalates to the #870 in-band error — the main path is unchanged. Gate discipline #3617: both directions asserted. Reverting the relay ternary turns the side-lane case red (bug reproduced).
📦 Built Package ArtifactBranch: Latest build — install this exact versionnpm install -g billion-context@0.0.9525-pr.6475.7f47fffThis exact version is immutable and reproducible. The rolling Recent builds (commit → version)
Download artifact
tar xzf billion-context-pr6475.tgz
npm install -g packageInstall instructions are refreshed on each push. |
…ted vehicle (#6466) #6466 removed the side-lane continuation refetch (side lane ends as-is), which broke the two #4204 tests that used a side-lane degenerate turn as the vehicle to trigger the continuation refetch. Re-target both to a main-lane (non-side) non-injected request (budget > 200), which still performs the continuation refetch, so the #4204 429-scoping mechanism keeps its e2e coverage.
[bot] 🏷 查重: 不重复 — the only adjacent open PR is #5897 (empty-turn continuation retry off by default + neutral nudge wording). Different mechanism: #5897 makes the empty-turn continuation retry opt-in wholesale; #6466/#6475 makes side-lane (title-gen / auto-review / single-shot) skip the degenerate-turn gate. Same "empty-turn / continuation retry" family, but not a duplicate — worth keeping in mind for interaction when both land. Review: PR #6475 — side-lane requests skip the degenerate-turn gate (#6466)Verdict: mergeable. The core fix is correct; I found and fixed the one CI regression it introduced; all 12 CI workflows now pass on the updated head. What I verifiedCore fix is correct. The non-injected streaming branch now passes Branch structure is sound. The fixed branch is the only place a side-lane streaming request could carry the gate. The reasoning-guard branch (line 2357) and the fake-completion retry (line 2396) already exclude The new test has teeth. Regression I found and fixedThe PR's first head failed CI on 3 shards (deterministic, not flake) with the same 2 tests:
Root cause: both #4204 tests used a degenerate side-lane turn as the vehicle to trigger the continuation refetch, then asserted the 429 on the refetch is model-scoped (KeyRing marker) not credential-wide. #6466 removed the side-lane refetch, so Fix (pushed as commit Verification on the updated head (
Behavior change (disclosed)
Merge-readiness noteThe PR is 50 commits behind master (busy repo) but mergeable with no conflicts, and I confirmed the 50 new master commits don't touch any of the PR's files ( 结构化八问
收工判定:可合并。核心修复正确,我引入的 CI 回归已修复并推送( |
[bot] 🏷 Status confirmation (the full review is the
Nothing further needed from me — merging stays human-only. |
Closes #6466
What
A side-lane request (dsh title-gen / auto-review / single-shot) is a best-effort utility call that rides the non-injected streaming branch. It previously received a live continuation refetch, so the pipe's degenerate-turn gate (#732/#821 retry + #870 in-band error) fired for it: a title request that came back with no visible text (reasoning-only under effort=max) was re-issued (double-billing a utility call) and, on a second empty response, the client got an in-band stream error that DSH wrote into the session title (
❌ [ACP] stream error: the turn degenerated again ...).Fix
Pass
refetch=undefinedforsidePassthroughrequests in the non-injected streaming branch (src/server/relay.ts).refetch=undefineddisables the pipe's degenerate gate (retry + #870) AND the cut retries. The non-side-lane non-injected path keeps the gate unchanged (the ternary is a no-op for it). The non-streaming JSON pipe and the commandcode JSONL pipe take no refetch, so no other call site is affected.Behavior change
Tests
tests/issue6466-side-lane-skip-degenerate-gate.test.tsdrives a degenerate (echo-only) SSE turn through the relay hermetically, asserting both directions (gate discipline #3617):Reverting the relay ternary turns the side-lane case red (bug reproduced). Typecheck clean; related existing suites (plugin-empty-turn-retry, dsh-title-sidecar-handle, side-lane-truth-table, issue2756-degenerate-gate, side-lane-invariants) all green.