fix(acp): accept concurrent prompts while session is busy - #2290
Open
shuxueshuxue wants to merge 1 commit into
Open
shuxueshuxue wants to merge 1 commit into
shuxueshuxue wants to merge 1 commit into
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
The ACP client can send a second
session/promptwhile a tool is running. In v0.1.13,packages/opencode/src/server/routes/instance/session.tsrejects the request withSessionRunState.assertNotBusy(HTTP 409). The ACP SDK caller does not surface that 409 as an error, so the prompt becomes a silent no-op.The opencode v1.18.16 handler accepts the prompt and delegates to
promptSvc.prompt; itsRunner.ensureRunningpreserves ordering and merges the new user message into the active runner.Fix
Remove only the
/messageroute pre-check. KeepRunner.ensureRunningunchanged so concurrent prompts are serialized by the existing runner and are available to the next tool boundary.Evidence
Using an isolated ACP probe with a deterministic OpenAI-compatible SSE endpoint and four sequential
bashtool calls:end_turn(B/B').MARKER_A_1andMARKER_B_2together produced both markers in request 4+, ordered A-before-B. Sending only A produced A=true/B=false, proving the detector.A prior attempt to transplant opencode
runUntilIdlewas insufficient: it delayed ACP response completion but could not recover a prompt already rejected by this route gate.The ACP client should also surface HTTP 409 responses instead of resolving them as an empty success; that is tracked separately in downstream issue #4489.