Repository navigation
fix: dsh settings panel follows the live proxy origin instead of freezing on the boot snapshot (#2288) - #2289
Conversation
…zing on the boot snapshot (#2288)
📦 Built Package ArtifactBranch: Option A — Install this exact build (recommended)npm install -g billion-context@0.0.2416-pr.2289.aa128d0This exact version is immutable and reproducible. The rolling Option B — Download artifact
tar xzf billion-context-pr2289.tgz
npm install -g packageInstall instructions are refreshed on each push. |
[bot] 🏷 PR #2289 核验结论(七问) 已拉取分支(
测试有效性:两个新回归块都有牙——块一在旧防护下必挂(label 停在 8787),块二若解析后停止轮询会显式 throw,且用手动时钟把每次后续探测的 delay 钉死在 10000ms。非恒真断言,能兜底。 diff 整洁度:单一目的,每一行都与本 PR 相关,无空行/锁文件/生成物噪音; CI 状态:head commit 判定:代码与测试就绪,等剩余 4 个 CI 矩阵 job 转绿后即可人工合并。 |
…ei#2289 to ranxianglei#2281 The launcher -c insertion fix and its tests cited ranxianglei#2289, which does not exist; the bug is tracked under ranxianglei#2281 (the issue this PR closes). Comment- and-test-name-only change, no behavior delta.
📦 Merged Build PublishedThis merge to master was published as npm install -g billion-context@0.0.100-master.db7344e # this exact build
npm install -g billion-context@master # always the newest merged build
|
Closes #2288
What & why
The dsh settings panel's "Open Web UI" button froze on whatever origin the page captured at boot (
globalThis.__BILI__snapshot): once any value was present, theuseEffectguard skipped/bili/originprobing for the rest of the session. The snapshot goes stale by design on the server side — attach-mode presets publish theBILLION_CONTEXT_PROXYenv origin at startup (currentOrigin()=register.base ?? env), while the host re-bindsregister.baseat runtime (dead-attach fallback spawn #983/#1130, routed-origin convergence #1365). Result: the button kept pointing at the old/dead port (e.g. 8787 vs live 18798) for the whole session.Note: the issue's reference to
src/mcp.tsDEFAULT_PROXY_ORIGIN(8787) is unrelated to this path — that constant only serves the codex MCP lane. The staleness mechanism above is what reproduces the reported symptom.Fix
probeOriginnow follows the live route for the lifetime of the mount instead of stopping after the first resolution (fast 3s phase until first resolution, then the endless 10s slow phase — same cadence contract as Windows/dsh 宿主重启:代理就绪超出 SPAWN_WAIT_MS(20s) 导致 bootstrap 失败,本进程内无重试 → /bili/origin 恒为 null、设置面板永久"未绑定"、整场会话直连(压缩失效) #2187).if (origin !== undefined) returnguard and runs once per mount withsetOriginas the updater (React bails on identical values → no re-render churn).useEffectnow follows real React semantics (deps comparison, prior cleanup before re-run). The old run-on-every-render stub had masked the removed guard by silently starting duplicate probes on each re-render.Behavior change (old → new)
Config surface
None — no config/env/CLI changes.
Tests
tests/dsh-settings-ui.test.ts: stale__BILI__snapshot (8787) corrected in place by the live route (18798), and a mid-session re-bind (18798 → 18800) followed at the slow cadence.tests/dsh-settings-ui.test.ts8/8;tests/dsh-native.test.ts+tests/issue2187-dsh-spawn-retry.test.ts45/45; build green. Full suite left to CI.