Skip to content

[PR] dsh panel: show the raw probe/status error (copyable) instead of spinning on connecting | dsh面板连不上时显示原始报错并可复制 - #4461

Closed
ranxianglei wants to merge 1 commit into
masterfrom
2026-10-24_dsh-probe-error-display
Closed

ranxianglei wants to merge 1 commit into
masterfrom
2026-10-24_dsh-probe-error-display

Conversation

@ranxianglei

Copy link
Copy Markdown
Owner

What & why

Closes #3693

When the bili proxy was unreachable, the dsh settings panel and the Context tab swallowed every failure: they spun on 「正在连接 bili 代理…」/ the generic degraded hint forever, showing zero evidence of what actually failed. For remote-access users (page served from a LAN IP while the panel binds to server loopback — the reporter's exact posture) there was no way to see or copy the underlying network error for a support report.

Now every failure state renders the raw engine message plus the failed URL in a selectable block with an explicit copy button:

Behavior changes (old → new)

  1. Connecting/degraded faces (settings panel + Context tab): previously hint text only ⇒ now hint + raw error line + copy button, only when a probe/read actually failed (healthy pending states are unchanged).
  2. Remote-blocked face (feat(dsh): suggest enabling adminRelay by default in DSH plugin mode or prompting on remote access | feat(dsh): 建议在 DSH 插件模式下默认开启 adminRelay 或在远程访问时给出提示 #3816): 1 button (config-page jump) ⇒ 2 buttons (jump + error copy); guidance text unchanged.
  3. Context-tab status poll: non-ok HTTP response previously passed to res.json() blindly ⇒ now treated as a failure carrying its status code. Edge-only delta: an error body shaped like our contract JSON can no longer be mistaken for data.
  4. New i18n keys probe_error / copy / copied added to both zh+en dicts (parity pinned by the existing dict test).

No config surface change, no wire change, no kernel/pi-subagents touch, no version bump.

Tests

…eadout

Closes #3693

A failing embed-route probe or Context-tab status poll was swallowed
silently: the settings panel and the Context tab spun on the connecting
hint forever with zero evidence of what actually failed. Remote-access
users (page served from a LAN IP while the panel binds to server
loopback) could neither see nor copy the underlying network error.

Every failure state now renders the raw engine message plus the failed
URL in a selectable block with an explicit copy action
(navigator.clipboard.writeText with an execCommand fallback, since
LAN-http pages are not secure contexts). Probe errors are transient by
design: never cached, retried on every poll tick until a verdict lands.
@ranxianglei ranxianglei changed the title dsh panel: show the raw probe/status error (copyable) instead of spinning on connecting | dsh面板连不上时显示原始报错并可复制 [PR] dsh panel: show the raw probe/status error (copyable) instead of spinning on connecting | dsh面板连不上时显示原始报错并可复制 Oct 24, 2026
@github-actions

Copy link
Copy Markdown
Contributor

📦 Built Package Artifact

Branch: 2026-10-24_dsh-probe-error-display (a8acce2)

Latest build — install this exact version

npm install -g billion-context@0.0.5356-pr.4461.07c38c0

This exact version is immutable and reproducible. The rolling pr tag tracks the newest test build across all PRs.

Recent builds (commit → version)

commit version build
a8acce2 billion-context@0.0.5356-pr.4461.07c38c0 build

Download artifact

  1. Download the artifact from the Actions run
  2. Extract the tarball and install:
tar xzf billion-context-pr4461.tgz
npm install -g package

Install instructions are refreshed on each push.

@ranxianglei

Copy link
Copy Markdown
Owner Author

🤖 Powered by ework · qwen3.8-27b

(ai: vllm-qwen/qwen3.8-27b)

已拉取分支核对代码并确认 CI。这是本 daemon 之前提交的 PR(提交作者 ework-agent),我不重做,只做核验与结论。

查重:不重复——本 PR 是 #3693 的收尾,与 #3816(远程 blocked 面)同域但机制不同:#3816 修「远程页面对 loopback 地址结构性不可达」的引导文案,#3693 修「所有失败面吞掉底层报错、无证据可复制」。两者叠加后远程面既有跳转按钮又有报错复制。

结构化八问

  1. 是什么问题:bili 代理连不上时,dsh 设置面板和 Context 标签一直转「正在连接…」/显示笼统的降级提示,完全看不到也复制不到底层网络错误。远程访问用户(LAN IP 开页面、面板绑服务器 loopback)无法把真实报错拿去报障。
  2. 什么原因导致的:三处吞错——probeEmbedRoute 的 .catch 静默丢弃错误;Context 标签状态轮询的 .catch 什么都没接、且非 ok 的 HTTP 响应被直接盲解析成 JSON;即便有错误,UI 也只渲染提示文字、没有任何展示错误的界面。
  3. 影响范围与严重程度:只影响 dsh 设置面板 + Context 标签在浏览器里的失败态(connecting / degraded / remote-blocked 三种面)。不涉及压缩核心、wire、其他客户端车道。严重度属诊断/体验缺口——面板仍优雅降级(不崩、不丢数据),只是缺可见性和可复制证据。p3 级,非可用性缺陷。
  4. 怎么修复的:每个失败面都把「原始引擎报错 + 失败的 URL」渲染进一个可选中块,配显式复制按钮。probeEmbedRoute 的 .catch 现在回 {verdict: undefined, error}(设计上瞬时、绝不缓存、每轮轮询重试直到拿到判决);状态轮询把非 ok 响应当成 HTTP <status> 失败并捕获原始错误;复制走 navigator.clipboard.writeText,缺失时回退 execCommand(LAN-http 页面不是安全上下文、没有 navigator.clipboard,正是远程用户的处境)。
  5. 是否有回归问题:逐面核过既有行为——健康 pending 态不变(errorBox(undefined) 返回 null,无失败就不加按钮/内容)。已披露的行为变更:feat(dsh): suggest enabling adminRelay by default in DSH plugin mode or prompting on remote access | feat(dsh): 建议在 DSH 插件模式下默认开启 adminRelay 或在远程访问时给出提示 #3816 远程面从 1 个按钮变 2 个(跳转 → 跳转+复制);非 ok 状态响应从盲解析改为按失败处理(仅边缘差异)。负向钉(给deepseek定制一个跳转到状态的链接 #1590/feat(dsh): 设置栏入口迁到插件详情页配置区(plugins.bundle.config) #2125 ok 面按钮数、dsh admin UI returns no such management endpoint after profile auto-update #3100 stale 面、[Bug] Inconsistent host-side context statistics after compression in dsh plugin mode (ref: dsh-context#173) | [Bug] dsh 插件模式压缩后宿主侧上下文统计不一致(引用 dsh-context#173) #3862 零按钮纯降级面)由既有套件守住。没有 fail-fast 变吞错——恰恰相反,是原本被吞的错误现在浮出来;无阈值/时序/输出格式漂移(除上述 UI 增量)。
  6. 是否破坏缓存:不涉及。纯浏览器端渲染状态,不动服务端缓存、重试游标、去重键、前缀缓存。embed 判决缓存(embedVerdicts)语义不变:失败故意不缓存(瞬时),成功照旧缓存。
  7. 是否改了设计方向:无转向。在既有 dsh 客户端模块内做增量诊断;新增小工具函数(describeProbeError / copyText / renderProbeError / hintColumn)都是文件内局部。
  8. 是否引入新配置:无新 env/config/CLI flag。仅新增 i18n key(probe_error / copy / copied,zh+en 双字典,parity 由既有字典测试钉住)。

CI / 基线:基线干净(merge-base == 当前 master tip,0 落后、无需 rebase),无冲突(mergeable=true;当前 blocked 只因测试分片还在跑)。静态门全绿(kernel-guard / version-guard / config-surface-guard / lane-guard / docs-sync / lock-sync / unused-exports 等,25 success),12 个 test 分片 + windows static-gates 仍在 in_progress,暂无失败。

代码审查结论:两文件(+355/-17,src/agent/dsh-native-client.ts + tests/dsh-settings-ui.test.ts),diff 干净无无关改动。测试有牙:断言逐字报错含 URL、点击确实写入剪贴板、标签翻转为「已复制」、按钮计数负向钉;主路径(navigator.clipboard)与回退路径(execCommand)各一测,Context 标签状态轮询失败单独一测。未发现缺陷。一处我评估后判定无害的观察:legacy 剪贴板里 ta.style = {...} 对象赋值在真浏览器不会应用 CSS,但 append→select→execCommand→remove 在同一同步块内完成(中间无 paint),所以不会闪一下、复制本身不受影响——不构成阻断。

判定:等那 12 个 in_progress 的 test 分片转绿即可合入(静态门已全绿、无冲突、无 rebase 需要)。合并权在你(human-only)。我这边无需改码;测试分片跑完我再补一条确认。

@ranxianglei

Copy link
Copy Markdown
Owner Author

🤖 Powered by ework · qwen3.8-27b

(ai: vllm-qwen/qwen3.8-27b)

补确认:测试分片已全部跑完——本 head(a8acce2)上 37 success / 14 skipped / 0 失败 / 无 in_progress,含全部 test 分片(ubuntu+windows × node 22/24)与静态门。基线干净、无冲突、无 rebase 需要。

结论不变:代码审查未发现缺陷,diff 干净,行为变更均已披露。可合入(合并权在你,human-only)。

@ranxianglei

Copy link
Copy Markdown
Owner Author

(ai: zhipuai-lb/glm-5.3)

已并入合并列车 #4551(master 合并,merge commit 保留原作者署名)。本 PR 关单收尾;回滚点为 #4551 单提交 revert。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

dsh remote access needs to display error messages. | dsh远程访问需要提示报错内容

1 participant