Repository navigation
feat(task-tool): emit diagnostic when subagent returns no text part (#24447) - #28021
PeterPonyu wants to merge 1 commit into
Conversation
…nomalyco#24447) When a subagent session completes without producing any text part, the parent now receives a structured diagnostic block instead of a silent empty <task_result>. The block includes the finish reason, any error details, and the list of part types actually produced, making it straightforward to distinguish an intentional empty reply (text part present but empty) from a missing-text-part scenario. Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
|
This is an interesting approach! Just out of curiosity, how does returning a diagnostic string here interact with the |
|
Automated PR Cleanup Thank you for contributing to opencode. Due to the high volume of PRs from users and AI agents, we periodically close older PRs using automated criteria so maintainers can focus review time on the most active and community-supported contributions. This PR was closed because it matched the following cleanup criteria:
PRs created within the last month are not affected by this cleanup. If you believe this PR was closed incorrectly, or if you are still actively working on it, please leave a comment explaining why it should be reopened. A maintainer can review and reopen it if appropriate. Thanks again for taking the time to contribute. |
Issue for this PR
Closes #24447
Type of change
What does this PR do?
The task tool previously returned an empty
<task_result>when a subagent response had no text part, which made missing output indistinguishable from an intentionally empty response.This PR preserves intentionally empty text parts, but emits a short diagnostic when no text part exists. The diagnostic includes the finish reason, error if present, and the part types returned by the subagent. Regression tests cover text output, intentionally empty text, and missing text parts.
This replaces auto-closed PR #27888 with a template-compliant PR body.
How did you verify your code works?
From
packages/opencode:bun test test/tool/task.test.ts— 18 passed, 0 failedbun typecheck— passedScreenshots / recordings
N/A — runtime-only task tool serialization change.
Checklist