You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Task tool output can be truncated after it appends <task_metadata>. When output is large, the metadata block is removed, so callers cannot reuse session_id and a new subagent is spawned.
Steps to reproduce
Call the task tool with a prompt that produces output exceeding truncation limits (e.g., >2000 lines or >50KB).
Inspect the tool output. It ends with the truncation notice, but the <task_metadata> block is missing.
Attempt to resume the same subagent: no session_id is available, so a new subagent is started.
Expected
The <task_metadata> block (including session_id) is always present, even when output is truncated.
Actual
Metadata is truncated away.
Root cause
Tool.define truncates tool output after execution. The task tool appends <task_metadata> before the wrapper truncates, so the metadata can be removed.
Proposed fix
Apply truncation to the task tool output before appending metadata, or mark the output as already truncated so the wrapper does not truncate, then append <task_metadata>.
Activity
github-actions commentedon Feb 3, 2026
This issue might be a duplicate of existing issues. Please check:
Feel free to ignore if none of these address your specific case.
github-actions commentedon Apr 5, 2026
To stay organized issues are automatically closed after 90 days of no activity. If the issue is still relevant please open a new one.