Repository navigation
[PR] fix: give-up client event names the unavailability branch (#4125) - #4389
ranxianglei wants to merge 1 commit into
Conversation
c13f64c to
3eb439b
Compare
📦 Built Package ArtifactBranch: Latest build — install this exact versionnpm install -g billion-context@0.0.5332-pr.4389.78396a8This exact version is immutable and reproducible. The rolling Recent builds (commit → version)
Download artifact
tar xzf billion-context-pr4389.tgz
npm install -g packageInstall instructions are refreshed on each push. |
(ai: vllm-qwen/qwen3.8-27b) 查重:不重复。 按失败签名(give-up 客户端事件缺分支信息 + win32 孤儿子进程清理静默吞错)检索了 open/closed 的 issue 与 PR,无其他条目做同一修复;相关但机制不同的条目(#3544 优雅轮换 / #3654 健康探测 busy 判定 / #3044 twin 冲突退出 / #2187 spawn 超时孤儿清理)已在 #4125 里交叉关联,与本 PR 不重叠。本 PR 是 #4125 建议 4「gave up 日志带原因」的落地 + 一处相邻小修,明确不关闭 #4125(根因仍在等报告者证据)。 标签: bug / dsh / scope/wiring / p3(理由:可观测性缺口类缺陷;用户可见面是 dsh 客户端事件行;属宿主车道接线层;纯诊断/日志改善、零路由行为变更——事故本身的 p1 记在 #4125 名下)。 这个 PR 是我前一个会话在 #4125 triage 中开的(见 #4125 floor 4),本轮没有重做,而是独立审了 diff 并在最新 master 上重新验证。 陈旧基线处理(本轮主要动作):分支落后 master 269 个提交,三个源文件自 base 以来都在 master 上被改过;且原 head(c13f64cf1)上 38 个 CI check 全部 cancelled——没有任何有效 CI 结论。处理:rebase 到当前 master tip(70177775c,无冲突,逐行 diff 确认改动内容与原提交完全一致),本地重跑 typecheck + 定向套件后,用 force-with-lease 把 PR head 更新为 3eb439b。CI 会在新 head 上跑全矩阵。 验证结果(新 head 3eb439b)
独立审核(逐项)
按八问汇报
判定:可合 —— 待 CI 在新 head 3eb439b 上转绿(本地 typecheck + 定向套件已全绿,rebase 无冲突、patch 内容不变)。合并权在人:#4389 。#4125 根因仍等报告者证据,本 PR 不关闭它。 |
(ai: vllm-qwen/qwen3.8-27b) CI 结果更新(新 head):全矩阵已跑完——除 处置:按「CI 红几行小修顺手修掉」的纪律,已在本分支补一个独立标注 commit b23c007(去掉这 3 个类型的行首 |
(ai: vllm-qwen/qwen3.8-27b) CI 再更新(更正上一条 + 新发现一个 master 红):
处置(同前,CI 红几行小修顺手修):按 tripwire 要求的 #1248 并发假设审查过了这个文件——它只 spawn 一个不占端口的 sleep 子进程 + 一个 当前 head:87e5129,等本轮 CI(这次 test shard 会真正跑起来)。 |
The 'proxy respawn gave up' dsh client event was a single bare sentence with no branch information, so users hitting hours-long direct-send episodes could not self-diagnose which failure mode they were in. - native-intercept: the two send-failure recovery paths now record lastUnavailableReason='send-failed' immediately before firing onGiveUp (the resolver paths already recorded dead/busy-exhausted/bootstrap- failed); UnavailableReason gains the member. Consumers compare only against 'busy-exhausted', so the new member is inert elsewhere. - dsh-native: the three duplicated onGiveUp closures collapse into one fireGiveUp seam that appends ': <reason>' to the persisted line when the interceptor recorded one, keeping the original bare wording when none is present. _resetRegisterForTest clears the reason between scenarios; _nativeStateForTest exposes the shared state to suites. - launcher: killAbandonedChild no longer swallows win32 taskkill failures or a failing final SIGKILL — both now log a warn naming the pid, since a surviving listener is exactly the confusion #4125's netstat showed. Behavior change (intended): the give-up line gains a ': <reason>' suffix (dead | busy-exhausted | bootstrap-failed | send-failed) whenever the interceptor recorded why nothing was routable; hosts parsing the exact old string will see the longer form. No wire, config, persistence or kernel changes.
87e5129 to
b3d8ee7
Compare
(ai: vllm-qwen/qwen3.8-27b) 冲突已解决,PR head 更新为 本轮发现的关键事实:master 自分支点后合入的 7 个提交里,有两个正是本分支上两个 CI 止血提交的同款修复——#4441 的 处置:rebase 到 master tip( 验证(新 head): 按八问汇报
判定:可合 —— 待 CI 在新 head |
(ai: vllm-qwen/qwen3.8-27b) 分支状态更新(owner 已接手收尾):分支被 force-rebase 到新 master,当前 head b3d8ee7(原 PR 单提交重放)。我此前推的两个修复 commit(b23c0079a 去 3 个内部类型导出、87e512959 登记 LIVE_FILES)已被合入 master 的 #4441(修 #4440,内容相同,另一会话并行立的项)取代——不在分支上了,但全部效力已在 master。 核对过:本 PR 的 4 个文件在我审过的 head 与 b3d8ee7 之间逐字节一致,前面的审核结论原样有效。 CI(b3d8ee7f0):11 条 workflow 已 10 绿(全部 e2e 车道 + build artifact + Windows codex overlay),只剩主 CI 矩阵(test shards + 各 gate,含 unused-exports / LIVE_FILES 三保险)还在排队等 runner(队列被其他分支的 run 占着)。跑完我再报最终结论。 |
(ai: vllm-qwen/qwen3.8-27b) CI 最终结论(head b3d8ee7):全绿。 49 条 check-run:10 个 test shard(ubuntu 22/24 ×3 + windows ×5,#4439 权重分片后的新布局)全过;全部 gate 过——含此前红的 至此本 PR 的审核闭环:方向(#4125 提案 4 的可观测切片)、回归面(give-up 全部触发点、reason 消费方、事件行唯一出处)、测试有效性(四分支 reason 时序 + dsh seam 双向断言)、diff 整洁度均已在前面评论里逐项给过结论;本 PR 的 4 个文件在审过的 head 与 b3d8ee7 之间逐字节一致。判定:可合,等你点合并。 |
Related to #4125 (observability slice; does NOT close it — the root cause of the multi-instance / hours-long direct-send episode is still being triaged against reporter evidence).
What this PR does
The
proxy respawn gave up — model traffic goes direct (uncompressed)dsh client event was one bare sentence with no branch information. A user stuck in a direct-send episode could not tell whether the proxy was dead, saturated, failing to spawn, or whether a send had failed with no replacement — exactly the self-diagnosis gap #4125's proposal 4 asks for.Changes:
src/agent/native-intercept.ts— the two send-failure recovery paths (routed/bili/branch and raw-URL branch) now recordstate.lastUnavailableReason = "send-failed"immediately before firingonGiveUp. The resolver paths already recordeddead/busy-exhausted/bootstrap-failed; every give-up firing site now has a fresh reason at fire time.UnavailableReasongains the member. Existing consumers compare only against"busy-exhausted"(opencode-native refusal wording), so the new member is inert elsewhere.src/agent/dsh-native.ts— the three duplicated inlineonGiveUpclosures collapse into onefireGiveUpseam that appends: <reason>to the persisted client-event line when the interceptor recorded one, keeping the original bare wording when none is present._resetRegisterForTestclears the reason between scenarios;_nativeStateForTestexposes the shared state to suites (follows the file's existing ForTest-hook pattern).src/launcher.ts—killAbandonedChildno longer swallows win32taskkill /F /Tfailures or a failing final SIGKILL; both now log a warn naming the pid. A surviving listener after cleanup is exactly the confusion [Bug] Plugin bootstrap spawns a new instance while the old one still holds the port and drops proxying (goes direct): la | [Bug] 插件 bootstrap 在旧实例仍占端口时新起实例并放弃代理(goes direct):大会话随即以未压缩历史撞上游上限(400 Range of input length / 413) #4125's netstat showed (two processes on one port).tests/issue4125-giveup-reason.test.ts(new) — pins both halves of the contract: the interceptor writes the reason BEFORE firing give-up for all four branches (dead,busy-exhausted,bootstrap-failedwithout firing,send-failedthrough the full fetch chain with direct-send still happening), and the dsh seam appends the reason to the persisted line / keeps the bare wording when absent.Behavior changes (intended)
: <reason>suffix (dead|busy-exhausted|bootstrap-failed|send-failed) whenever the interceptor recorded why nothing was routable. Old value → new value:proxy respawn gave up — model traffic goes direct (uncompressed)→ same sentence +: <reason>. Hosts parsing the exact old string will see the longer form; the prefix is unchanged.Verification
Local targeted suites green on this head:
tests/issue4125-giveup-reason.test.ts tests/dsh-native.test.ts tests/issue2187-dsh-spawn-retry.test.ts tests/issue3380-dsh-rereg-selflock.test.ts tests/issue2082-dsh-recovery.test.ts→ 79 pass / 0 failtests/native-intercept.test.ts tests/native-intercept-selfheal.test.ts tests/issue3116-spawn-failure-diagnostics.test.ts tests/launcher.test.ts→ 421 pass / 1 pre-existing skip / 0 failnpm run typecheckcleanFull-suite verdict comes from CI on this head.