Subagent terminated mid-task (budget/context) is reported to parent as "completed" — silent truncation

Open 💬 0 comments Opened Jul 2, 2026 by discorder256

Version: 2.1.198 (Claude Code CLI, Linux/WSL2)

Summary: A subagent whose loop is terminated by the harness mid-task (context/tool-use budget; its last turn ends with stop_reason tool_use right after a tool result, i.e. NOT a natural end_turn) is reported back to the parent as completed. The deliverable is missing, but the parent receives a normal completion with no truncation marker.

Repro (toy):

  1. Spawn a subagent instructed to fully read several large files (enough to balloon its context — e.g. 3-4 files of 1-2k lines each) and THEN write a summary file as its final step.
  2. With sufficiently large inputs the agent loop ends around ~18-20 tool uses, before the final write.
  3. Observe: parent receives a "completed" result; the summary file does not exist; the subagent's final message is a mid-work fragment.

Expected: an explicit terminal status distinguishing "completed" from "terminated early / budget exhausted" (e.g. surface the stop_reason in the tool_result), so orchestrators can resume the residual instead of trusting a false completion.

Impact: orchestrators must implement out-of-band truncation detection (report-footer contracts, artifact existence checks) to avoid trusting false completions in multi-agent workflows.

View original on GitHub ↗