ACP: a message sent to a busy session is dropped instead of queued
メンテナーはふだん 1 日以内に返信
まだ誰も着手していません。
評価
- 難易度
- 5/5
- 見積もり時間
- 1週間以上
- 初心者へのやさしさ
- 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分
- マージ済み PR(30日)
- 9
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートあり
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- 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
-
area:api bug good first issue priority:high
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
Doezer/Questarr#1486 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
area:import difficulty:good-first good first issue help wanted priority:P1 roadmap size:S type:test
難易度 2/5 1〜3時間 初心者へのやさしさ 88/100
Sergey-Bar/Penny#245 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
mihazs/lazysh#3377 · コメント 2 件 ·
メンテナーはふだん 1 日以内に返信
-
Approve the Cloudflare agent plugin for harness sessions対応中かも @joshtsch が今日担当しました。 オープンenhancement ready-for-agent
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
メンテナーはふだん 1 日以内に返信