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
{{ message }}
Repository navigation
POST /api/experimental/session/{id}/wait returns when execution starts, not when the session is idle #55227
After session.prompt, calling session.wait returned after 0.6–12 s in our measurements — each time right when session.execution.started / the first session.step.started was emitted, while session.execution.succeeded came
6–18 s later. If wait is meant as "until idle", this is a bug; if it means "until the inbox item is
delivered", the docs/OpenAPI description should say so.
Workaround: detect the end via session.execution.{succeeded,failed,interrupted} events plus a reconciliation
with GET /api/session/active after SSE reconnects.
Thanks for the detailed report. I couldn't reproduce this on 2.0.28.
I started opencode serve with a local mock model that streams its replies slowly and listened on GET /api/event. Then I created a session, sent POST /api/session/{id}/prompt, and called POST /api/experimental/session/{id}/wait straight away:
One slow text reply (~8 s):wait returned 204 at about 8.3 s, at session.execution.succeeded.
Three steps (two slow glob tool calls, then text):wait returned at about 16.9 s, after all three steps and session.execution.succeeded.
In both runs GET /api/session/active was empty right after wait returned. I didn't find a code path where wait resolves at execution.started.
These details would help us get closer to your setup:
How you call wait: raw HTTP, the JS SDK, or a plugin's session.wait? Does your client have a request timeout or retry?
Do you call wait only after the prompt request has returned, or at the same time?
What does the run do: which tools, any permission or question prompts, subagents? Which delivery or resume options do you pass on the prompt?
How the server runs: opencode serve, --service, or behind the TUI or desktop app? Is anything else (like the TUI) attached to the same session?
The exact event sequence with timestamps around the moment wait returns, if you can share it.
You can reply here or edit the issue. If you edit it, please also leave a comment saying you've updated it, so we know when you're done.
We haven't heard back, so I'm closing this as not planned for now.
On 2.0.28, POST /api/experimental/session/{id}/wait returned only after session.execution.succeeded, both for a single slow reply and for a run with several tool-call steps. We couldn't make it return at execution.started, so we need details of your setup to go further.
If you still see this, please reply or open a new issue with:
how you call wait (raw HTTP, SDK or plugin) and whether your client has a timeout or retries
whether you call wait before or after the prompt request returns
which tools, permission prompts or subagents the run uses
how the server is started
the timestamped event sequence around the moment wait returns
We can reopen this once we have those details. Thanks for the report!
Activity
opencode-agent commentedon Oct 13, 2026
Thanks for the detailed report. I couldn't reproduce this on 2.0.28.
I started
opencode servewith a local mock model that streams its replies slowly and listened onGET /api/event. Then I created a session, sentPOST /api/session/{id}/prompt, and calledPOST /api/experimental/session/{id}/waitstraight away:waitreturned 204 at about 8.3 s, atsession.execution.succeeded.globtool calls, then text):waitreturned at about 16.9 s, after all three steps andsession.execution.succeeded.In both runs
GET /api/session/activewas empty right afterwaitreturned. I didn't find a code path wherewaitresolves atexecution.started.These details would help us get closer to your setup:
wait: raw HTTP, the JS SDK, or a plugin'ssession.wait? Does your client have a request timeout or retry?waitonly after the prompt request has returned, or at the same time?deliveryorresumeoptions do you pass on the prompt?opencode serve,--service, or behind the TUI or desktop app? Is anything else (like the TUI) attached to the same session?waitreturns, if you can share it.You can reply here or edit the issue. If you edit it, please also leave a comment saying you've updated it, so we know when you're done.
opencode-agent commentedon Oct 16, 2026
We haven't heard back, so I'm closing this as not planned for now.
On 2.0.28,
POST /api/experimental/session/{id}/waitreturned only aftersession.execution.succeeded, both for a single slow reply and for a run with several tool-call steps. We couldn't make it return atexecution.started, so we need details of your setup to go further.If you still see this, please reply or open a new issue with:
wait(raw HTTP, SDK or plugin) and whether your client has a timeout or retrieswaitbefore or after the prompt request returnswaitreturnsWe can reopen this once we have those details. Thanks for the report!