anomalyco / anomalyco/opencode
Tool execution aborted/terminated — opencode closes chat without waiting for LLM response
@jlongster is already working on this.
Since Jul 25, 2026.
- Dominant language
- TypeScript
- Stars
- 209k
- Forks
- 27.5k
- PR merge metrics
- PR metrics pending
Description
Description
Environment:
- OpenCode v1.18.5 (native binary)
- Provider: LM Studio (
@ai-sdk/openai-compatible) - Model:
agents-a1-apex(also reproduced withqwen3.6-35b-a3b) - OS: Windows
Description: During tool execution with local models, opencode closes the chat session without waiting for the LLM to respond. The assistant message is created but never completed — the user sees "Tool execution aborted/terminated" with UnknownError: terminated. Manual "Continue" or starting a new session is required.
Concrete example from production (session ses_12b1b8c0effeS5yD1QNJsmy6IW, project Ritm):
Duration before abort: ~335 seconds (5.6 min). The assistant message was created but never produced any output — the LLM call was terminated before it could respond.
Root cause (from source code analysis):
llm.ts—AbortControllercreated insideStream.scoped,ctrl.abort()fires when the stream scope closesprocessor.ts—cleanup()waits only 250ms for pending tools, then marks them as"Tool execution aborted"- The fix (PR #34952 by @Mte90) was to emit
turn.idleonly when bothactiveandctrlare undefined
Fix status: PR #34952 was closed on Jul 22, 2026 without merge — the author deleted his branch, no reviews received, commits are inaccessible. No release up to v1.18.5 includes the fix.
Plugins
No response
OpenCode version
v1.18.5
Steps to reproduce
Reproduction:
Run opencode with LM Studio and any local model
Give a task requiring tool calls
After 2–3 tool executions, the agent does not receive the LLM response
opencode closes the chat with "Tool execution aborted/terminated"
Only workaround: click "Continue" manually or restart the session
Expected behavior: Tool execution should complete without interruption when using local models. The chat must remain open and wait for the LLM response.
Screenshot and/or share link
Operating System
OS: Windows
Terminal
OpenCode v1.18.5 (native binary)
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.