Skip to content

Main & Sub-agents Randomly Freeze Indefinitely: Frontend Permanently Shows "thinking" with No Errors, While Actual LLM Inference Has Already Terminated Prematurely #24342

@xsrtyq

Description

@xsrtyq

Description

When running workflows in OpenCode, we encounter an unpredictable, randomly occurring freeze bug that is reproducible in both main-agent and sub-agent scenarios:
A completely fixed, unmodified workflow that ran 100% successfully previously will start freezing randomly without any OpenCode version updates or environment configuration changes, with no identifiable trigger point;
The freeze occurs in two scenarios: ① main-agent directly calling basic tools (write/edit/question); ② main-agent invoking sub-agents via the Task tool;
When the main-agent freezes, the workflow can be forcibly advanced by manually clicking "Continue". When a sub-agent freezes, there is no corresponding interaction entry, and the entire session must be manually interrupted;
Freezes can occur during trivial, zero-complexity operations (e.g. asking fixed-option questions via the question tool, writing short text via the write tool), and are completely unrelated to task complexity or model inference difficulty;
When frozen, the frontend permanently displays "thinking", with no error messages, no tool call outputs, and no workflow termination signal. Through link troubleshooting, we have confirmed that the LLM-side inference has been fully completed with no subsequent outputs, but the frontend state is not synchronized and remains permanently in the executing state;
The bug is reproducible even in completely fresh, blank sessions, and even after fully restarting the OpenCode process before each test, completely ruling out the impact of session context pollution and process memory leaks.

Plugins

no plugin

OpenCode version

v1.14.24

Steps to reproduce

Configure any normally executable workflow, supporting two scenarios: ① A simple workflow where the main-agent directly calls basic tools (write/question); ② A multi-stage workflow where the Orchestrator main-agent invokes sub-agents via the task() tool;
Fully quit and restart the OpenCode process, open a completely fresh, blank session with no historical dialogue or context residue;
Run the fixed workflow start command, with no changes to the workflow logic or runtime environment throughout the test;
The freeze is triggered randomly: the frontend permanently shows "thinking" with no errors or tool call outputs, the workflow is permanently interrupted, and the LLM-side inference has already terminated prematurely at this point.
In sometimes it work good,if i have two same session,they will die in different place.
This issue has an extremely high reproduction rate on the DeepSeek V4 model: it randomly triggers freezes on both main and sub-agents even in zero-reasoning-complexity scenarios where the model’s native 1M long context window is fully sufficient, with the frontend permanently displaying "thinking" without any errors, while the actual inference and output on the DeepSeek V4 side have been completely terminated.

Screenshot and/or share link

Image Image Image

Operating System

Windows11

Terminal

Windows terminal

Metadata

Metadata

Assignees

Labels

bugSomething isn't workingcoreAnything pertaining to core functionality of the application (opencode server stuff)windows

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions