Repository navigation
[PR] fix(dsh): read the status wire field fallback, not the internal viaFallback - #6971
ranxianglei wants to merge 1 commit into
Conversation
…aFallback` The DSH client's ownership gate (sessionOurs) read o.viaFallback from the /__bili/plugin/status response, but the server has always sent fallback (src/plugin.ts handlePluginStatus). The field never matched, so sessionOurs was a constant true and the gate never fired: a host session with no bili lane entry (seeded forks, pre-lane sessions, fresh sessions) rendered another, unrelated session's handoff in its Context tab. Fix the client to read the real wire field (o.fallback). Works against every server version (all send fallback); no server change, no redundant field. The existing regression test simulated the server sending viaFallback: true — a response the server never emits — so it passed without ever exercising the gate. It now simulates the real wire field (fallback: true), and a new negative-direction case pins that a fallback resolving to OUR OWN session is still framed (#3617 both directions). Closes #6968
📦 Built Package ArtifactBranch: Latest build — install this exact versionnpm install -g billion-context@0.0.10481-pr.6971.d3133b1This exact version is immutable and reproducible. The rolling Recent builds (commit → version)
Download artifact
tar xzf billion-context-pr6971.tgz
npm install -g packageInstall instructions are refreshed on each push. |
(ai: vllm-qwen/qwen3.8-27b) Verdict: mergeable (可合). The fix is correct, minimal, and the test now genuinely exercises the gate. Verified against the live PR head Independent verification (re-derived, not taken from the issue/PR text):
Note (not a blocker): #6968 documents three facets; this PR fixes facet #2 (the client guard key mismatch) — the direct cause of the user-visible symptom. The other two are separate follow-up candidates, not regressions and not part of the symptom this PR fixes:
结构化八问:
结论:可合。 修复正确、最小、测试双向且已实测能抓到 bug,无回归。facet #1 / #3 未在本 PR 处理,属独立后续候选,是否立项由你定。 |
Summary
Fixes the DSH Context tab rendering another, unrelated session's handoff when the host session has no bili lane entry (seeded forks, sessions predating the bili lane, freshly created sessions).
Root cause: the client's ownership gate (
sessionOurs) reado.viaFallbackfrom the/__bili/plugin/statusresponse, but the server has always sentfallback(src/plugin.tshandlePluginStatus). The field never matched, sosessionOurswas a constanttrueand the gate never fired — the iframe navigated to whatever session was most-recently-active in the proxy process.Fix: the client now reads the real wire field (
o.fallback). Works against every server version (all sendfallback); no server change, no redundant field added to the wire.Test: the existing regression test simulated the server sending
viaFallback: true— a response the server never emits — so it passed without ever exercising the gate (a false test). It now simulates the real wire field (fallback: true), and a new negative-direction case pins that a fallback resolving to OUR OWN session is still framed (#3617 both directions).Behavior change
None to the wire. The server already sent
fallback; only the client's read of that field is corrected, so the existing (previously dead) ownership gate now functions as designed. The model-request layer is untouched (session keys are the client-provided conversation id, no fallback selection).Verification
tests/dsh-settings-ui.test.ts: 28/28 pass.tsc --noEmit --project tsconfig.jsonclean.Closes #6968