Skip to content
Source
Sign inSign up
pingdotgg/t3code

[Bug]: unable to stop opencode agent #8998

Closedjagrat7(GitHub profile, opens in a new tab) opened this issue 4 comments

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

  1. jagrat7(GitHub profile, opens in a new tab) added labelsneeds-triage

  2. Image

    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.

  3. Verified on stable appimage from AUR.

  4. 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.stop

    sent to:

    POST /api/orchestration/dispatch

    with 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 dispatching thread.session.stop for 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:

    1. verifies the local T3 backend at http://127.0.0.1:3773;
    2. uses T3’s own packaged server CLI to issue a short-lived local bearer session;
    3. verifies the target thread exists;
    4. POSTs thread.session.stop for only that thread;
    5. 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 $Payload

    A successful response is:

    {"sequence":123456}

    and the stuck Working state 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.stop

    would 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.

  5. 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.

Sign in to join this conversation.