anomalyco / anomalyco/opencode
Agent terminates/stops prematurely mid-task without explicit error [v1.18.20]
Open
@kitlangton is already working on this.
Since Aug 22, 2026.
- Dominant language
- TypeScript
- Stars
- 209k
- Forks
- 27.5k
- PR merge metrics
- PR metrics pending
Description
Description
OpenCode agent stops prematurely during long-running tasks, without any error message. The session may display "Task completed" or exit silently, but the actual goal is not achieved. This occurs frequently when the agent is performing multiple tool calls, during context compaction, or after a subagent returns. No explicit error is shown in the console. This issue has been reported in several earlier versions and appears to persist in v1.18.20.
Plugins
No custom plugins installed.
OpenCode version
1.18.20
Steps to reproduce
- Start OpenCode with a goal that involves multiple steps (e.g., a multi‑turn analysis or a task requiring several tool calls and context processing).
- Allow the agent to execute; observe it performing actions, possibly triggering context compaction.
- Notice that the agent stops before the goal is reached – often after a compaction cycle or after a subagent call.
- The session ends without any error message; the console may show "Task completed" even though the work is unfinished.
Screenshot and/or share link
N/A – no screenshot available
Operating System
Ubuntu 26.04
Terminal
bash
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.