Repository navigation
[PR] fix(dsh): upstream banner — soften chrome + ✕ dismiss until the failing set changes (#5701) - #5703
[PR] fix(dsh): upstream banner — soften chrome + ✕ dismiss until the failing set changes (#5701)#5703ranxianglei wants to merge 6 commits into
Conversation
📦 Built Package ArtifactBranch: Latest build — install this exact versionnpm install -g billion-context@0.0.9136-pr.5703.961b64eThis exact version is immutable and reproducible. The rolling Recent builds (commit → version)
Download artifact
tar xzf billion-context-pr5703.tgz
npm install -g packageInstall instructions are refreshed on each push. |
[bot] 🏷 (ai: vllm-qwen/qwen3.8-27b) 查重:不重复 —— 检索了 open/closed issue 与 PR(按主题 "dsh upstream banner / shell.overlay pill" 及失败签名):没有其他在途 PR 触碰这块 UI;本线程也没有并列的第二条修复 PR(one-fix-PR-per-thread 满足)。相关但已分别处理的前置项:#5572(僵尸行 5 分钟过期,已在 master 标签: 初审进行中,先报已核实的部分:
完整八问结论随后补上。 |
ranxianglei
left a comment
There was a problem hiding this comment.
(ai: vllm-qwen/qwen3.8-27b)
APPROVE —— 独立端到端审读通过,可合。(本结论为独立产出,未照抄前序楼层;代码路径、测试 harness、#5572 归属均重新核过一遍。注:本账号即 PR 作者,GitHub 禁止对本人 PR 提交正式 approval,故以评论形式给出结论;如需正式 approval 状态请由其他账号点 Approve。)
结构化八问:
- 是什么问题:DSH 桌面运行时的「上游不可用」横幅(shell.overlay 槽位)样式过硬、且用户没有确认/关闭手段——高饱和红边框背景与宿主 token 打架,持续故障期间只能一直挂着。
- 什么原因导致的:chrome 是硬编码
rgba(217,63,11,...),不读宿主 token;组件只在「报告为空」时返回 null,没有任何用户可触发的隐藏态。另一半「恢复后仍不消失」是僵尸行问题,已由 master 上的 #5572(ALERT_STALE_MS=5*60_000lazy prune)修掉——我验证了该 commit(8b05d237c)确在 PR base 的祖先里,本 PR 不涉及,切分正确。 - 影响范围与严重程度:仅 dsh desktop-runtime 宿主进程内 UI(Electron shell.overlay),不碰代理请求路径/线协议/存储/内核。触发条件 = DSH 宿主 + ≥1 不可达上游。严重度 = 体验瑕疵(p3),无数据丢失、无能力不可用。
- 怎么修复的:① 降饱和(border alpha 0.5→0.35、bg 0.1→0.08、radius 8→10、padding 8px12px→10px14px、加轻阴影);文字色刻意保持继承宿主 token——比 issue 建议的硬编码
rgba(217,63,11,0.8)更贴合「复用宿主 token」的本意。② 新增 ✕:用dismissedSig记住已确认的故障集合签名(每行 host+kind+code,NUL/SOH 字节分隔并排序 → 顺序无关的集合语义)。点 ✕ 后同集合保持隐藏,计数/重试 ETA 抖动不重显,任何新增/变化的故障行重显;恢复(空报告⇒null)逻辑不变。(src/agent/dsh-native-client.ts:1083-1102) - 是否有回归问题:逐项过既有行为——(a) React hook 顺序安全:3×useState + 2×useEffect 全在两个 early-return 之前调用,条件分支不会跳过任何 hook;(b) 既有 #4254 测试的注册行为(slots.inject/register)未动,只改渲染内部结构,header 被包进一层 flex div 并加 ✕,但 collectText 递归所有子节点,「N 个上游不可用」文本仍可命中,slotsOrder/optionsBySlot 断言不受影响;(c) rows.map 的 key=r.host 未变,无 key 回归;(d) 高危模式排查:无语义漂移、无 fail-fast→吞错、无阈值/时序/输出格式漂移(纯客户端 UI,不动 wire)。结论:无回归。
- 是否破坏缓存:不涉及(纯宿主进程 UI,不碰前缀缓存/重试/增量游标/去重键)。
- 是否改了设计方向:无架构转向,仅在既有 pill 上加了一个自洽的小行为扩展(用户可确认)。FYI(非缺陷、无需处理):
dismissedSig永不在恢复时清除,故「恢复后又以完全相同 host+kind+code 再失败」会被继续抑制,直到集合变化或组件重挂——这与文档化契约「until the failing set changes」自洽;典型僵尸场景端口每次都会变,所以照样会重显。若要改成「恢复即重置确认」属 needs-decision 范畴,本 PR 不改。 - 是否引入新配置:不涉及(无新 env/config/CLI flag;config-surface-guard 绿印证)。
测试有效性:新用例经 vm-realm 打包真实 agent/dsh-native-client 入口驱动真实组件(非 stub/mock),对降饱和值逐字段断言,对 ✕ 状态机做「点击隐藏 → churn 保持隐藏 → 集合变化重显 → unmount 取消轮询」全链路双向断言,有牙,能兜住 chrome 回退与 dismiss 逻辑回归。
CI(head 12663a2):镜像缓存 summary {total:30, failed:0, pending:0},kernel-guard / config-surface-guard / version-guard / lock-sync / gate×2 等全绿;早先 10 个 test 分片红已由 CI 车道判定为继承自 master 的三个已知红家族、与本 PR diff 零交集,当前状态已转绿。
判定:可合(APPROVE)。 低风险 dsh 客户端 UI 精修,行为漂移已按政策披露旧值→新值,测试有牙,未触碰 kernel/config/wire。
(ai: vllm-qwen/qwen3.8-27b) ✅ review-worker-r1 审毕:PR #5703 = APPROVE(可合)。 独立端到端八问通过:低风险 dsh 客户端 UI 精修,无回归、无 kernel/config/wire 触碰、测试有牙;CI 当前绿(镜像 |
(ai: vllm-qwen/qwen3.8-27b) 背景一句话:PR #5703(dsh 上游横幅视觉软化 + ✕ 关闭)代码本身审完没问题、可合;但它的 CI 全矩阵是红的——追查下来这是 master 上已存在的继承性回归:PR #5687(「generic dsh single-shot sidecar gate」,11-05 01:18 合入,commit 待决问题:#5687 回归怎么修(它决定后续所有 PR 的 CI 能否转绿):
结构化八问(PR #5703 本体审查结论)
验证证据
已做 / 未做
收工判定:PR #5703 代码审查通过、on merit 可合;现在合(接受继承红)还是等 #5687 回归修复落地后重跑再合,由你定。 |
… set changes (#5701) The shell.overlay upstream-unavailable pill shipped with hard-saturation chrome (rgba(217,63,11,0.5) border / 0.1 background, 8px radius) that clashed with host themes, and offered no way to acknowledge it short of waiting for recovery. - Soften the chrome: border alpha 0.5->0.35, background 0.1->0.08, radius 8->10px, padding 8px 12px->10px 14px, subtle shadow; text color stays inherited from the host tokens. - Add a ✕ control that hides the banner until the FAILING SET changes (host+kind+code per row). Count ticks / retry-ETA churn of the same set never re-show it; any new or changed failure re-surfaces it. Auto-dismiss on recovery (empty report => null) is unchanged — the zombie-row case is already bounded server-side by the 5-min staleness prune (#5572). Regression test: tests/dsh-settings-ui.test.ts "#5701" pins the softened values, the dismiss click, churn-stays-hidden, and changed-set re-surface.
…ction (#5701) #5574 made alert rows age out after 5 min, but getUpstreamHealthReport merged every OPEN circuit unconditionally — a host that tripped its circuit and then stopped being hit rendered in the DSH banner forever (rows synthesized from openedAt/lastFailure.at), because circuit entries are only removed by a success or MAX_CIRCUITS eviction. Filter the projection only, mirroring pruneStaleAlerts: an open circuit whose last activity (lastFailure.at ?? openedAt) predates the same ALERT_STALE_MS bound drops out of /__bili/upstreams. The state machine keeps the entry — traffic resuming into it still fails fast / probes, and a fresh failure re-surfaces the row on the very next read. Both directions pinned in tests/upstream-alerts.test.ts.
12663a2 to
8fc410c
Compare
ranxianglei
left a comment
There was a problem hiding this comment.
(ai: vllm-qwen/qwen3.8-27b)
APPROVE (round 2) — clean re-review of updated head 8fc410c57; mergeable. Posted as a COMMENT because formal self-approval is blocked (this account is the PR author; GitHub forbids approving your own PR). Independent analysis, not copied from prior floors.
What changed since round 1. The branch was rebased onto newer master (3ac3e95c0, was 0aace2f20) and a second commit was added:
- Commit
f06e363fb— the original dsh banner chrome-softening + ✕ dismiss.git diff 12663a270 f06e363fb -- src/agent/dsh-native-client.ts tests/dsh-settings-ui.test.tsis empty: byte-identical to the code approved in round 1; only the base moved, so that approval carries over unchanged. - Commit
8fc410c57(new) — fix(upstreams): expire quiet open circuits in the health-report projection (#5701). Server-side:src/upstream-alerts.ts(+18/-2) +tests/upstream-alerts.test.ts(+58). This is the substantive new work I focused on.
The new commit — what it does. In getUpstreamHealthReport (src/upstream-alerts.ts:406-419), the loop over open circuits previously attached every open circuit unconditionally. Now it skips a circuit whose last activity (state.lastFailure?.at ?? state.openedAt) is older than ALERT_STALE_MS (5 min), mirroring pruneStaleAlerts (src/upstream-alerts.ts:87-93) exactly — same constant, same cutoff expression, same strict <. Root cause: #5574 aged out alert rows after 5 min, but the report still merged every open circuit unconditionally, so a host that tripped its circuit and then stopped being hit rendered in the DSH banner forever (its row's firstSeen/lastSeen were synthesized from openedAt/lastFailure.at). The fix filters the projection only.
Why it's safe (no regression). The report has exactly one production consumer: src/server/admin.ts:252 (loopback-gated /__bili/upstreams). No request-routing or fail-fast path imports it. Fail-fast and Retry-After read the circuit state machine directly — upstreamCircuitRetryAfterSeconds (src/upstream-alerts.ts:262) reads the circuits map; getOpenUpstreamCircuits filters on openedAt !== null independent of staleness. The filter never deletes from circuits nor mutates e.state, so fail-fast / probe scheduling are untouched. Active (fresh) circuits behave exactly as before; only quiet/stale ones are newly omitted. Types are clean (openedAt:number|null, lastFailure:{…,at}|null) — no as any.
Tests. Two new cases in tests/upstream-alerts.test.ts drive the real code through a monkey-patched clock (withClock, +1000ms steps, restored in finally; recordUpstreamCircuitFailure stamps Date.now() so the patched clock controls timestamps). Case 1: a quiet open circuit drops out of the report after 301 ticks while getOpenUpstreamCircuits() still returns it (state machine intact). Case 2: a host that keeps failing stays visible after aging, and one fresh failure re-surfaces it. Both directions pinned (Gate Test Discipline #3617), fully deterministic (no timers/ports). I traced both by hand against the implementation — they pass.
Behavior change (disclosed). /__bili/upstreams (and therefore the DSH frame-level banner) — OLD: listed every open circuit regardless of recency → a host that went quiet after tripping its circuit stayed visible indefinitely. NEW: an open circuit quiet for > ALERT_STALE_MS (5 min) is omitted until a fresh failure re-surfaces it. WHY: align the circuit source with the alert source under one staleness rule; a host that stopped being hit is not evidence of a current outage. Scope: DSH banner + admin endpoint only; state machine / routing unchanged.
CI (mirror cache, head 8fc410c57). At review time: total 30, failed 0, success 6 (static-gates win+ubuntu, mysql-contract, test-import-graph, lock-sync, plan), skipped 13 (env-gated e2e lanes), in_progress 11 (full test matrix shards across windows/ubuntu × node 22/24 × shards — still running). Zero failures; the new tests run inside those in-progress shards. Full-suite verdict lands on remote CI.
Small findings / NO OPEN ENDS. No mechanical findings found in either commit (no typo / stale comment / wrong predicate / missing obvious test). One pre-existing nuance carried from round 1, stated for closure (not a defect of this change): dismissedSig is never reset on recovery, so a recovered-then-identically-refailing host stays banner-suppressed until the failing set changes — consistent with the documented "until the failing set changes" contract and orthogonal to this commit; no action taken here. Nothing to fix in place, nothing converted to a decision.
Authorization boundaries. No kernel/ touch, no kernel-change declaration, no config-surface change, no wire-protocol change → no 🔶 需要决策 gate (kernel-guard / config-surface-guard green on CI).
结构化八问(中文,供人工 reviewer)
-
是什么问题:DSH 顶栏的「上游不可用」横幅会永久卡住——某个上游触发熔断后如果不再被请求(变安静),它的行会从
openedAt/lastFailure.at合成出来一直显示在报告里,永远不消失。根因是 #5574 只让告警行按 5 分钟老化,却没让熔断行跟着老化。 -
什么原因导致的:
getUpstreamHealthReport把所有 open 状态的熔断无条件合并进报告,而告警行走的是pruneStaleAlerts的 5 分钟老化。两个数据源用了两套陈旧判定——熔断侧缺了同一套老化规则。修法:给投影加与告警完全一致的老化过滤(同一个ALERT_STALE_MS=5*60_000、同一个 cutoff、同一个严格<)。 -
影响范围与严重程度:仅影响 DSH 帧级横幅 + 回环门控的
/__bili/upstreams管理端点的展示;不影响任何请求路由 / fail-fast / 重试退避。严重度 = 体验瑕疵(横幅误报「已恢复的上游仍不可用」),非可用性缺陷。触发条件:某上游熔断后停止被命中超过 5 分钟。 -
怎么修复的:只在读投影处过滤(
src/upstream-alerts.ts:406-419)——open 熔断若lastFailure?.at ?? openedAt早于now - ALERT_STALE_MS就跳过;状态机里的条目原样保留,所以流量重新打进来仍会 fail-fast / 探测,下一次新鲜失败立即让该行重新出现。UI 部分(chrome 柔化 + ✕ 关闭)与 round 1 逐字节相同,未改动。 -
是否有回归问题:无。逐项核对既有行为——(a) 唯一生产消费者是
admin.ts:252,无路由路径引用它;(b) fail-fast / Retry-After 直接读circuits状态机(upstreamCircuitRetryAfterSeconds:262、getOpenUpstreamCircuits:346),与本投影解耦,未受影响;(c) 活跃(新鲜)熔断行为与旧代码完全一致(旧代码也是全部纳入),只有安静 / 过期熔断新增被剔除;(d) 无类型逃逸(无 as-any)。有意的输出变更已披露:/__bili/upstreams从「列出所有 open 熔断」变为「安静超 5 分钟的 open 熔断暂时不列,新失败再冒出」(见上 Behavior change)。高危模式(fail-fast 变吞错 / 阈值漂移 / 时序漂移)逐项过:均不涉及。 -
是否破坏缓存:不涉及。本改动不触碰 prompt cache / KV / 增量游标 / 去重键;上游熔断老化是每主机独立的状态,与客户端前缀缓存无关。
-
是否改了设计方向:不改架构 / 边界 / 数据流。只是把已有的「单一陈旧规则」从告警源补齐到熔断源(#5572/#5701 注释里已声明两源共享一条规则),属于收敛而非转向。
-
是否引入了新的配置:不涉及。无新 env / config / 默认值;复用的既有常量是
ALERT_STALE_MS(=5min,早已存在)。
判定:可合(APPROVE)。 两个提交都干净、低风险、测试有牙且双向钉死;新提交为纯展示层修复,状态机不受影响,CI 零失败(测试矩阵分片运行中)。无需人工决策门禁(不碰 kernel/config/wire)。如需正式 approval 状态请由其他账号点 Approve。
✅ review-worker-r1 二轮审毕(PR #5703 新 head |
# Conflicts: # tests/dsh-settings-ui.test.ts
(ai: vllm-qwen/qwen3.8-27b) Conflict resolved and pushed — merge commit What I did this run:
Expectation for the triggered CI runs: this PR's own code is green locally; any remaining reds will be the known inherited master-reds already reported in #4599 (floor 934) — #2817 deterministic ×3 shards (options A/B/C pending owner), the BLOCKED-ref flake family, and #5418 watermark ×3 shards. None are caused by this branch. 八问(中文结构化结论)
收工判定:冲突已解、已推送、mergeable=true(现 blocked 仅等 check/审批);新 CI 若再红即 #4599 已报备的 master 继承红项(#2817 待 owner 拍板 A/B/C),与本分支无关。 |
ranxianglei
left a comment
There was a problem hiding this comment.
(ai: vllm-qwen/qwen3.8-27b)
APPROVE — independent end-to-end review of head 7adc0007c (round 3); mergeable.
Round 3 is a clean rebase/merge of the branch onto newer master (f1a4af4ee). It introduces no new PR-authored code. Verified three ways:
- The true PR contribution on the new base (
git diff f1a4af4ee..7adc0007c) touches only the same 4 files and is byte-identical to what I approved in rounds 1–2:src/agent/dsh-native-client.ts: softened banner chrome +dismissedSig✕-dismiss-until-the-failing-set-changes + i18nupstreams_dismiss(zh+en).src/upstream-alerts.ts→getUpstreamHealthReport(): quiet open circuits older thanALERT_STALE_MSare excluded from the display projection only (state machine untouched).tests/dsh-settings-ui.test.ts(+75/-2): the #5701 banner test;tests/upstream-alerts.test.ts(+58): two deterministic circuit-expiry tests.
- The ~900 lines of extra churn vs round 2 (
src/server.ts,fetch-util.ts,responses-ws.ts,log-mask.ts, the #4406 Context-tab/composer-seat UI, etc.) are master's own merged work pulled in by the merge commit7adc0007c(#5837/#4406, #5947, #5939, #5883, #5879 ci-fixes). Confirmed: basef1a4af4eealready contains all of it, and zero of those lines appear as additions in this PR's diff — so none of it is this PR's review scope. - Merge hygiene: the PR's own hunks survived verbatim (no conflict-resolution corruption); the react import correctly unions to
{ createElement, useEffect, useLayoutEffect, useRef, useState }(the extra two are master's #4406 need, harmless here).
CI on head 7adc0007c (mirror cache): fully green — 30 checks, 0 failed, 0 pending (16 success + 14 env-gated skips). Better than round 2, where 11 test-matrix shards were still running.
No kernel/, config-surface, or wire/request-path change → no authorization gate, no 🔶需要决策. No small mechanical findings to fix in place.
结构化八问
- 是什么问题:DSH overlay 上游横幅有三处收尾——(a) 视觉太扎眼需软化;(b) 用户想临时关掉它(✕,且故障集合不变时保持隐藏);(c) 一个 host 触发熔断后若不再被请求,会一直挂在横幅里(#5574 只清了 alert 行、没清 circuit 行)。前两项在上一轮已审通过,(c) 是本 PR 的实质新增。本轮 head 相对上一轮只是 rebase 到更新的 master,PR 自身贡献逐字节未变。
- 什么原因导致的:横幅常驻的根因是
getUpstreamHealthReport()无条件把每个 OPEN circuit 合成一行,而 circuit 只在「成功」或MAX_CIRCUITS驱逐时才移除;host 停止被请求后既无新失败也无成功,circuit 永不老化,于是永远显示。 - 影响范围与严重程度:仅 DSH 客户端 UI + 回环内
/__bili/upstreams管理端点的展示层;不触及请求路由 / fail-fast / 缓存。严重度=体验瑕疵(横幅该消失时没消失),无数据丢失、无不可用。 - 怎么修复的:展示投影里对每个 open circuit 取
lastActivity = lastFailure?.at ?? openedAt,早于now - ALERT_STALE_MS(5 min)的一律跳过——与 alert 行的pruneStaleAlerts共用同一套老化规则、同一常量、同一严格<比较。只过滤投影、不动状态机:fail-fast / Retry-After 直读circuitsmap,getOpenUpstreamCircuits独立按openedAt!==null过滤,均不受影响。UI 侧 ✕ 用「故障集合签名」(host+kind+code,NUL/SOH 分隔后排序)记忆 dismissed:集合不变则保持隐藏,一变即重新浮现。 - 是否有回归问题:逐项过既有行为——fail-fast 与 Retry-After 路径(直读状态机)不变;active open circuit(lastActivity 新鲜)行为与旧代码完全一致(旧代码本就包含所有 open);只有「安静」stale open circuit 新增地被排除。高危模式(语义漂移 / fail-fast 变吞错 / 阈值时序漂移 / 输出格式变化)均未命中。测试双向钉死(安静即消失 + 仍在失败则保留),确定性时钟、无真实定时器/端口。
- 是否破坏缓存:不涉及——无缓存 / 重试游标 / 去重键改动;
x-bili-pf-*水位头与 prefix cache 均不受影响。 - 是否改了设计方向:不改架构 / 边界 / 数据流;仅把「alert 行老化」规则对称地补到「circuit 行展示」这一处投影上(#5572/#5701 归一到同一 staleness 规则)。
- 是否引入了新的配置:不涉及——无新 env / config / 默认值;复用既有
ALERT_STALE_MS(5 min)。
判定:可合(APPROVE)。 本轮为 rebase 到 master,PR 贡献未变且前两轮已审通过;CI 全绿(0 failed / 0 pending)。无 kernel/config/wire 触碰,无决策项,无小修待补。
[bot] 🏷 review-worker-r1 round 3 done: PR #5703 head 7adc000 = APPROVE (mergeable). Round 3 is only a rebase onto newer master |
# Conflicts: # src/upstream-alerts.ts # tests/upstream-alerts.test.ts
(ai: vllm-qwen/qwen3.8-27b) Conflict resolved and pushed — merge commit What I did this run:
Behavior note (convergence, disclosure per policy): on this branch the upstream-circuit staleness rule changes from our #5701 version (anchor 八问(中文结构化结论)
收工判定:冲突已解、已推送、mergeable=true(blocked 仅等 check/审批);新 CI 若再红即 #4599 已报备的 master 继承红项(#2817 待 owner 拍板),与本分支无关。 |
ranxianglei
left a comment
There was a problem hiding this comment.
(ai: vllm-qwen/qwen3.8-27b)
APPROVE — independent end-to-end review of head 670f9fb23 (round 4); mergeable.
Round 4 is a rebase onto newer master (4dea18eab). The meaningful change this round is that the PR's scope shrank from 4 files to 2, and I verified that is correct, not a regression:
- The server-side half — "age idle open circuits out of the status report" — was independently shipped to master via
dcbe8ff24"fix: age idle open upstream circuits out of status reports (#6026)", using a namedisOpenCircuitStale(e, now)predicate ingetUpstreamHealthReport(). That is functionally the same report-only staleness filter this PR previously carried (rounds 2–3). Once the branch merged the newer master (670f9fb23), the PR's redundantsrc/upstream-alerts.tshunk collapsed to zero net change — master's version stands. So there is no duplicate and no lost fix: the "idle open circuit lingers in the banner/report" bug stays fixed on master (#6026). - The PR now carries exactly its titled scope — DSH upstream banner UI only — across 2 files, byte-equivalent to what I approved in rounds 1–3:
src/agent/dsh-native-client.ts(+17/-2): i18n keyupstreams_dismiss(zh+en);dismissedSigstate; sig = per-rowhost+kind+code(NUL/SOH separators, sorted) withif (dismissedSig === sig) return null; softened chrome (borderrgba(217,63,11,0.5)→0.35, background0.1→0.08, borderRadius8→10, padding8px 12px→10px 14px, addedboxShadow); ✕ button (type="button", title/aria-label =t("upstreams_dismiss"),onClick → setDismissedSig(sig), text color inherited).tests/dsh-settings-ui.test.ts(+75/-2): updated #4254 comment (slot registration still not user-hidable) + new deterministic#5701test driving the real bundled component — asserts the concrete chrome values and the full dismiss state machine (click→null; count/ETA churn of the same set stays null; a changed set re-surfaces with "2 个上游不可用" + the new host; unmount cancels the poll loop). Fake timers, no real ports — has teeth.
- Coexistence with master is clean: the PR delta shows
#6026only as context (already-merged lines), never as an addition; no conflict-resolution corruption of the PR's own hunks.
CI on head 670f9fb23 (mirror cache): fully green — 30 checks, 0 failed, 0 pending (16 success + 14 env-gated skips).
No kernel/, config-surface, or wire/request-path change → no authorization gate, no 🔶需要决策. No small mechanical findings; no open ends.
结构化八问
- 是什么问题:DSH overlay 上游横幅的 UI 收尾——软化视觉(低饱和边框/背景、更大圆角与内边距、轻投影)+ 加一个 ✕ 按钮,点掉后在「故障集合」变化前保持隐藏(同一批 host/kind/code 的计数与重试 ETA 抖动不会让它重新冒出来,任何新增或变化的故障会再次浮现)。本轮 head 是 rebase 到更新的 master;PR 范围从 4 文件缩到 2 文件,因为服务端那半已被 master 自己通过 #6026 合入。
- 什么原因导致的:横幅常驻且扎眼是纯展示层问题。其服务端根因(
getUpstreamHealthReport无条件把 open circuit 合成一行、空闲 circuit 永不老化)已由 master 的dcbe8ff24(#6026)独立修复并合入;本 PR 只负责客户端 UI 这一半。 - 影响范围与严重程度:仅 DSH 客户端 UI(
shell.overlay插槽渲染),不触及请求路径 / fail-fast / 缓存 / 存储。严重度=体验瑕疵。无数据丢失、无不可用。 - 怎么修复的:客户端用「故障集合签名」(每行 host+kind+code,NUL/SOH 分隔后排序)记忆
dismissedSig;集合不变则return null,一变即重新浮现。chrome 降饱和:border 0.5→0.35、background 0.1→0.08、radius 8→10、padding 8px12px→10px14px、加 boxShadow;文字颜色继续继承 host token。 - 是否有回归问题:逐项过——#4254 既有测试只更新注释,插槽注册行为不变(仍不可被用户隐藏);新增测试双向钉死(点掉→null / 同集合抖动保持 null / 集合变化重新浮现并带新 host);确定性假定时器、无真实端口。React hook 顺序安全(全部 useState/useEffect 早于两个 early-return)。高危模式(语义漂移 / fail-fast 变吞错 / 阈值时序漂移 / 输出格式变化)均未命中。
- 是否破坏缓存:不涉及——无缓存 / 重试游标 / 去重键改动。
- 是否改了设计方向:不改架构 / 边界 / 数据流;纯展示层增量。本轮把范围收敛回 PR 标题所述(banner UI),服务端半交给 master #6026,边界更干净而非转向。
- 是否引入了新的配置:不涉及——无新 env / config / 默认值。
判定:可合(APPROVE)。 本轮为 rebase 到 master,PR 贡献收敛为纯 UI(与前几轮已审通过部分逐字节一致),服务端半由 master #6026 承接、未丢失;CI 全绿(0 failed / 0 pending)。无 kernel/config/wire 触碰,无决策项,无小修待补。
[bot] 🏷 review-worker-r1 round 4 done: PR #5703 head |
[bot] 🏷 Round 4 on PR #5703 is fully done and verified — nothing outstanding. Verdict: APPROVE (head |
ranxianglei
left a comment
There was a problem hiding this comment.
(ai: vllm-qwen/qwen3.8-27b)
APPROVE — independent end-to-end review of head 1e44cd5ef (round 5); mergeable.
Round 5 is a rebase onto newer master (dc041dd1ab) plus one new, well-scoped commit: 1e44cd5ef "make the upstream banner click-through except its ✕ button". I read the full delta — everything except that fix is byte-identical to what I approved in rounds 1–4.
The new change (and why it's correct):
- The
shell.overlayslot floats above host chrome, so the banner body — a<div>with background/border/padding — was capturing pointer events meant for the host controls underneath it, blocking clicks. The fix setspointerEvents: "none"on the banner root andpointerEvents: "auto"on the ✕ button only. - This is the standard CSS overlay pattern: a child's
pointer-events: autooverrides an ancestor'snone, so exactly one element (the ✕) stays interactive while the rest of the banner lets clicks pass through. The row lines are display-only text, so making them click-through has no downside; the ✕ was the only interactive element, so nothing is lost. Keyboard focus/activation of the ✕ is unaffected bypointer-events, so accessibility is intact. - A comment documents the rationale (overlay sits above host chrome; body must stay click-through).
Test: adds both directions at the right level for this vm-realm harness (no real hit-testing possible, so it asserts the exact style values): st.pointerEvents === "none" (banner body click-through) and the ✕ button's style.pointerEvents === "auto" (re-enabled). Concrete, would catch a regression if either setting were dropped. The rest of the #5701 test (chrome values + full dismiss state machine) is unchanged from round 4.
CI on head 1e44cd5ef (mirror cache): 0 failed; 8 test-matrix shards still queued at review time (13 skipped + 9 success completed), consistent with prior rounds where the matrix finished green. No red anywhere.
No kernel/, config-surface, or wire/request-path change → no authorization gate, no 🔶需要决策. No small mechanical findings; no open ends.
结构化八问
- 是什么问题:DSH overlay 上游横幅是浮在宿主界面之上的插槽,其主体(带背景/边框/内边距的 div)会挡住下层宿主控件的点击。本轮在已批准的「软化视觉 + ✕ 关闭」之上,新增让横幅主体点击穿透、仅 ✕ 按钮可点。(另:本轮 rebase 到更新的 master
dc041dd1ab。) - 什么原因导致的:overlay 插槽渲染在宿主 chrome 之上,横幅主体默认
pointer-events:auto,覆盖区域吞掉了本应落到宿主按钮上的指针事件。 - 影响范围与严重程度:仅 DSH 客户端 UI(
shell.overlay插槽),不触及请求路径 / fail-fast / 缓存 / 存储。严重度=交互体验缺陷(横幅盖住时点不到下层控件)。无数据丢失、无不可用。 - 怎么修复的:横幅根节点设
pointerEvents:"none"(整体穿透),✕ 按钮单独设pointerEvents:"auto"(子级 auto 覆盖父级 none,标准 CSS overlay 模式);行内容是纯展示文本,穿透无副作用;✕ 是横幅唯一交互元素,未丢功能;键盘焦点/激活不受 pointer-events 影响,无障碍不受损。 - 是否有回归问题:逐项过——新增测试双向钉死(横幅体 none + ✕ 按钮 auto);其余部分(i18n / dismissedSig / 签名抑制 / 降饱和 chrome / #5701 状态机)与前几轮已审通过逐字节一致;React hook 顺序安全。高危模式(语义漂移 / fail-fast 变吞错 / 阈值时序漂移 / 输出格式变化)均未命中。
- 是否破坏缓存:不涉及——无缓存 / 重试游标 / 去重键改动。
- 是否改了设计方向:不改架构 / 边界 / 数据流;纯展示层增量,且是让浮层不遮挡宿主的正确做法。
- 是否引入了新的配置:不涉及——无新 env / config / 默认值。
判定:可合(APPROVE)。 新增的点击穿透修复正确、聚焦、双向有测试;其余与前几轮已审部分逐字节一致。CI 0 failed(8 个测试矩阵分片评审时仍在排队,与此前各轮最终全绿一致)。无 kernel/config/wire 触碰,无决策项,无小修待补。
[bot] 🏷 review-worker-r1 round 5 done: PR #5703 head |
Closes #5701
What the issue reported (bili 0.1.212, DSH desktop-runtime)
The
shell.overlayupstream-unavailable pill: (1) hard-saturation red chrome clashing with host themes, (2) "does not auto-dismiss", (3) overlaps host UI in the corner.Root-cause split (version-first triage at v0.1.212 + master)
nullon an empty report (if (rows.length === 0) return null), and the server clears a host's alerts on any successful fetch to that host ([Feature] Web UI 主动提示上游连接失败(全局 banner),而不是只埋日志 #1682). A dead port (e.g. a loopback shim rebound to a fresh ephemeral port) can never succeed, so the success-clear never fired. Fixed by [PR] fix: expire stale upstream alert rows after 5 min (DSH overlay stuck on dead loopback port) #5574 (fix: expire stale upstream alert rows after 5 min, commit 8b05d23,ALERT_STALE_MS = 5*60_000lazy prune) — shipped in v0.1.213 (133f352), verified against the shipped dist by @chuilian.alertsonly;getUpstreamHealthReportmerged every OPEN circuit unconditionally, and circuit entries are removed only by a success orMAX_CIRCUITSeviction. A host that tripped its circuit (3 consecutive pre-response failures) and then stopped being hit rendered in the banner forever, withfirstSeen/lastSeensynthesized fromopenedAt/lastFailure.at(repro confirmed on v0.1.213 by @chuilian: VPN drop, internal gateway connect-timeout ×3, then no traffic to that host — row survived app relaunch because the proxy is a detached process). Fixed in this PR (second commit): the same staleness bound applied to the circuit's last activity, in the report projection only — the circuit state machine is untouched (fail-fast / half-open probes unchanged; a fresh failure re-surfaces the row on the very next read). Both directions pinned intests/upstream-alerts.test.ts.shell.overlayplacement is DSH desktop-runtime (host-side) territory; bili only controls its own box. Flagged, not fixed here.Changes
Commit 1 — client-only (dsh lane)
src/agent/dsh-native-client.ts:host+kind+code). Count ticks / retry-ETA churn of the same set never re-show it; any new or changed failure re-surfaces it. Auto-dismiss on recovery (empty report ⇒ null) unchanged.tests/dsh-settings-ui.test.ts: regression test"#5701 …"pins the softened values, the dismiss click, churn-stays-hidden, and changed-set re-surface through the existingmountClientvm-realm harness.Commit 2 — server-side status projection (
src/upstream-alerts.ts)getUpstreamHealthReport: an open circuit whose last activity (lastFailure.at ?? openedAt) predatesnow - ALERT_STALE_MSdrops out of/__bili/upstreams, mirroring the existingpruneStaleAlertslazy-prune discipline ([PR] fix: expire stale upstream alert rows after 5 min (DSH overlay stuck on dead loopback port) #5574). The circuit state machine keeps the entry —upstreamCircuitBlockReasonfail-fast, half-open probe scheduling, and thegetOpenUpstreamCircuits()diagnostic surfaces are all unchanged.tests/upstream-alerts.test.ts: two new tests — a quiet-for-window open circuit drops out of the report whilegetOpenUpstreamCircuits()still lists it (proving the filter is projection-only); a still-failing circuit re-surfaces immediately regardless of age.Behavior changes (old → new, disclosed per policy)
/__bili/upstreamsrows for open circuitsNo config surface added. No wire/protocol/request-path change: commit 1 is host-process UI only; commit 2 filters a loopback-gated status-endpoint projection only — relay/egress behavior (fail-fast, probes, Retry-After) is byte-identical.
Tests
node --import tsx --test tests/upstream-alerts.test.ts→ 14/14 pass;node --import tsx --test tests/dsh-settings-ui.test.ts→ 27/27 pass.tsc --noEmit). Full-suite verdict = CI lanes on this head.