Repository navigation
[PR] fix(agent): hold in-flight launcher respawns under the spawn budget in dsh/omp/opencode lanes - #5510
[PR] fix(agent): hold in-flight launcher respawns under the spawn budget in dsh/omp/opencode lanes#5510ranxianglei wants to merge 3 commits into
Conversation
📦 Built Package ArtifactBranch: Latest build — install this exact versionnpm install -g billion-context@0.0.10892-pr.5510.636972fThis exact version is immutable and reproducible. The rolling Recent builds (commit → version)
Download artifact
tar xzf billion-context-pr5510.tgz
npm install -g packageInstall instructions are refreshed on each push. |
[bot] 🏷 (ai: vllm-qwen/qwen3.8-27b) 查重: 不重复。 全仓检索(含已关闭)无其他 PR 触碰同一机制——最近邻是 #4546(已合,#4516 的 pi 车道 + 共享 intercept 侧 hold),本 PR 是把那条 seam 补到 dsh/omp/opencode,方向与 #5507 Q4 一致。 标签: Review 进行中(分支已拉取,单 commit、5 文件 +271/-3,基于最新 master)。初步发现一个待验证点:opencode V2 路由走的是 |
|
(ai: vllm-qwen/qwen3.8-27b) 注:GitHub 不允许对本人所开 PR 提交正式 approve 事件(422),故以本评论给出审查结论;判定为 APPROVE。 结论:APPROVE —— 代码正确、测试双向钉住、行为变更已披露,无阻塞项。 八问
测试有效性:每车道双向钉住(fallback-to-spawn 精确 arm 到 一处非阻塞观察(可选精修,不拦合并): CI:review 时镜像缓存显示 head |
(ai: vllm-qwen/qwen3.8-27b) review-worker-r1 完成:审查结论 APPROVE,已作为评论发布到 GitHub PR #5510(正式 approve 事件因「本人 PR」被 GitHub 422 拒绝,判定载于评论正文,含结构化八问 + 测试有效性核查)。无阻塞项;一处非阻塞 DRY 观察( |
[bot] 🏷 (ai: vllm-qwen/qwen3.8-27b) 审查完成:PR #5510(内部 #5512)在当前 head |
(ai: vllm-qwen/qwen3.8-27b) PR #5510 审核完成 — 结论:可合(CI 全绿) 方向正确、arm 点与 PR 表格逐一对上。审核发现 1 个真实漏掉的路径 和 1 个原 head 自带的 typecheck 红,已直接在 PR 分支修掉(两个新 commit,CI 重跑后全绿):
结构化八问
行为变更披露(old → new):in-flight respawn 期间降级路径每请求等待 15 s → 70 s(SPAWN_BUDGET_MS + 10 s,dsh/omp/opencode;pi fallback 尾同步),含 15 s readiness cap 的最坏总时长 ~30 s → ~85 s;未 arm 时零变化。此变更正是 issue 声明的对齐目标。 交付:分支 判定:可合,等 owner 合并。 |
3706dce to
5faa385
Compare
|
(ai: vllm-qwen/qwen3.8-27b) Re-review @ head
本轮做了什么(head 由
结构化八问
结论:APPROVE —— 代码正确性与回归面已核清;CI 测试矩阵收尾中、目前 0 失败。无阻塞项、无遗留待办。 |
5faa385 to
57ee18c
Compare
(ai: vllm-qwen/qwen3.8-27b) Conflict resolution complete — PR rebased onto current master and force-pushed. 七问 summary
Commits on the new head: |
|
(ai: vllm-qwen/qwen3.8-27b) Re-review @ head
本轮(head
结构化八问
结论:APPROVE —— 内容自第 1 轮起逐字节未变,正确性与回归面已核清;CI 测试矩阵收尾中、目前 0 失败。无阻塞项、无遗留待办。 |
[bot] 🏷 (ai: vllm-qwen/qwen3.8-27b) 收尾说明:第 4 轮 review 已完成——head 提示:本线程最后一条是我自己同步过来的 GitHub review 评论( |
…n dsh/omp/opencode lanes (#5507) Part of #5507 (question 4). pi-native held model requests racing an in-flight launcher respawn under the launcher's own bring-up budget (SPAWN_BUDGET_MS + 10s margin, #4516), but dsh/omp/opencode never set state.spawnWaitMs — their degraded path capped at the generic 15s readiness timeout while their sanctioned cold-start budget is 60s, so a slow-but-legitimate boot degraded turns to direct-send or 422 oversize refusal before the replacement could land. Every launcher-spawn transition now arms the same hold: - plan-time spawn arm (dsh/omp/opencode; pi already had it) - attach -> spawn fallback tails (all four lanes) - dsh maybeRetry self-heal inline arm Behavior change (old -> new): the degraded-path hold while an in-flight respawn settles is 15s -> SPAWN_BUDGET_MS + 10s (70s with default budgets) for dsh/omp/opencode, worst-case total ~30s -> ~85s including the readiness cap, matching pi since #4516. No config, wire, or kernel changes. tests/issue5507-lane-respawn-hold.test.ts pins both directions per lane: the fallback-to-spawn transition arms the budget; a healthy attach never does.
createLiveOriginResolver awaited readyOrigin(state) on dead-origin / bootstrap-failure, capping at the generic 15 s readiness cap even when an in-flight respawn had armed state.spawnWaitMs (#4516 seam). That resolver serves OpenCode 2.x model traffic (createNativeRoute via the V2 setup route), so those installs never actually held under the spawn budget as intended. readyOrigin now takes an optional waitBudgetMs override (spawnWaitMs passed by the resolver); disarmed behavior is byte-identical. Both directions pinned in tests/issue5507-lane-respawn-hold.test.ts: armed state adopts a late spawn landing past the generic cap; disarmed state degrades at the cap.
Small pre-existing defect on this PR head: the suite's Lane type declared reset as () => void while dsh's _resetRegisterForTest takes a required base parameter (string | undefined), so tsc failed on the PR's own new test file (TS2322). Widened to (base?: string, toolsReady?: boolean) => void; the other lanes' zero-arg resets stay assignable.
57ee18c to
e9adf8f
Compare
(ai: vllm-qwen/qwen3.8-27b) Second conflict rebase complete — PR rebased onto current master and force-pushed (final head, full CI pass). 七问 summary
Commits on the new head: |
(ai: vllm-qwen/qwen3.8-27b) No action needed this run — the conflict was already resolved in the prior run. Verified live; the wake's "dirty" state is stale. 七问 summary (no-op run)
|
|
(ai: vllm-qwen/qwen3.8-27b) Re-review @ head
本轮(head
结构化八问
结论:APPROVE —— 内容自第 1 轮起逐字节未变(连续 5 次纯 rebase),正确性与回归面已核清;CI 测试矩阵收尾中、目前 0 失败。无阻塞项、无遗留待办。 |
[bot] 🏷 (ai: vllm-qwen/qwen3.8-27b) 收尾说明:本线程最后一条(FLOOR 34, 第 5 轮 review 已完成——head |
Part of #5507 (question 4 — the gate waiting for a replacement before refusing).
What
pi-native has held model requests racing an in-flight launcher respawn under the launcher's own bring-up budget since #4516 (
state.spawnWaitMs = SPAWN_BUDGET_MS + 10_000, 70 s with default budgets). The other three self-spawning lanes — dsh, omp, opencode — never set that seam, so while a sanctioned cold start (budget 60 s:BILI_SPAWN_WAIT_MS20 s +BILI_SLOW_START_GRACE_MS40 s) was still in flight, their degraded path capped at the generic 15 s readiness timeout and then either direct-sent the turn or refused it withbili_gate_oversize_refusal_fallback(HTTP 422) — exactly the "proxy died, no replacement came up" window this issue reports on 30–45 MB DSH sessions.Every launcher-spawn transition now arms the same hold:
spawnFallback)maybeRetryinline arm)Lazy attach-mode arms (
verifyAttachAndRecoverviasingleFlight) are unchanged: their actual spawns route through the covered fallback tails. Inline-mode arms never launch a proxy process and are untouched.Behavior change (old → new)
Degraded-path hold while an in-flight respawn settles, per request: 15 s →
SPAWN_BUDGET_MS + 10 s(70 s default) for dsh/omp/opencode; worst-case total including the 15 s readiness cap ~30 s → ~85 s. This matches what pi has done since #4516, so the lanes are now consistent instead of divergent. A healthy attach or an off-switched lane arms nothing (pinned by the negative-direction tests). No config surface, wire protocol, or kernel changes.Tests
New
tests/issue5507-lane-respawn-hold.test.tspins BOTH directions per lane (#3617 discipline): dead attach target → fallback-to-spawn transition arms exactlySPAWN_BUDGET_MS + 10_000; healthy attach settles on the target with no hold armed. Touched-lane suites re-run green locally (dsh/omp/pi/opencode native, #2082 recovery, #4516 mechanism).Full-suite verdict from CI on the pushed head.
Review supplement (agent review, commits 045a298 + 3706dce)
Review found one gap in the original head and one pre-existing defect:
Gap — OpenCode 2.x model traffic was not actually held.
createLiveOriginResolver(src/agent/native-intercept.ts) is the route OpenCode 2.x model requests flow through (createNativeRoute→ V2 setuproute). On a dead attach target / bootstrap failure it didstate.ready = state.respawn(); await readyOrigin(state)— waiting only the generic 15 s readiness cap and never readingstate.spawnWaitMs. The armed holds above therefore never applied to the primary path of opencode self-spawn installs (the fetch-intercept lanes dsh/omp/pi were covered). Fixed:readyOrigintakes an optionalwaitBudgetMsoverride and the resolver passesstate.spawnWaitMs; disarmed states are byte-identical to before. Both directions pinned in this PR's suite (armed → adopts a late spawn landing past the 15 s cap; disarmed → degrades at the cap). Behavior change for that one path: degraded-path hold while an in-flight respawn settles, 15 s → SPAWN_BUDGET_MS + 10 s (70 s default), same as the other lanes now get; no change when no respawn is armed.Pre-existing defect — the suite did not typecheck on the original head. The
Lane.resethook was typed() => voidbut dsh's_resetRegisterForTesttakes a requiredbaseparameter (TS2322 on this file). Widened the hook signature; other lanes' zero-arg resets stay assignable.