Repository navigation
Description
Summary
Session 693a78a8-77d1-4629-87b9-6766a628052f exposed a parent run that could not finish after all of its children had finished, confusing stop/status feedback, accumulated historical shell failures, and repeated workspace-related tool rejections. Together these make it difficult for the user or the model to tell what is running, what failed, and how to proceed.
Related: #1261 (delegated tool and background task outcomes), #1234 (task execution and interaction), and #1070 (child question/answer diagnostics). This issue records the specific cross-component failure and UX evidence from this session.
Environment and timeline
- Server build:
92d8438abaad2878c297a8d352ef5318cfafe914; the relevant reply-obligation and task-view files were unchanged in the inspected checkout at578f2dae287333dbb5fc5903c30cc101fbe9bfbc. - Parent run
b972829f-b6a3-49aa-a6d8-eb9319805920started at 18:39:51 on 2026-11-12 (Asia/Shanghai). - Its three direct children completed by 18:57:51. One child had been asked a question and then asked to stop; it emitted a shutdown response and completed, but the parent's checkpoint retained the original pending reply obligation.
- The parent remained running with no active child and did not complete. Several messages such as “停停停” were admitted as steering and woke model turns; they did not cancel the run. The run was finally recorded as cancelled by the user at 20:52. A subsequent run started at 20:53.
Confirmed problems
1. A reply obligation can outlive its responder and block the parent indefinitely
The pending entry identifies the terminated child and the original request. reply_obligations removes it on a matching typed response or a definitively rejected send; the tool/finalization path still treats the pending entry as a reason to wait. The child becoming terminal did not reconcile the outstanding question. See crates/runtime/src/messaging/reply_obligations.rs and crates/runtime/src/turn/agentic_loop/{tool_phase,execution_phase}.rs.
Expected: The canonical child lifecycle and messaging outcome should settle consistently. When the responder can no longer answer, surface an actionable outcome to the parent/model and allow it to continue or finish. Do not wait indefinitely for an impossible reply or introduce a second lifecycle state machine.
2. Task history obscures new and actionable work
At 20:52:39, the persisted workspace snapshot contained 32 failed and 32 completed shell records. Of the failed records, 17 were marked unobserved=false and 15 unobserved=true. These are retained records, not 64 running processes. Retention is bounded; this is not evidence of unbounded growth.
The task switcher limits visible completed/cancelled shell rows but retains failed rows regardless of whether their results were observed. Its initial ordering is oldest first and refresh preserves prior positions. The list shows elapsed duration rather than when the event occurred, so old failures dominate and the latest tasks are difficult to identify. The footer has its own attention filtering; do not assume its count equals the list's failure count.
Expected: Make running work, newly actionable failures and historical results distinguishable; make recency understandable and recent work easy to find. Preserve access to retained output without keeping already-observed failures prominent forever. Use the existing task owner and bounded retention rather than adding another task registry or storage path.
3. Workspace handling produces avoidable tool failures
In the original run, two bash calls were rejected before execution because their workdir was a separately created worktree outside the selected workspace root. A subsequent run encountered the same rejection at 20:55. Other calls could operate in these directories by changing directory inside the command, leaving the tool's apparent workspace constraint inconsistent and difficult for the model to reason about.
Expected: An explicitly selected/authorized workspace or worktree should have a clear, consistent way to be used across tools. Rejections must accurately say that no command ran and provide an actionable path forward. Preserve the intended user-local execution and policy boundaries.
4. Stop, waiting, output and live accounting do not tell a consistent story
- Natural-language stop requests were admitted as steering rather than run cancellation. The model generated “已停止” while the run still reported
running; the replay inspected did not contain the corresponding assistant text. Whether the live UI briefly displayed it was not established. - While the parent was blocked by the reply obligation, its run status exposed
waiting_for=null, hiding the actual wait. - In the subsequent live run, the run list reported
total_tool_calls=0while its step journal had recorded 18 tool starts. The original run's terminal accounting later recorded 51. If these fields are terminal-only, expose that fact rather than presenting zero as an observed live count.
Expected: The UI and model should receive truthful, timely execution and cancellation outcomes, including why a run cannot finish. Preserve user intent and partial results; do not claim work stopped until that is established.
Other tool failures observed; causality still open
During the original parent run and its children, the step journal recorded 11 failed and 4 skipped tool calls. At 18:47 one Git-related shell reached its 120-second timeout and three concurrent commands were cancelled. A Git auto-packing message appeared, but the evidence does not establish it as the cause of the simultaneous stalls. Three read_file failures were missing paths and returned actionable errors; these are not, by themselves, evidence of a broken file tool. A benchmark summary failed for a missing cold sample; the final report explicitly excluded cold data. Investigate the shared stall and cleanup separately rather than labeling every tool failure as the same product defect.
Acceptance / regression coverage
- Exercise the real parent/child lifecycle: question sent, child completes or is stopped without a matching answer, parent observes the outcome and can finish; include cancellation and resumed/replayed execution.
- Exercise the user-visible stop path and verify that displayed state, model-visible outcome and actual run state agree.
- Cover repeated sessions with old observed/unobserved failures, new running tasks and completion: recent/actionable items are discoverable, history remains inspectable, and retention stays bounded.
- Exercise explicitly selected worktrees through the public tool interface, plus rejected paths and clear no-execution feedback.
- Verify live waiting/accounting presentation against the canonical event stream, including unknown or not-yet-final statistics.
- Preserve useful partial results and diagnostic context on tool failure. Do not infer the cause of the 18:47 stall without further evidence.
- Keep the design simple and efficient: reuse existing lifecycle and task ownership, avoid compatibility branches, duplicate state machines, additional persistent projections or per-session polling/SQL load without demonstrated need.
Activity