Skip to content

fix(tool): trigger fallback on empty task output - #29048

Closed
niStee wants to merge 1 commit into
anomalyco:devfrom
niStee:fix/trigger-fallback-on-empty-task-output
Closed

niStee wants to merge 1 commit into
anomalyco:devfrom
niStee:fix/trigger-fallback-on-empty-task-output

Conversation

@niStee

@niStee niStee commented May 23, 2026 •

Copy link
Copy Markdown

Issue for this PR

Closes #29054
Closes #24447

Type of change

  • Bug fix
  • New feature
  • Refactor / code improvement
  • Documentation

What does this PR do?

Hardens TaskTool serialization when a child task result has no usable text output:

  • Returns the latest non-empty text part when one is available.
  • Returns a diagnostic string for legitimate tool-only completions (finish === "tool-calls" or tool parts present), so successful tool work is not misclassified as a failed task.
  • Throws a descriptive error only for truly silent outputs with no text and no tool evidence, allowing downstream fallback to catch likely rate-limit, empty-response, or silent-failure cases.

How did you verify your code works?

Tested locally with text-output, tool-call/tool-only, and truly silent child task results:

  • bun test test/tool/task.test.ts
  • bun typecheck from packages/opencode

Screenshots / recordings

N/A, no UI change.

Checklist

  • I have tested my changes locally
  • I have not included unrelated changes in this PR

@github-actions github-actions Bot added needs:compliance This means the issue will auto-close after 2 hours. needs:issue labels May 23, 2026
@github-actions

Copy link
Copy Markdown
Contributor

Thanks for your contribution!

This PR doesn't have a linked issue. All PRs must reference an existing issue.

Please:

  1. Open an issue describing the bug/feature (if one doesn't exist)
  2. Add Fixes #<number> or Closes #<number> to this PR description

See CONTRIBUTING.md for details.

@niStee
niStee force-pushed the fix/trigger-fallback-on-empty-task-output branch from 431f76b to 723f91c Compare May 24, 2026 01:35
@github-actions github-actions Bot removed needs:issue needs:compliance This means the issue will auto-close after 2 hours. labels May 24, 2026
@github-actions

Copy link
Copy Markdown
Contributor

Thanks for updating your PR! It now meets our contributing guidelines. 👍

@niStee

niStee commented May 27, 2026

Copy link
Copy Markdown
Author

Closes #24447 as well.

@niStee
niStee force-pushed the fix/trigger-fallback-on-empty-task-output branch from 43bc77a to efae255 Compare June 5, 2026 13:25
@niStee

niStee commented Jun 5, 2026

Copy link
Copy Markdown
Author

Force-updated from current dev with hybrid TaskTool empty-output handling. Latest non-empty text still returns, legitimate tool-call/tool-only child runs return a diagnostic, and truly silent empty outputs still fail so fallback can catch them. Local verification: bun test test/tool/task.test.ts; bun typecheck from packages/opencode.

@github-actions

Copy link
Copy Markdown
Contributor

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:

  • The PR was created more than 1 month ago
  • The PR had fewer than 2 positive reactions
  • Positive reactions are counted as thumbs-up, heart, celebration, or rocket reactions on the PR

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Bug: Empty task output breaks fallback system TaskTool returns no diagnostic context when subagent result text is empty or missing

1 participant