anomalyco / anomalyco/opencode

Agent terminates/stops prematurely mid-task without explicit error [v1.18.20]

Open
#44,146 1 comment 0 reactions 1 assignee View on GitHub

@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
  1. 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).
  2. Allow the agent to execute; observe it performing actions, possibly triggering context compaction.
  3. Notice that the agent stops before the goal is reached – often after a compaction cycle or after a subagent call.
  4. 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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.