ACP: a message sent to a busy session is dropped instead of queued
Maintainer antworten meist innerhalb von 1 Tag
Dieses Issue hat noch niemand übernommen.
Bewertung
- Schwierigkeit
- 5/5
- Geschätzter Aufwand
- Über eine Woche
- Anfängerfreundlichkeit
- 12/100
- Issue-Typ
- Feature
- Klarheit
- Größtenteils klar
- Aktivitätsstatus
- Aktiv
- Tech-Stack
- typescript
- Bereich
- api
Rechercherichtung
Start by reproducing the five-step sequence in the issue over raw JSON-RPC on stdio: a session/prompt during a running turn, then the mcode/session/queue/enqueue calls with the same clientRequestId. Compare the two busy error texts and the itemId values returned. The issue asks for three contract decisions (a stable busy error code, idempotent enqueue, and an observable fate for queued items), so this needs maintainer agreement on the design before code changes.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Beschreibung
Product or interface
CLI - ACP
Use case and problem
A third-party ACP client that talks to mcode acp cannot deliver a message to a session that is already running a turn. The client sends session/prompt and the adapter rejects it:
-32602 A prompt is already active for this session.
-32603 Session already has an active Turn. Use queue send to deliver the message after it.
Both texts are seen in practice, for the same condition, so a client cannot rely on one of them.
The message is neither queued nor delivered: the client sees an error, and the text the user typed is gone. This is not a corner case — a parent agent that is notified that its sub-agent finished while the parent's own turn is still running hits it every time.
The machinery already exists. The TUI queues messages typed during a run, and the ACP adapter exposes the same capability as a vendor extension:
"_meta": { "minimax-code/extensions": { "methods": [
"mcode/session/steer",
"mcode/session/queue/list", "mcode/session/queue/enqueue",
"mcode/session/queue/update", "mcode/session/queue/delete", "mcode/session/queue/steer"
] } }
The problem is that the standard protocol has no way to express any of it:
session/prompthas no "queue this" disposition, and the ACP schema'spromptCapabilitiescarries onlyimage,audioandembeddedContext, soinitializecannot tell a client that queueing exists.- The error text points at "queue send" without naming a callable method, and it differs between the two busy responses.
- A client that does not read the vendor
_metablock has to guess the method name. Most do not.
Measured behaviour today
Measured against mcode 0.7.3 over raw JSON-RPC on stdio:
mcode/session/queue/enqueueaccepts{sessionId, text, clientRequestId?}and answers{itemId, status: "queued", position}.- A queued message runs as its own turn right after the current one. The queue empties, and the model call for the queued message shows up in
usage_update. - The answer to a queued message never arrives in
session/update. During a 78 s observation after the current turn ended, noagent_message_chunkcarried the expected reply — onlysession_info_updateandusage_update. A client therefore cannot learn the result of a queued message through the standard channel. clientRequestIddoes not dedupe: twoenqueuecalls with the sameclientRequestIdand the same text produced two differentitemIdvalues and two entries inqueue/list. The field is accepted and then ignored.mcode/session/queue/updateis never emitted, so a client learns about queue changes only by pollingqueue/list.mcode/session/queue/deleteremoves an entry while its status isqueued; once the entry left that state the call is not editable and the element is reported as not found.
Minimal reproduction (no real paths or identifiers):
1. initialize
2. session/new -> sessionId
3. session/prompt { sessionId, prompt: [text "run: sleep 15"] } (do not wait)
4. session/prompt { sessionId, prompt: [text "SECOND"] }
-> error -32603 "Session already has an active Turn. Use queue send to deliver the message after it."
5. mcode/session/queue/enqueue { sessionId, text: "SECOND", clientRequestId: "x" }
-> { itemId: "queue_…", status: "queued", position: 1 }
6. mcode/session/queue/enqueue { sessionId, text: "SECOND", clientRequestId: "x" }
-> { itemId: "queue_…different…", status: "queued", position: 2 } // same key, two entries
Desired behavior
Three contract points would make this interoperable. Each one is about the contract, not about the implementation.
-
A machine-readable busy signal. The busy condition should be distinguishable from an invalid request and from an internal error by a stable code or a field in the error
data, and it should be the same for both busy texts. A client should be able to branch on it without parsing prose. -
Idempotent enqueue. The same
(sessionId, clientRequestId)should return the sameitemId, and the same key with different content should be a conflict. Without this, a client that retries after a lost acknowledgement cannot avoid delivering the message twice. -
An observable fate for a queued item. The client should learn that an item was accepted, when it started, and how it ended (finished, failed, cancelled) — with the
itemId, and tied to the turn that produced it and to its answer. The state must survive a reconnect. An item disappearing fromqueue/listis not proof that it ran, and its answer not arriving insession/updateleaves the client with no result at all.
Acceptance criteria
- A
session/promptthat arrives during a running turn is either queued, or rejected with an error whose busy condition is machine-readable and names the callable extension method. It is never silently dropped. - With idempotent enqueue, a repeated
(sessionId, clientRequestId)returns the sameitemId; a repeated key with different content is a conflict. - The client can learn the outcome of a queued message — its answer and its terminal state — through the standard notification channel or through a documented extension notification, including after a reconnect.
- Queued messages stay visible through
mcode/session/queue/listand can be removed withmcode/session/queue/deletewhile they have not started, consistent with the existing extension contract.
Platform
Multiple platforms
Alternatives and additional context
- Queuing every busy
session/promptautomatically would change ACP semantics, so it is better left opt-in: either an agreed opt-in behaviour, or the structured busy signal plus a documented enqueue method, and let the client decide. - Steering via
mcode/session/steerworks for clients that read the vendor extension, but the ACP schema has no capability to advertise it, so a client has to hard-code provider-specific knowledge. - The client side of this problem is tracked in the Paseo repository: https://github.com/getpaseo/paseo/issues/8300 and https://github.com/getpaseo/paseo/discussions/8301 — they look at queuing messages on the client side, but a client-side queue cannot help when the client does not own the turn.
- Related open issues in this repository: #295 (parallel queued tasks in the interactive TUI), #335 (separating mid-run steer/queue messages in Goal mode). This request is about the ACP surface specifically, not the TUI.
- Vorherrschende Sprache
- TypeScript
- Sterne
- 2.3k
- Forks
- 315
- Ø Merge
- 3 Std. 54 Min.
- Gemergte PRs (30 T.)
- 9
Entwicklungsumgebung
- Kein Dockerfile und keine Docker-Compose-Datei
- Hat eine Pull-Request-Vorlage
- Beitragsleitfaden lesen
Erste Schritte
- Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
- Forken Sie das Repository und arbeiten Sie in einem Branch.
- Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.
Mehr aus MiniMax-AI/minimax-code
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 78/100
MiniMax-AI/minimax-code#639 ·
Maintainer antworten meist innerhalb von 1 Tag
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 76/100
MiniMax-AI/minimax-code#636 · 1 Kommentar ·
Maintainer antworten meist innerhalb von 1 Tag
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 78/100
MiniMax-AI/minimax-code#615 ·
Maintainer antworten meist innerhalb von 1 Tag
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 76/100
MiniMax-AI/minimax-code#556 · 4 Kommentare ·
Maintainer antworten meist innerhalb von 1 Tag
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 78/100
MiniMax-AI/minimax-code#507 ·
Maintainer antworten meist innerhalb von 1 Tag
Alle Issues in MiniMax-AI/minimax-code
Ähnliche Issues
-
blocklist addition
Schwierigkeit 1/5 Unter einer Stunde Anfängerfreundlichkeit 76/100
MetaMask/eth-phishing-detect#319194 ·
Maintainer antworten meist innerhalb von 1 Tag
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 68/100
continuedev/continue#13533 · 1 Kommentar ·
Maintainer antworten meist innerhalb von 6 Tagen
-
bug codex:automation
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 76/100
genfeedai/genfeed.ai#12060 ·
Maintainer antworten meist innerhalb von 1 Tag
-
bounty good first issue help wanted
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 78/100
fitzss/valun-open#15 · 1 Kommentar ·
Maintainer antworten meist innerhalb von 1 Tag
-
bug
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 78/100
Maintainer antworten meist innerhalb von 1 Tag