You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When a tool call is cut mid-stream (provider emits tool-input-start without a complete tool-call then drops the connection), the agent loop silently exits without answering the prompt.
Repro:
Mock OpenAI-compatible provider that streams a tool announcement with incomplete arguments then cuts mid-stream
opencode retries; retried request completes with empty finish: "stop"
WARN loop exit with orphaned interrupted tool session.id=ses_... messageID=msg_... tool=read callID=call_orphan_1
INFO exiting loop session.id=ses_...
Persisted assistant message has no text, zero tokens, time.start == time.end. Prompt stays unanswered, no error surfaced, interrupted tool never fed back as tool_result so model cannot self-correct.
Root cause:
packages/opencode/src/session/processor.ts:cleanup() force-marks abandoned tool as interrupted:true
Expected:
Treat interrupted:true as recoverable tool error: feed Tool execution aborted — please retry with complete arguments back as tool_result and retry (with limit), or after retries emit a user-visible assistant error. Never exit silently with zero tokens.
Also seen: short sessions (83 parts / 113k tokens) and stealth/oxalpha + muse-spark families; also step-finish reason:unknown with zero tokens after Service Unavailable on retry — same silent-exit family.
Verified on:opencode 1.18.21 Linux (and 1.3.13 macOS)
Observe WARN loop exit with orphaned interrupted tool + INFO exiting loop and persisted Tool execution aborted part with no assistant text; re-prompting continue still exits silently
OS: Linux (repro verified on 1.18.21), also macOS 15.x darwin
Terminal: via opencode serve HTTP API (zsh / iTerm2)
Plugins: any MCP tool (repro uses generic read)
Activity
sujalmh commentedon Aug 22, 2026
tool-input-startwithout completetool-callthen cuts connection mid-streamopencode.jsonprovider to point to the mock and driveopencode servevia HTTP API with a prompt that triggers a toolopencoderetries → retry returns emptyfinish: "stop"WARN loop exit with orphaned interrupted tool+INFO exiting loopand persistedTool execution abortedpart with no assistant text; re-promptingcontinuestill exits silentlysujalmh commentedon Aug 22, 2026
OS: Linux (repro verified on 1.18.21), also macOS 15.x darwin
Terminal: via opencode serve HTTP API (zsh / iTerm2)
Plugins: any MCP tool (repro uses generic read)
github-actions commentedon Aug 22, 2026
This issue might be a duplicate of existing issues. Please check:
thdxr commentedon Oct 11, 2026
Thanks for the report! OpenCode 2.0 is now out and development is focused on V2, so we're closing issues filed against OpenCode 1. Please upgrade (
opencode upgrade --major, details: https://anoma.ly/notes/opencode-2-0), and if this is still relevant on 2.0, reopen this issue or open a new one with your 2.0 version.— from 𝕺𝖕𝖊𝖓𝕮𝖔𝖉𝖊