ACP: a message sent to a busy session is dropped instead of queued
維護者通常 1 天內回覆
還沒有人認領這個 Issue。
評估
- 難度
- 5/5
- 預估耗時
- 一週以上
- 新手友好度
- 12/100
- Issue 類型
- 功能
- 描述清晰度
- 基本清楚
- 活躍度
- 活躍
- 技術堆疊
- typescript
- 領域
- api
研究方向
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.
由索引模型根據 Issue 內容生成。
描述
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.
- 主要語言
- TypeScript
- 星號
- 2.3k
- 分支
- 315
- 平均合併
- 3 小時 54 分鐘
- 30 天內合併 PR
- 9
環境準備
- 沒有 Dockerfile 或 Docker Compose 檔案
- 有 Pull Request 範本
- 閱讀貢獻指南
從這裡開始
- 先讀完整個 Issue,再讀專案的貢獻指南。
- 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
- Fork 儲存庫,在一個分支上完成修改。
- 送出 Pull Request,並在描述裡引用這個 Issue 編號。
MiniMax-AI/minimax-code 的其他 Issue
-
難度 2/5 1-3 小時 新手友好度 78/100
MiniMax-AI/minimax-code#639 ·
維護者通常 1 天內回覆
-
難度 2/5 1-3 小時 新手友好度 76/100
MiniMax-AI/minimax-code#636 · 1 則留言 ·
維護者通常 1 天內回覆
-
難度 2/5 1-3 小時 新手友好度 78/100
MiniMax-AI/minimax-code#615 ·
維護者通常 1 天內回覆
-
難度 2/5 1-3 小時 新手友好度 76/100
MiniMax-AI/minimax-code#556 · 4 則留言 ·
維護者通常 1 天內回覆
-
難度 2/5 1-3 小時 新手友好度 78/100
MiniMax-AI/minimax-code#507 ·
維護者通常 1 天內回覆
查看 MiniMax-AI/minimax-code 的全部 Issue
相似的 Issue
-
[Bug]: A Markdown link with both a :line suffix and a #L fragment opens a path containing ":line"未關閉
難度 2/5 1-3 小時 新手友好度 82/100
維護者通常 1 天內回覆
-
status:needs-triage type:bug workstream:refimpl
難度 2/5 1-3 小時 新手友好度 76/100
GenAI-Security-Project/agent-control-standard#764 ·
維護者通常 1 天內回覆
-
good first issue
難度 2/5 1-3 小時 新手友好度 85/100
TanbirRamim/vibereel#39 ·
-
難度 2/5 1-3 小時 新手友好度 76/100
-
community first-timers-only good first issue hacktoberfest help wanted low hanging fruit up-for-grabs
難度 1/5 1 小時以內 新手友好度 72/100
lingdojo/kana-dojo#34988 · 1 則留言 · 5 個 reaction ·
維護者通常 1 天內回覆