Fix reasoning-only replies and TODO continuation loops #7201
+335
−6
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
This PR fixes two user-facing regressions observed in OpenCode sessions:
What changed
1) Final-response fallback for reasoning/tool-only replies
finalagent with tools disabled.2) TODO continuation loop guard
todo_statetracking (paused/updatedAt/lastUpdatedMessageID).todowriteupdates and injects a short system guard when paused.3) Supporting updates
test.concurrent(not supported by Bun).Files touched (high level)
packages/opencode/src/session/prompt.tspackages/opencode/src/session/llm.tspackages/opencode/src/session/todo.tspackages/opencode/src/tool/todo.tspackages/opencode/src/agent/agent.tspackages/opencode/src/agent/prompt/final.txtpackages/opencode/test/session/retry.test.tsdocs/changes-2026-01-07.mddocs/reasoning-only-fallback-plan.mddocs/todo-loop-guard.mdTests
bun test(packages/opencode)bun turbo typecheck(pre-push hook)Notes
finalagent with tools disabled to avoid recursive tool calls.