Repository navigation
Conversation
A delegated work whose turn fails with a transport-class error after tool execution is held fail-closed in needs_verification so side effects are never duplicated. But nothing ever told the caller: the required wait stayed open, status reporting said the Bot was still working, and the user had to poke the team to discover the interruption. Keep the fail-closed hold exactly as designed and close the observability gap instead: - insert exactly one interruption notice (deduped per call) into the caller's work inbox when a non-foreground delegated work enters needs_verification for a transport interruption, naming the work ref, summarizing the tools that already ran, and spelling out the actionable path: cancel_work the held work, then delegate_work afresh (the callee session keeps its history, so a fresh delegation sees the completed tool results); - report held delegated works in statusOf/list_bots as interrupted and awaiting verification instead of claiming they are waiting for the user or still working; - track per-turn tool names through the turn lifecycle so the notice can summarize what executed before the interruption. Foreground works, normal long turns, retry backoff, and the needs_verification fail-closed semantics are unchanged: nothing is auto-settled, auto-resumed, or re-run. Fixes #1656
The first pass excluded every work with group origin, but a member's own delegate_work inside a group carries group origin too — exactly the area the issue is tagged with. Exclude only the room fan-out relay rows (meta.kind room_chain/room_caller/room_call), which the group machinery already reports on its own channel, and notify for genuine bot-to-bot delegations regardless of where the caller was working.
|
Review: approved Reviewed head Verified by running
Verified by reading (concurrency/storage focus)
P2 — non-blocking
Not verified: real 402/quota path (same transient-failure branch, as the PR states); DSH smoke test (no harness sources on this machine, same as the PR's disclosure); whether a mid-turn TRANSPORT failure of a relay row itself surfaces anything in the room — out of this PR's scope, but if it does not, the group variant of the issue symptom may persist there. |
The real-runtime reproduction never called the resume installer, and oxlint treats the unused import as an error, failing the Test result check.
|
Review: approved Incremental re-review of the lint-fix head Verified
The previous review's conclusion carries over unchanged: atomic notice insertion, correct per-call dedup, no settlement confusion, sound wake gating, correct toolNames capture, correct relay exclusion — all verified at |
Issue
Fixes #1656
Agent
Agent: DS Bot (SWE-2.1)
What changed / 改了什么
Root cause: a delegated work whose turn fails with a transport-class error after tool execution is held fail-closed in
needs_verification(by design, so side effects are never duplicated). But nothing ever told anyone the work stopped progressing: the caller's required wait stayed open with no input,statusOf/list_botsreported the callee as still working (or "waiting for the user"), and the user had to poke the team to discover the interruption. (The older "second work never settles" half of the original report no longer reproduces on the current coordDb architecture — the stranded-running sweep plus periodic reconcile requeue and redeliver those works; verified in the high-fidelity reproduction.)This PR does not change fail-closed semantics and adds no new tools. It closes the observability hole:
needs_verificationfor a transport interruption, exactly one notice (deduped per call) is inserted into the caller's work inbox. It names the work ref, summarizes the tools that already ran, and spells out the actionable path:cancel_workthe held work, thendelegate_workafresh — the callee session keeps its history, so a fresh delegation can pick up where it stopped. Covers delegations made inside groups too (only the room fan-out relay rows, which have their own reporting channel, are excluded).statusOf/list_botsnow report held delegated works as "interrupted … awaiting verification … its caller was notified" instead of "still working" or "waiting for the user". Foreground (user-facing) held works keep their existing user-directed wording.Nothing is auto-settled, auto-resumed, auto-retried, or re-run; normal long turns (no
turn/endyet) never enter this path because the hold — and therefore the notice — only happens when a turn has already ended with a transport-class failure.Changelog
派出去的 Bot 因断网等传输错误中断时,派活的 Bot 会立刻收到一条含 work 编号、已执行工具摘要和处置指引(cancel + 重派)的通知,状态查询也不再说它「还在干活」。
How I checked it / 怎么验证的
已验证(在 Mac 上验证)
test/stranded-work-1656.test.js(3 项:通知恰一条且含 work 编号/工具摘要/两个动作;statusOf 不再说「还在干活」或「waiting for the user」;正常完成与长回合不误报)— 修复前 2 红,修复后 3/3 绿。test/stranded-work-1656-real.test.js(真实 DSH agent loop 高保真复现:工具真实执行后第二步模型调用 TRANSPORT 失败)— 修复前红(16s 超时无任何通知),修复后绿:work 进入needs_verification、调用方 inbox 恰一条 interrupted 通知(含 workRef/writer_tool/cancel_work/delegate_work)、400ms 后仍一条、无关排队 work 正常 done。npm test(inds-bot/,npm run test:windows全量一次,最终 head6e5672f1a):8636 pass / 0 fail / 7 skipped(8643 总),433snode scripts/build-client.mjs --check✅npm run lint:190 warnings / 1 error,全部在 dev 基线已有文件中(src/office/xlsx.js等),非本次改动引入;本次改动文件 0 警告coordination-db、delegation-settlement-2903-2921、delegate-work-delivery-2761、delegation-dedup、group-delegations等 144/144 绿must fix: 0未验证
index.js/src/host/冒烟测试:本机没有 deepseek-harness 源码,跑不了(规则内写「未验证」)Checklist / 检查
src/client/changed →npm run buildran andclient.jsis committed. / 未改src/client/,不适用。Co-authored-by. / 没有把 AI 工具写成作者或Co-authored-by。Co-authored-by, or N/A. / 不适用。