Repository navigation
Description
Description
I run OpenCode over ACP from a third-party IDE client (the AgentBridge plugin for IntelliJ). On client startup the normal flow completes the initialize handshake and then immediately sends session/resume for an existing session. Roughly one in six of these resume attempts fails with:
{"code":-32603, "message":"Internal error: Internal service failure: {\"errorName\":\"ServiceUnavailableError\"}"}The server log shows the underlying cause:
level=ERROR message="ACP request failed" cause="ServiceUnavailableError: Location plugins did not finish activating"
at cli.acp.session.resume
Retrying the same session/resume a few seconds later succeeds, so the session exists and is healthy; the failure is purely a startup race. I counted nine occurrences over four days, always within the first seconds after process start, and today one of six resume attempts failed this way while the other five succeeded.
Because initialize responds immediately and advertises sessionCapabilities.resume, the client has no signal to wait and no way to distinguish this from a real service failure, so the only safe fallback is a fresh session, which silently drops the conversation context.
In packages/cli/src/acp/service.ts on v2.0.32, resumeSession goes straight to getSession and ACPDirectories.activate with no wait for Location plugin activation. The catalog path already solved this in #46682 with an activation wait (POST /api/plugin/await-activation) before ACP's first catalog read; the resume path appears to lack the same barrier.
Plugins
No response
OpenCode version
v2.0.32
Steps to reproduce
- Start
opencode acpin a project directory where Location activation takes a moment. A large home directory widens the window considerably; the global location watcher that subscribes to all of$HOME(core: global location watcher subscribes to all of $HOME — 2M+ file home dirs starve the event loop (~900% CPU, multi-GB memory), /api/model 503 #55937) makes the race quite reliable on my machine. - Send
initialize, and immediately after the response sendsession/resumewith thesessionIdof an existing session and the projectcwd. - Some attempts fail with the error above; the identical request sent a few seconds later succeeds.
Expected: session/resume should wait for Location plugin activation before its first directory-scoped read, the same way the catalog path does after #46682, so a resume arriving right after initialize either blocks briefly and succeeds, or returns an error a client can distinguish and retry.
Screenshot
No response
Operating System
Windows 11
Terminal
Not applicable, running over ACP from the AgentBridge plugin in IntelliJ
Activity
opencode-agent commentedon Oct 19, 2026
Thanks for the detailed report. I can reproduce this on
v2.0.32, and it still happens on the latestdev(6bac3b9).To stand in for slow Location activation, I used a test project with a local plugin whose setup sleeps 15 seconds. Then I started
opencode acp, sentinitialize, and sentsession/resumefor an existing session right away. After about 10 seconds the resume failed with-32603 Internal service failure/ServiceUnavailableError. The same resume in a process without the delay succeeded at once. The script below reproduces it.One thing differs from your analysis: resume does already wait for activation, because attaching the session loads the ACP catalog. But that wait gives up after 5 seconds of polling
plugin.list, and thenmodel.listgives up after another 5 seconds on the server, which produces "Location plugins did not finish activating". So any activation longer than about 10 seconds (which a large$HOME, as in #55937, could easily cause) makes resume fail with an error your client can't tell apart from a real failure. With an 8-second delay, the resume blocked and then succeeded.session/newandsession/loadgo through the same catalog load, so they are probably affected too.Related: #53358 (the activation wait before ACP's first catalog read) and #55937 (the
$HOME-wide watcher that slows activation).Reproduction script (repro.py)
Run it:
python3 repro.pyRaviTharuma commentedon Oct 21, 2026
Another data point on 2.1.2 (npm
@opencode/cli, Linux x64), withsession/newon a freshopencode acpprocess and no artificial plugin delays.session/newfails at about 10s with-32603/ServiceUnavailableError("Location plugins did not finish activating").session/new3s later succeeds (about 16–17s afterinitializein total). Delaying the first request doesn't help, because the private server only starts on the first request.opencode acpon demand fails the first message after every spawn.session/new/load/resumeon that exact error.#57237 would fix it for us if the bounded readiness wait covers about 20s. A way to pin a longer activation wait, or to let
opencode acpuse the running background service instead of a private server, would also avoid it.