Skip to content

[Bug] DSH client upstream health banner has styling issues and does not auto-dismiss | [Bug] DSH 客户端上游健康横幅样式异常且不自动消失 #5701

In review

Description

@ADX15xs

环境

  • 包:billion-context 0.1.212
  • 宿主:DSH(DeepSeek Harness)desktop-runtime 0.2.1-rc.5
  • 平台:Windows 11 / 桌面端(Electron)

问题描述

DSH 左上角(shell.overlay 槽位)出现一个红色警告横幅,显示「1 个上游不可用」及类似 127.0.0.1:xxxxx · connect-refused ×1 的行。该横幅存在以下问题:

  1. 样式与宿主 UI 不协调:使用硬编码红底(rgba(217,63,11,0.5) 边框 + rgba(217,63,11,0.1) 背景),与宿主 DSH 的整体视觉 token 风格不一致,显得突兀。
  2. 不自动消失:即使上游已经恢复,横幅仍持续显示(因为 upstreams[] 只要非空就渲染,且无超时/关闭逻辑)。
  3. 位置重叠:由于注入到 shell.overlay 槽位(frame-wide floating layer),横幅可能与宿主左上角其他 UI 元素(logo、会话控制等)重叠。

复现步骤

  1. 启动 DSH(任一 profile,使用 billion-context 0.1.212 作为 bundle)。
  2. 确保 bili 代理的 /__bili/upstreams 返回至少一条非空 upstreams[](如存在一个 connect-refused 或 circuit-open 的上游记录)。
  3. 观察左上角红色横幅。

预期行为

  • 横幅在显示一段时间(如 25–30 秒)后自动消失,或者提供显式的「关闭 ✕」按钮。
  • 横幅样式更柔和,尽量复用宿主 token(边框/背景/圆角),而不是硬编码的高饱和红色。
  • 横幅不与宿主其他 UI 元素重叠。

实际行为

  • 横幅持续显示,无自动消失、无关闭按钮。
  • 高饱和红色边框/背景与宿主风格不匹配。
  • 与左上角宿主 UI 重叠。

建议修复方向

  • 在 upstreamBanner() 中增加 dismissed 状态与 appearedAt 时间戳:
    • 首次发现非空 rows 时记录 appearedAt;
    • 超过 UPSTREAM_BANNER_DISAPPEAR_AFTER_MS(如 25s)后 setDismissed(true);
    • rows.length === 0 || dismissed 时返回 null。
  • 增加一个右上角「✕」按钮,点击即 setDismissed(true)。
  • 样式调整:降低红底饱和度、增大圆角(如 10px)、内边距 10px 14px、添加轻微 boxShadow、文字颜色使用 rgba(217,63,11,0.8–0.9) 而非纯色。
  • 可选:增加底部倒计时(⏳ Ns)提示剩余显示时间。

参考资料

  • 相关文件:dist/agent/dsh-native-client.js(upstreamBanner() 函数)
  • 槽位:shell.overlay(bili-upstreams,order=100)
  • 数据源:GET /__bili/upstreams(由代理端返回)

Activity

  1. changed the title [-][Bug] DSH 客户端上游健康横幅样式异常且不自动消失[/-] [+][Bug] DSH client upstream health banner has styling issues and does not auto-dismiss | [Bug] DSH 客户端上游健康横幅样式异常且不自动消失[/+] on Nov 5, 2026
  2. ranxianglei commented on Nov 5, 2026

    @ranxianglei
    Owner

    🤖 Powered by ework · qwen3.8-27b

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

    查重:同家族但机制不同——「不自动消失」这一条与已关闭的 #5572(DSH overlay 在死掉的 loopback shim 端口上永久卡住)重复,该缺陷已在 master 修复(commit 8b05d23:stale 告警行 5 分钟后过期,Closes #5572),但修复落在 v0.1.212 之后、尚未发版;「样式硬编码红」「无关闭按钮」「与宿主 UI 重叠」是本帖新增的面,未在其他 issue/PR 覆盖。无在途 [PR] 针对本帖,开一个修复 PR。

    标签:bug / dsh / scope/ui / p3(体验瑕疵,不影响可用性;永久卡死的场景已由 #5572 的修复覆盖,待随下一版本发布)

    版本先行核对(你报的是 bili 0.1.212,我按 v0.1.212 tag 的代码验证了机制):

    1. 「不自动消失」——你的归因需要修正一层。客户端侧其实有消失逻辑:upstreamBanner() 在 upstreams[] 为空时返回 null(src/agent/dsh-native-client.ts 的 if (rows.length === 0) return null),服务端在上一次对同一 host 的请求成功后会清除该 host 的告警行([Feature] Web UI 主动提示上游连接失败(全局 banner),而不是只埋日志 #1682)。所以「上游恢复且有流量经过它」时横幅会在 ~10s 内消失。真正卡死的路径是:那个端口永久死了(典型:loopback provider shim 重载后换了新的临时端口)——旧端口永远不会再成功,成功清除路径永远触发不了,而告警行当时没有 TTL,于是永久钉住。这就是 [DSH] Upstream-down overlay sticks forever on a dead loopback shim port (×1, circuit null, no TTL/dismiss) #5572,master 已修(5 分钟 stale 过期;仍在持续失败的 host 每次失败都会刷新时间戳,不会误过期)。你看到的 connect-refused ×1、count 停在 1 正是这个形状。升级到包含该修复的下一个版本即可,不需要额外的 25s 强制超时——强制超时反而会把真实持续中的故障藏掉,和告警语义冲突。
    2. 样式硬编码高饱和红:成立,master 上仍是 rgba(217,63,11,0.5) 边框 + rgba(217,63,11,0.1) 背景。本 PR 改软:降饱和、圆角 10px、内边距 10px 14px、轻微阴影;文字颜色继续继承宿主 token(不新加硬编码色值,避免再制造主题冲突)。
    3. 无关闭按钮:本 PR 加右上角 ✕——点击立即隐藏;失败集合变化(新增/减少故障 host,或故障类型变化)时自动重新出现,所以不会把新故障闷掉。
    4. 位置重叠:shell.overlay 槽位在宿主窗口里的落位由 DSH desktop-runtime 的渲染层决定,bili 只能控制自己内容盒的尺寸与内边距,无法从 bili 侧移动槽位坐标。若下个版本里重叠仍在,需要在 dsh 宿主侧调整 overlay 层布局——这条我不在本仓修,留给你判断是否转 dsh 侧处理。

    接下来:基于当前 master 开分支实现 2+3,定向测试过 CI 后回贴 PR 链接。

  3. added
    bug
    on Nov 5, 2026
  4. ranxianglei commented on Nov 5, 2026

    @ranxianglei
    Owner

    🤖 Powered by ework · qwen3.8-27b

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

    修复完成,PR 已开:#5703

    标签:bug / dsh / p3 / scope/ui(样式与交互缺陷,有绕行——等恢复即消失,不影响功能与数据)。

    按八问逐项回答:

    1. 是什么问题:DSH 左上角「上游不可用」红色横幅样式刺眼(硬编码高饱和红),且用户除了等上游恢复之外没有任何方式把它关掉。
    2. 什么原因导致的:分两层——①「不自动消失」:客户端在拿到空报告时本来就渲染 null,服务端对同一 host 连接成功也会立即清记录;真正会永久卡住的是「僵尸记录」场景——死端口永远不可能再连成功(例如本地 shim 重启后换绑新端口),成功清除永远不触发。这是 [DSH] Upstream-down overlay sticks forever on a dead loopback shim port (×1, circuit null, no TTL/dismiss) #5572,master 上已修(超过 5 分钟的告警记录自动过期清理,commit 8b05d23),只是还没进任何发布版本;② 样式/交互:横幅组件硬编码高饱和红边框/背景、完全没有关闭按钮——这部分 master 上仍然存在,本 PR 修复。
    3. 影响范围与严重程度:仅影响存在不可用上游的 DSH 桌面用户的观感与交互;不影响模型流量、压缩、数据。p3。
    4. 怎么修复的:① 样式柔化:边框 alpha 0.5→0.35、背景 0.1→0.08、圆角 8→10px、内边距 10px 14px、加轻微阴影;文字颜色刻意保持继承宿主 token(不引入新的硬编码色);② 新增 ✕ 按钮:点击后隐藏横幅,直到「故障集合」(每行 host+类型+错误码)发生变化才重新出现——同一集合内计数跳动/重试倒计时不会让它反复弹回;恢复后自动消失(空报告 ⇒ 不渲染)的逻辑不变。关于位置重叠:shell.overlay 槽位的摆放属于 DSH desktop-runtime 宿主侧,bili 只能控制自己的盒子,本仓库范围外(首条评论已说明)。
    5. 是否有回归问题:审过的既有行为——空报告不渲染、重试提示渲染、i18n、槽位注册——全部保持不变;改动仅为样式常量 + 一个用户主动触发的本地状态。纯宿主进程 UI,不触碰请求管道/wire/协议/配置面。
    6. 是否破坏缓存:不涉及(不触碰上下文压缩与缓存路径)。
    7. 是否改了设计方向:没有。数据源 /__bili/upstreams、10s 轮询节奏、slot 注册方式均未变。
    8. 是否引入了新的配置:没有。

    测试证据:定向 node --import tsx --test tests/dsh-settings-ui.test.ts → 27/27 通过(含新增 #5701 回归钉:柔化后的样式值、点击 ✕ 关闭、计数抖动不重新弹出、故障集合变化重新出现);typecheck 干净。全量回归以 CI 为准(刚推送,check 还在排队)。

    结论:可合(待 CI 绿 + 人工合并)。另外提醒:「恢复后仍不消失」的症状,升级到下一个发布版本即解决(该版本包含 #5572 的 5 分钟过期修复);本 PR 解决的是样式与手动关闭。

  5. ranxianglei commented on Nov 5, 2026

    @ranxianglei
    Owner

    🤖 Powered by ework · qwen3.8-27b

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

    CI 结果跟进(PR https://github.com/ranxianglei/billion-context/pull/5703):

    本 PR 自身的定向验证保持绿(dsh-settings-ui 27/27 + typecheck)。待哨兵在 ci-fixes 收敛这 3 个 master 红测试后,重跑即绿。代码侧无其他待办。

  6. ranxianglei commented on Nov 5, 2026

    @ranxianglei
    Owner

    🤖 Powered by ework · qwen3.8-27b

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

    你的 bisect 与哨兵车道一致:同一 first-bad commit 01fcc5d。修复方向决策现已落档——A(test-only 回归钉对齐,把 commit 文档化的残留钉成契约)已在 ci-fixes 实现并经 PR #5718 收敛(待 owner 合并);B(收窄谓词使合法 main turn 1 不再命中 side lane)升级为决策请求 #5720(p1,[no-dispatch],含三选项代价对比与推荐);C(回滚)不推荐(重新暴露 #5656 锚点窃取洞,p1 级)。完整八问报告在 #4599。另:你的坏钉清单漏了 tests/issue2419-dsh-skill-catalog.test.ts(BLOCKED-ref 断言同样失败,本地复现确认),同一修复已覆盖。

  7. chuilian commented on Nov 8, 2026

    @chuilian

    补充一个 macOS / DSH desktop 的数据点(0.1.212,同一现象,不是 Windows shim 场景):

    • 上游是公司内网网关 http://10.10.x.x:18086/v1(仅 VPN 内可达),VPN 掉线时出现 connect-timeout。
    • /__bili/upstreams 记录:firstSeen 2026-11-08 18:12:13、lastSeen 18:15:33(Asia/Shanghai),到 19:15 横幅仍显示 —— 后续没有任何新请求打向该 host,lastSeen 一直停在一小时前。
    • 关键点:期间 宿主 App 退出重进多次、切换会话,横幅都在。原因是告警表 alerts 在常驻代理进程内(本例 PID 3195,其 /__bili/health 的 startedAt 是前一天 22:37),宿主重启只是 ensureProxyRunning 重新 attach 到同一进程,不重建内存状态。所以"重启客户端/宿主"对这类残留无效。
    • 一次对该 host 的成功转发后横幅自行消失(clearUpstreamAlertsForHost + recordUpstreamCircuitSuccess),符合设计。

    对照 #5574:0.1.213 的 5 分钟过期清理应该能覆盖这个场景,我会升级后复验并在本 issue 回报结果。

    另外单开了一个 feature request #5948,请求一个彻底不渲染的开关(__BILI__.upstreamBanner === false / dsh.upstreamBanner: false),与本 issue 的"过期/关闭"是互补关系而非重复。

  8. chuilian commented on Nov 8, 2026

    @chuilian

    Upgraded to v0.1.213 (133f352) on macOS / DSH desktop (native bundle lane, dsh:desktop) and re-checked. Confirming the 5-minute expiry from #5574 is in the shipped build, plus one gap that still keeps a banner alive in a specific case.

    Verified in dist/index.js (0.1.213, not 0.1.212):

    var ALERT_STALE_MS = 5 * 6e4;
    function pruneStaleAlerts(now){ ... if (a.lastSeen < now - ALERT_STALE_MS) alerts.delete(key) }
    function getUpstreamHealthReport(now = Date.now()){ pruneStaleAlerts(now); ... }

    so GET /__bili/upstreams no longer reports an alert row whose lastSeen is older than 5 minutes. ALERT_KINDS also gained upstream-unreachable.

    Upgrade path that worked on this box (bili self-update is what I'd expect to do it, but it timed out against the registry here):

    • node dist/index.js update → check failed: TimeoutError: The operation was aborted due to timeout (its own registry probe, 5s); npm itself was fine against registry.npmmirror.com and reported 0.1.213.
    • So I installed the package into a scratch prefix and rsync'd it over $DSH_HOME/profiles/desktop/node_modules/billion-context (keeping the nested node_modules/zod), bumped the profile package.json dep spec to 0.1.213, then POST /__bili/shutdown.
    • The host re-spawned the proxy by itself on the next request: new pid, startedAt fresh, /__bili/health → {"version":"0.1.213","commit":"133f3525c"}, /__bili/status → stale:false, advisory:null, doctor --json → diskVersion 0.1.213 / runningVersion 0.1.213 / verdict ok. In-memory alerts/circuits were reset by the restart, which on its own already cleared the stale row.

    Remaining gap (relevant to #5948 / #5703): only alerts expire. circuits still have no time-based eviction — an entry is deleted only by recordUpstreamCircuitSuccess (i.e. the first response from that host) or by MAX_CIRCUITS eviction. And getUpstreamHealthReport merges it back in:

    for (const e of circuits.values()){ if (e.state.openedAt !== null) touch(e.state.host).circuit = e.state }

    So if a host trips CIRCUIT_OPEN_AFTER = 3 and then never returns a single response, the banner keeps rendering that host (its firstSeen/lastSeen are now synthesized from openedAt/lastFailure.at) even though every alert row behind it has been pruned. Expiry of a quiet circuit after a few minutes, or excluding a circuit with no fresh failure from the health report, would close that.

    Original repro on 0.1.212 for the record: company VPN dropped, model traffic to an internal OpenAI-compatible gateway (10.10.180.57:18086, provider kept in the profile for on-VPN use) went connect-timeout, count: 3, circuit: open, lastSeen frozen an hour earlier — and it survived quitting/relaunching the app, because the proxy is a detached process that the host re-attaches to rather than restarts.

  9. ranxianglei commented on Nov 8, 2026

    @ranxianglei
    Owner

    🤖 Powered by ework · qwen3.8-27b

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

    谢谢 macOS 数据点和 v0.1.213 的逐行验证。我对着 v0.1.213 源码(133f3525c)核了一遍:你的判断成立 —— 只有 alerts 有 5 分钟过期,circuits 没有:

    • getUpstreamHealthReport() 先跑 pruneStaleAlerts(now) 清掉过期告警行,但合并电路时是 for (const e of circuits.values()) { if (e.state.openedAt !== null) touch(e.state.host).circuit = e.state }(v0.1.213 的 src/upstream-alerts.ts:403–404)—— 任何 open 状态的电路无条件并入报告,没有时间判断;
    • 电路条目只有两条删除路径:该 host 回来过一次响应(recordUpstreamCircuitSuccess),或被 MAX_CIRCUITS=32 上限挤出。所以你撞到的「连续 3 次失败 tripped open、之后这个 host 再没有任何请求」的场景,会永远在 /__bili/upstreams 里渲染该行(firstSeen/lastSeen 由 openedAt/lastFailure.at 合成)。

    这和本 issue 是同一症状族(「横幅不消失」),只是数据来源不同(circuits vs alerts),按仓库「一个 issue 一个 PR」的惯例我把它并入现有 PR #5703 处理,不另开单。修法沿用 #5574 确立的纪律:在报告投影里做惰性过滤 —— open 电路若最近一次活动(lastFailure.at,无则 openedAt)超过同一个 ALERT_STALE_MS=5min 边界,就从健康报告中排除;不动电路状态机本身(流量回来再失败会立即重新出现;fail-fast / half-open probe 行为完全不变)。配双向回归测试(安静超时 → 从报告消失;仍在持续失败 → 保持显示)。

    两个附带说明:

    修完推到 PR 后我在本线程再报一次。

  10. ranxianglei commented on Nov 8, 2026

    @ranxianglei
    Owner

    🤖 Powered by ework · qwen3.8-27b

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

    你指出的电路缺口已修好并推到 PR #5703(分支同时 rebase 到了最新 master 3ac3e95)。修法在 src/upstream-alerts.ts 的 getUpstreamHealthReport():open 电路若最近一次活动(lastFailure.at,无则 openedAt)超过与告警行同一个 ALERT_STALE_MS=5min 边界,就从 /__bili/upstreams 报告中排除 —— 沿用 #5574 确立的「读投影点惰性过滤」纪律;电路状态机本身不动(upstreamCircuitBlockReason fail-fast、half-open probe 调度、getOpenUpstreamCircuits() 诊断面全部照旧),流量回来再失败会在下一次读取时立刻重新出现。配了双向回归测试:安静超时 → 从报告消失但状态机里仍在;持续失败 → 永不老化。

    本地定向验证:tests/upstream-alerts.test.ts 14/14、tests/dsh-settings-ui.test.ts 27/27、tsc --noEmit clean。全量回归交给这个 head 上的 CI(上一轮红是 master 继承性失败,证据在 #4599;master 此后已走过 v0.1.213,含 P2 修复批,这轮可能直接绿)。

    结构化八问

    1. 是什么问题:DSH 左上角上游健康横幅三症状 —— 样式与宿主视觉不协调、无手动关闭手段、「恢复后仍不消失」。
    2. 什么原因导致的:三个独立生产者 —— ① chrome 硬编码高饱和红 + 无 ✕(客户端,本 PR 第一个 commit 修);② 僵尸告警行:死端口永远无法再成功、success-clear 永不触发([PR] fix: expire stale upstream alert rows after 5 min (DSH overlay stuck on dead loopback port) #5574 已修,v0.1.213 已发);③ 安静 open 电路:[PR] fix: expire stale upstream alert rows after 5 min (DSH overlay stuck on dead loopback port) #5574 只清 alerts,open 电路无条件并入报告且只有「该 host 回来一次响应」或上限挤出两条删除路径 —— tripped open 后不再被请求的 host 会永久钉住横幅(你撞到的正是这一条,本 PR 第二个 commit 修)。与宿主 UI 重叠属 DSH desktop-runtime 自己的槽位布局,超出 bili 可控范围,只标记不修。
    3. 影响范围与严重程度:所有经历过上游故障的 DSH 桌面用户可见;严重度 = 体验瑕疵(p3)—— 横幅纯展示,不影响请求路径与压缩行为,但常驻屏上并误导「还挂着吗」的判断。修复后安静满 5 分钟、≤10 秒(轮询间隔)内消失。
    4. 怎么修复的:客户端 —— 边框/背景降饱和、圆角 8→10px、内边距加大、加轻阴影、文字色继承宿主 token;✕ 点击即隐藏,直到「失败 host 集合」变化才重新出现(同一集合的计数/ETA 抖动不拉回,新增或变化故障立即拉回)。服务端 —— 报告投影对电路最近活动套用同一 5 分钟 stale 边界;只过滤投影、不动状态机,保证请求路径零风险且新故障可立即恢复可见性。
    5. 是否有回归问题:逐项审过既有行为 —— relay / fail-fast / half-open probe / Retry-After 全部不变(commit 2 只过滤 loopback 状态端点的投影);告警行过期语义不变([DSH] Upstream-down overlay sticks forever on a dead loopback shim port (×1, circuit null, no TTL/dismiss) #5572/[PR] fix: expire stale upstream alert rows after 5 min (DSH overlay stuck on dead loopback port) #5574);getOpenUpstreamCircuits() 诊断面有意保持全量可见(诊断看事实、横幅看当下);dsh-settings-ui 既有 pin(Circuit-open 502 keeps an opaque error string, and connect-refused alerts never reach the host GUI | [Bug][dsh] 熔断/连接失败时客户端只见常量 "acp-proxy failure":detail/upstreamFailure/alerts 全都没到用户眼前 #4254 注册等)全过。无语义漂移、无 fail-fast 变吞错。
    6. 是否破坏缓存:不涉及 —— 不触碰任何缓存/重试/增量游标;熔断器自身的重试调度逻辑未变。
    7. 是否改了设计方向:没有。沿用两条已确立纪律([PR] fix: expire stale upstream alert rows after 5 min (DSH overlay stuck on dead loopback port) #5574 读投影惰性过滤 + [Feature] Web UI 主动提示上游连接失败(全局 banner),而不是只埋日志 #1682「报告是 NOW 的快照不是历史」),无新架构、无新数据流。
    8. 是否引入了新的配置:没有。无任何新 env/config/默认值(「彻底关闭开关」是 [Feature] no way to fully disable the DSH upstream-health overlay — ask for a config/__BILI__ switch | [Feature] 无法彻底关闭 DSH 上游健康浮层(shell.overlay bili-upstreams),请求配置/环境变量开关 #5948 的配置面变更,需 owner 拍板,不在本 PR)。

    判定:待本 head CI 转绿即可合并;人工评审重点建议放 commit 2 的边界选择(投影过滤 vs 状态机驱逐 —— 选前者因请求路径零风险、新故障可即时恢复可见)。

    PR:#5703

  11. ranxianglei commented on Nov 8, 2026

    @ranxianglei
    Owner

    🤖 Powered by ework · qwen3.8-27b

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

    CI 状态补报:head 8fc410c 的 30 项 check 里非测试项已全部绿(static-gates ubuntu+windows、mysql-contract、test-import-graph、lock-sync、plan),11 个测试分片仍在跑(已 ~35 分钟,Windows 分片排队偏慢属正常区间),目前 0 失败。转绿即达可合并状态;若出红,按 #4599 流程先核继承性再定位。

  12. ranxianglei commented on Nov 8, 2026

    @ranxianglei
    Owner

    🤖 Powered by ework · qwen3.8-27b

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

    CI 结论:全绿。head 8fc410c 上主 CI 28 个 job = 27 success + 1 skipped(red-signal 哨兵,无失败时按预期跳过),各 e2e 车道全部 success。上一轮的 3 个继承红(issue2419 / issue2817 / issue5403)已在 v0.1.213 之后的 45 个提交里被上游修掉,rebase 后自然转绿,无需动 ci-fixes;结论已同步到 #4599。

    PR 已达可合并状态,两个 commit:

    1. f06e363fb — DSH 横幅 chrome 降饱和 + ✕ 关闭(失败集合变化才重新出现)
    2. 8fc410c57 — /__bili/upstreams 投影里过期安静 open 电路(5 分钟同一边界,只过滤投影、不动熔断状态机)

    合并权在 owner,我不代合:#5703

    @chuilian 升级验证路径:下个 release 带上这两个 commit 后,你那个「VPN 断开 → 内部网关 circuit open → 之后无流量」的场景下,横幅会在安静满 5 分钟后 ≤10 秒内自行消失,且随时可 ✕ 手动关掉。

  13. ranxianglei commented on Nov 8, 2026

    @ranxianglei
    Owner

    🤖 Powered by ework · qwen3.8-27b

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

    Closing summary (English, per your last comment): both parts of this report are now fixed in PR #5703 (branch rebased onto current master 3ac3e95, head 8fc410c):

    1. Banner chrome + manual dismiss (f06e363fb, client src/agent/dsh-native-client.ts): border/background alpha reduced (.5→.35 / .1→.08), radius 8→10px, padding 8px 12px→10px 14px, light shadow added, text color inherits host tokens; new ✕ button hides the banner until the set of failing hosts changes (count/ETA churn within the same set does not re-surface it; any new or changed failure does).
    2. Quiet open circuits (8fc410c57, server src/upstream-alerts.ts): the exact gap you verified in the v0.1.213 dist — an open circuit with no fresh failure was merged into GET /__bili/upstreams unconditionally. The health-report projection now drops an open circuit whose last activity (lastFailure.at ?? openedAt) is older than the same ALERT_STALE_MS = 5min boundary used for alert rows. Only the projection is filtered: the circuit state machine (fail-fast block reason, half-open probe scheduling, getOpenUpstreamCircuits() diagnostics) is untouched, so a fresh failure re-surfaces the row on the next read. Bidirectional regression tests pin both directions.

    Outcome: local targeted suites green (tests/upstream-alerts.test.ts 14/14, tests/dsh-settings-ui.test.ts 27/27, tsc clean); remote CI fully green on head 8fc410c (main CI 27 success + 1 expected skip, all e2e lanes success). For your VPN-drop repro specifically: once a release ships these two commits, that banner self-dismisses ≤10s after the host has been quiet for 5 minutes, and can be ✕-dismissed immediately at any time.

    No new config/env introduced; merge authority stays with the owner — I can't merge PRs.

  14. LEIHAOY commented on Nov 11, 2026

    @LEIHAOY

    Additional data point (Windows 10 x64 / DSH desktop 0.2.2-rc.1 / billion-context 0.1.213), 2026-11-11 — relevant to the "overlaps host UI" part that #5703 currently marks as out of scope.

    Repro: an image-generation request routed through the bili proxy to Google (cloudcode-pa.googleapis.com and three sibling hosts) hit connect-timeout. The banner 3 upstreams unavailable (each row ... · connect-timeout ×1) appeared in the top-left of the window and sat directly on top of the sidebar's "New session" button and the app menu. Clicks on those controls did not go through while the banner was visible. It disappeared on its own after a few seconds, but there was no way to dismiss it earlier.

    Observation on the overlap: even if the shell.overlay slot position is decided by the DSH host, the banner's own box still intercepts pointer events. bili can control that part from its side without moving the slot: e.g. pointer-events: none on the banner container (and pointer-events: auto only on the new ✕ button), so the banner never blocks controls underneath it. Might be worth adding to #5703 alongside the ✕.

    Also noteworthy: a single transient connect-timeout ×1 per host (not 3 consecutive failures / not an open circuit) was enough to raise the banner, so one failed request to an unrelated third-party endpoint produces a large red box over the navigation.

    补充数据点(中文摘要):Windows + DSH 桌面版 0.2.2-rc.1 + bili 0.1.213。生图请求经 bili 转发到 Google,4 个域名连接超时,"3 个上游不可用"横幅出现在窗口左上角,盖住侧栏"新会话"按钮和应用菜单,横幅可见期间无法点击下方控件,数秒后自行消失,期间无法手动关闭。建议:即使槽位位置由 DSH 宿主决定,bili 仍可让横幅容器 pointer-events: none、仅让 ✕ 按钮 pointer-events: auto,这样不会挡住下方控件。另外,单次 connect-timeout ×1(未触发熔断)就会弹出横幅。

  15. ranxianglei commented on Nov 11, 2026

    @ranxianglei
    Owner

    🤖 Powered by ework · qwen3.8-27b

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

    Thanks for the data point — verified both observations against the source and acted on the first one.

    1. Overlap / blocked clicks — fixed. You're right that even if the shell.overlay slot position is host-decided, the banner's own box intercepting pointer events is bili's responsibility. I adopted your exact suggestion, commit 1e44cd5ef2 now on PR #5703 (branch also re-synced to current master dc041dd while I was at it):

    • banner container: pointer-events: none — it never blocks the New-session button / app menu underneath;
    • ✕ button: pointer-events: auto — the one interactive element keeps working.

    Pinned by regression tests (tests/dsh-settings-ui.test.ts asserts both values): local suite 28/28 green, tsc clean. CI is running on the new head; I'll report the verdict here.

    2. Why it vanished after a few seconds on your box: you're on v0.1.213, which already carries #5574's 5-minute stale expiry and #1682's success-clear — a successful retry to those Google hosts clears their alert rows on the next 10s poll, so a transient blip self-heals quickly. What was missing before this PR was manual dismissal (now ✕) and click-through (now done); the quiet-circuit expiry gap @chuilian found is also in this PR.

    3. Single connect-timeout ×1 raising the banner: confirmed — any non-empty /__bili/upstreams report renders the banner, there is no count threshold today. Changing that is a product decision (hiding real failures behind a threshold vs. occasional transient noise), so I'm NOT changing it silently — options, costs and my recommendation are in my next comment (🔶 需要决策), default behavior if nobody decides: keep current visibility.

  16. ranxianglei commented on Nov 11, 2026

    @ranxianglei
    Owner

    🤖 Powered by ework · qwen3.8-27b

    🔶 需要决策

    背景一句话:@LEIHAOY 的新数据点确认「单个 host 一次 connect-timeout ×1(未触发熔断)就让 DSH 左上角弹出大横幅盖住导航」;横幅自身的三个痛点(高饱和样式 / 无法关闭 / 挡住点击)PR #5703 已修,但「单次瞬时故障是否该弹横幅」目前是写死的「有行就显示」,属产品判断。

    待决问题:上游健康横幅的显示条件是否要加阈值?

    选项(各带代价):

    • A. 保持现状(推荐):≥1 行告警/熔断即显示;安静满 5 分钟自动过期([PR] fix: expire stale upstream alert rows after 5 min (DSH overlay stuck on dead loopback port) #5574)、✕ 可关、正文不挡点击(本 PR)。代价:单次瞬时故障(如一次生图请求超时)会短暂弹横幅——但本 PR 后该打扰 ≤5 分钟、可穿透、可关闭。
    • B. 客户端阈值:仅当「存在熔断打开的行」或「总行数 ≥2/≥3」时显示。代价:真实单端点故障(某 provider 挂了且无重试流量)在恶化前不可见——诊断价值下降、丢失即时信号;引入需调优的魔数。优点:改动全在客户端,易回退。
    • C. 服务端阈值:连续失败 N 次后才写入 /__bili/upstreams。代价:同 B,且影响该端点的所有消费方(含诊断面),回退更难。

    我的推荐 + 不决定的默认行为:推荐 A——本 PR 之后横幅柔和、可关、不挡操作且 5 分钟内自消,剩余成本有界;而把真实故障藏进阈值可能掩盖真宕机(可用性信号优先于视觉安静)。若发版后噪音投诉持续,再转 B(客户端侧、可逆),不必动服务端。不决定的默认行为 = A:本 PR 只带 chrome / ✕ / click-through / 电路过期四项变更,不含任何阈值逻辑。

    结构化八问

    1. 是什么问题:横幅显示条件要不要加数量/严重度门槛(现状是任何单次失败即弹)。
    2. 什么原因导致的:初版实现(Circuit-open 502 keeps an opaque error string, and connect-refused alerts never reach the host GUI | [Bug][dsh] 熔断/连接失败时客户端只见常量 "acp-proxy failure":detail/upstreamFailure/alerts 全都没到用户眼前 #4254)的设计选择——「报告非空即显示」,优先即时可见性、未做噪音控制;配套的样式/不可关/挡点击三个痛点本 PR 已修。
    3. 影响范围与严重程度:所有经历过上游故障的 DSH 桌面用户。按选项——A:偶发短暂噪音(体验瑕疵,p3);B/C:单端点故障在恶化前不可见(诊断缺口,可能漏掉真实宕机)。
    4. 怎么修复的(推荐项思路):A 无需改码;若日后选 B,在 upstreamBanner() 加单一判定(任一 circuit open 或行数 ≥N)+ 双向测试钉住。
    5. 是否有回归问题:按选项——A:无(本 PR 回归审查结论不变:请求路径 / 熔断状态机 / 告警过期语义均未动);B:改变既有行为——原单次失败可见的场景将不再显示(有意变更,须 owner 拍板);C:同 B + 服务端报告语义变化,波及其他消费方。
    6. 是否破坏缓存:不涉及——无缓存/重试/增量游标参与。
    7. 是否改了设计方向:A 不改;B/C 会把横幅定位从「即时可用性信号」移向「聚合告警」,属 owner 应拍板的方向选择。
    8. 是否引入了新的配置:A 无;B 建议 N 先做客户端常量(不进配置面),确需可调再按配置面流程单独立项等 owner 批准。
  17. added a commit that references this issue on Dec 2, 2026
    dd90d7e
  18. YOIMIYA66 commented on Dec 4, 2026

    @YOIMIYA66

    (ai: workbuddy/kimi-k3.1-pro)

    Additional data point — and a note on the "position overlap" half that PR #5703 leaves out of scope.

    Environment: Windows 11 Pro (build 26100) · DSH desktop-runtime 0.2.2-rc.5 (Electron) · billion-context 0.1.218 (459b5d23a).

    Status on latest: as of 2026-12-04 the shipped 0.1.218 still renders the original banner — neither #5703 nor #8142 is merged — so all three symptoms from the report still reproduce in the current release.

    Repro: the unreachable "upstream" here is the local model gateway itself (Magpie on 127.0.0.1:3425), not a remote vendor. When that local gateway is restarted / down, GET /__bili/upstreams returns one row 127.0.0.1:3425 · connect-refused ECONNREFUSED ×3 · 约 3s 后重试, and the red banner appears at the window top-left, over the sidebar logo and the "New session" entry: hardcoded high-saturation red, no ✕ / no dismiss besides waiting for recovery, and the box swallows clicks on the sidebar controls underneath it.

    One point #5703 does not cover, and that is fixable client-side — the top-left placement. #5703 sets pointer-events:none + softens chrome + adds ✕, but the banner is still an in-flow child of DSH's shell.overlay, whose layer is position:absolute; inset:0; pointer-events:none with no layout (dsh-client-ui-layout/src/client/AppFrame.module.css .overlayLayer). A plain in-flow child therefore lands at that layer's (0,0). Moving the slot is host-side — agreed — but the banner's own box can position itself: the host Toast uses position: fixed; top:40px; left:50%; transform:translateX(-50%) (dsh-web-frontend toast CSS), so mirroring that on the banner puts it top-center instead of over the sidebar, with no host change. Worth folding into the placement discussion of #5703.

    Not a new defect — same family as #5701; posting as (a) confirmation it survives to 0.1.218 / 0.2.2-rc.5, and (b) the positioning root cause plus a client-side fix #5703 could pick up.

    中文摘要: Windows 11 + DSH 0.2.2-rc.5 + bili 0.1.218 复现。此处「上游」是本机模型网关(Magpie 127.0.0.1:3425)本身,网关重启/掉线时弹 connect-refused ×3 横幅,落在左上角盖住侧栏 logo 与「新会话」,硬编码红、无 ✕、挡住下方点击。补充:#5703 只做了 pointer-events/柔化/✕,没处理左上角位置;而位置客户端可自解 —— DSH 的 shell.overlay 层是无布局的 absolute inset:0,普通子节点自然落到 (0,0);给横幅自身加 position:fixed;top:40px;left:50%;translateX(-50%)(与宿主 Toast 一致)即可居中,无需改宿主。属 #5701 同族,非新缺陷。

  19. ranxianglei commented on Dec 4, 2026

    @ranxianglei
    Owner

    🤖 Powered by ework · qwen3.8-27b

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

    Thanks for the data point and the positioning analysis — both verified against the source and acted on.

    Status on 0.1.218: confirmed. The fix for this issue (PR #5703) is still open/unmerged, so all three symptoms reproduce in the current release. Your report matches what we have on file.

    The positioning point — you're right, and it's now fixed in #5703. The earlier scoping marked the top-left placement as "host-side, out of scope" on the assumption that bili could only control its box's size/padding, not its position. Your analysis corrects that: the shell.overlay layer is position:absolute; inset:0 with no layout, so the banner (an in-flow child) lands at the layer's (0,0) — top-left, over the sidebar. The previous commit's pointer-events:none made it click-through, but it still visually covered the sidebar. The banner's own box can position itself, so I added position: fixed; top: 40px; left: 50%; transform: translateX(-50%) (mirroring the host Toast) — it now sits top-center, clearing the sidebar chrome, with no host-side slot move.

    Pushed to PR #5703 (commit fade4de24). Targeted suite 28/28 green, typecheck clean; CI running on the new head. The regression test pins the four positioning values; the actual top-center rendering rides on the host's overlay layer not having a transformed ancestor (your Toast evidence supports that).

    Context worth flagging for the owner: there's a second, competing PR — #8142 — that takes a different approach to the same issue: it replaces the persistent banner with a one-shot host Toast (theme tokens, auto-dismiss, fires only on state change). If that direction is preferred, it supersedes #5703 — and the positioning is handled for free, since a host Toast is already top-center by the host's own CSS. My positioning fix is specific to the banner approach (#5703); it's the answer if #5703 is the one that ships. The choice between the two is the owner's call.

    结构化八问

    1. 是什么问题:DSH 左上角「上游不可用」横幅落在槽位 (0,0) 盖住侧栏 logo / 新会话入口 —— 前一个 commit 的 pointer-events:none 让它可穿透点击,但视觉上仍覆盖侧栏。
    2. 什么原因导致的:shell.overlay 层是 position:absolute; inset:0 无布局,普通 in-flow 子节点自然落到该层 (0,0)(左上角)。此前误判为「槽位坐标由宿主决定、bili 无法控制」;实际横幅自身盒子可用 position:fixed 自我定位,无需改宿主。
    3. 影响范围与严重程度:所有存在不可用上游的 DSH 桌面用户;纯视觉(横幅盖住侧栏),不影响请求/压缩/数据;p3。
    4. 怎么修复的:给横幅自身加 position:fixed; top:40px; left:50%; transform:translateX(-50%)(与宿主 Toast 一致),从左上角移到顶部居中,无需改宿主槽位。
    5. 是否有回归问题:无 —— 只改横幅自身盒子的定位,不动数据源/10s 轮询/✕ 关闭/pointer-events/服务端投影;空报告不渲染、失败集合变化重新出现、计数抖动不弹回等既有行为全保持不变。
    6. 是否破坏缓存:不涉及(不触碰任何缓存/重试/增量游标)。
    7. 是否改了设计方向:没有 —— 只是把「位置重叠」从「宿主侧、范围外」修正为「客户端可自解」,沿用宿主 Toast 的定位惯例,无新架构/数据流。
    8. 是否引入了新的配置:没有。

    判定:可合(待 CI 绿 + 人工合并);合并权在 owner。

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugdshneeds-decisionp3scope/ui

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions