Repository navigation
chat: messages sent while a turn runs wait in a queue - #11
Merged
Merged
Conversation
foxnne
marked this pull request as ready for review
October 16, 2026 14:53
foxnne
added this pull request to stack #13
October 16, 2026 14:53
While a turn ran, Enter did nothing: the chat only sent when idle, and the ACP client drops a prompt that arrives mid-turn (`session/prompt` is one turn at a time). Now Enter, while busy, puts the message (and what was attached) in a queue shown above the message box, each with an x to take it off. When the turn ends, the queue goes as one message, its texts in order. Stop puts the queue back in the message box rather than sending it. The chat keeps the queue, not a client, so it works the same for every client; it is sent from the plugin's `beginFrame`, never from inside a client's `chat.set_busy` call. The Sample client now holds its turn busy until its question is answered (or Stop), as an agent waits on a permission, so the queue can be seen without an agent.
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.
Stacked on #10.
While a turn ran there was no way to send anything. The view only sent when idle. The ACP client also returns early from
chat_sendwhileprompting, since ACP'ssession/promptis one turn at a time: it answers when the turn is over, and a second prompt has to wait for it.Now, while a turn runs:
+Nfor attached files, and an x to take it off. The placeholder says "Queue a message for when this turn ends".chat.set_busywithfalse), the queue goes as the next message: one person message, the queued texts in order separated by blank lines, all their attachments. That's what someone who kept typing would have sent, and it is onechat_send, so one prompt.The chat keeps the queue (
Chat.queued), not a client, so every client the chat serves gets it the same way, with no contract change. It's sent from the plugin'sbeginFrame, so never from inside a client's ownchat.set_busycall.The Sample client (Debug only) now goes busy for its reply and stays busy until its last question is answered or Stop is pressed (new
sample.chat_cancel), the way an agent waits on a permission. That lets the queue be seen with no agent running.Seen
macOS, sandbox profile, driven by demo tapes against the Sample client, captured:
First queued message\n\nThird), the Sample answered it, the queue is empty, and the next turn is busy again.Not run against a real ACP agent (not used here, as it costs and needs auth). The ACP path is the same
chat_sendonce the turn has ended (setBusy(false)comes afterstate = .ready).zig fmt --check src plugin.zigandzig build testclean; built against the fizzymainSDK (--fork).🤖 Generated with Claude Code
Rebased 2026-10-16 onto main after #6 removed the Sample client. The Sample changes described above are gone with it. The queue itself is unchanged, but there is no longer a built-in way to see it without a real agent.