[Bug]: unable to stop opencode agent #8998
Before submitting#
- I searched existing issues and did not find a duplicate.
- I included enough detail to reproduce or investigate the problem.
Area#
apps/desktop
Steps to reproduce#
Ask opencode agent to use a skill some how in your prompt
Expected behavior#
the thread stops when i hit stop
Actual behavior#
the thread doesnt stop when i hit stop, have to message it to stop and it sometimes stops it. It did mention some tool calls failing but its hard to tell whats happening as it just says thinking...
Impact#
Blocks work completely
Version or commit#
nightly LTS
Environment#
Omarchy - opencode is installed via mise
Logs or stack traces#
Screenshots, recordings, or supporting files#
screenrecording-2026-08-31_22-36-05.mp4 screenshot-2026-08-21_17-03-39.png
Workaround#
No response
jagrat7(GitHub profile, opens in a new tab) added labelsbug
jagrat7(GitHub profile, opens in a new tab) added labelsneeds-triage
Verified on stable appimage from AUR.
same problem, can't stop opencode threads, they hang running certain operations. Driving me insane at this point.
i did find a workaround poking chatgpt and got a script that stops it for me, not sure if its correct or better ways to do it, but this stopped the thread for me, just provide a thread ID
Workaround: force-stop only the stuck T3 thread through T3’s orchestration API
I found a reliable workaround that does not require restarting T3, killing OpenCode, or touching any other running agent.
The important bit is that T3 already has a thread-scoped command:
thread.session.stopsent to:
POST /api/orchestration/dispatchwith a payload like:
{ "type": "thread.session.stop", "commandId": "<uuid>", "threadId": "<stuck-thread-uuid>", "createdAt": "<current ISO timestamp>" }In my case, the normal red Stop button leaves the thread stuck on
Thinking/Working, but dispatchingthread.session.stopfor that exact thread immediately clears it.I have multiple T3/OpenCode agents running concurrently, so process-level workarounds are not acceptable. This method has been safe because it targets only the stuck T3 thread ID.
On Windows Nightly, I made a small PowerShell wrapper that:
- verifies the local T3 backend at
http://127.0.0.1:3773; - uses T3’s own packaged server CLI to issue a short-lived local bearer session;
- verifies the target thread exists;
- POSTs
thread.session.stopfor only that thread; - revokes the temporary credential afterward.
The actual stop portion is effectively:
$ThreadId = "<stuck-thread-id>" $Payload = @{ type = "thread.session.stop" commandId = [Guid]::NewGuid().ToString() threadId = $ThreadId createdAt = [DateTimeOffset]::UtcNow.ToString("yyyy-MM-ddTHH:mm:ss.fffZ") } | ConvertTo-Json -Compress Invoke-RestMethod ` -Uri "http://127.0.0.1:3773/api/orchestration/dispatch" ` -Headers @{ Authorization = "Bearer $Token" } ` -Method Post ` -ContentType "application/json" ` -Body $PayloadA successful response is:
{"sequence":123456}and the stuck
Workingstate clears.I turned this into a reusable command:
t3stop <thread-uuid>which only force-stops that specific T3 thread.
This feels important because it shows the backend already has a reliable recovery primitive; the bug appears to be that the normal Stop/interrupt path does not always reach the same terminal session state.
A built-in fallback such as:
Stop ↓ interrupt turn ↓ if still running after timeout ↓ thread.session.stopwould likely solve the user-facing deadlock without requiring a T3 restart or provider process kill.
I’d also add one sentence making the impact explicit:
This has now happened repeatedly across unrelated threads on Nightly, including after completed-looking tool calls such as
Ran node, and it makes concurrent-agent use unreliable because restarting T3 would disrupt unrelated work.- verifies the local T3 backend at
Note
🤖 GPT-6 Astra (preview) responding on behalf of Theo
This was closed as part of an automated cleanup pass. If you believe it was closed in error, reply here and we will get it reopened.
Closing this as a duplicate of #4795, which tracks the missing OpenCode skill approval prompt and resulting hang. Your confirmation and recording are recorded there. The separate Stop versus session-stop observation is recorded on #8802 without assuming every stuck thread has the same cause. Both bugs remain open.
t3dotgg(GitHub profile, opens in a new tab) closed this
Sign in to join this conversation.
Update, the issue is that it is not surfacing approval requests for tool calls to the UI, verified by using the opencode desktop app for the same thread.