fix(opencode): fail task on empty subagent output#29239
Conversation
|
The following comment was made by an LLM, it may be inaccurate: Found a potentially related PR: PR #29048: fix(tool): trigger fallback on empty task output Why it might be related: This PR directly addresses the same issue (triggering fallback on empty task output) and is likely addressing the same GitHub issue #29054. Both PRs are focused on handling empty task outputs to prevent successful task states when no meaningful result exists. |
|
Thanks for the duplicate check. This is closely related to #29048. The implementation is intentionally small in the same code path, but this PR also adds regression coverage in If maintainers prefer #29048, this can be closed, but this PR keeps the same behavior test-covered and verified with the package task tests and typecheck. |
Issue for this PR
Closes #29054
Type of change
What does this PR do?
The task tool previously treated a subagent response with no meaningful text as a successful empty
<task_result>. That made upstream fallback/retry logic see the task as successful even though there was no usable result.This changes
TaskTool.runTaskto fail when the subagent returns no text output or only whitespace, while preserving the original non-empty text for successful task results. Background tasks now naturally record this case as an error through the existing background error path.How did you verify your code works?
bun test test/tool/task.test.ts -t "execute fails when the subagent returns empty text output"frompackages/opencodebun test test/tool/task.test.tsfrompackages/opencodebun typecheckfrompackages/opencodebun turbo typecheckfrom repo root.husky/pre-pushfrom repo rootScreenshots / recordings
Not applicable.
Checklist