Agent pane: a queued agent's message draws as its received line

Merged
TE
15d ago
+327-11

In progress: review, fleet compile and CI are running at the head.

Another agent's message waiting behind a running turn used to show in the composer queue as if the person had typed it. Now its row is the message's received line: IncomingMessageLine (conversation/IncomingMessageCard.tsx, from #23727), the same component the transcript draws it with once it runs. That gives the sender's harness mark or a small bot, the sender's name as a chip that opens their chat, a muted one-line preview, and the message as a glass Markdown card when opened. Edit, Remove and Send now sit in the line's actions slot at its end. The person's own queued prompts are unchanged.

  • direct.ts queuedMessage(msg) reads a queued record the way the received line reads the same prompt once it runs (incomingPrompt: agent_message, session_message/subsession_message, the [name] text from acpmux send in a shell). Failing that, it uses acpmux's fromAgent, dropping a leading [name] or From name: that only repeats the sender. The person's own prompt gets none.
  • The message is kept on the QueuedPrompt (message) through queue_order, delivery updates and mergeQueue, since acpmux's queue list doesn't name a sender. An edit (queue_updated) makes the prompt the person's, matching acpmux, which drops its provenance and fromAgent (hub/queue.rs).
  • The composer sits outside the transcript's SubsessionContext. App now hands the listed chats to the queue (Composer queueSubsessions), so the chip finds a shell sender's chat by name and opens it.
  • Opening or closing the message re-fits the queue's height (IncomingMessageLine onToggle), so the card shows whole.
  • Gallery: agent-pane.composer queued-from-agent (closed) and queued-from-agent-open (the card; its play waits for the whole card inside the list).

No capture: webview-only (the composer queue row in the agent pane web view). The gallery states agent-pane.composer queued-from-agent and queued-from-agent-open cover it, rendered by gallery health on Linux Chromium.

Tests (CI only; nothing is built or tested on Leo's Mac):

  • queuedMessage.test.ts: each provenance kind, the CLI [name] prefix, fromAgent with and without a repeated lead, none for the person's prompt, and mergeQueue keeping the message.
  • test/queue-agent-message.test.tsx (JSDOM): the agent row shows the chip, the preview and all three actions inside the line; the chip opens the sender's chat; the preview opens the card. The person's row is unchanged.

Overlap: #23753 (queued rows show Steer, a trash can and ⋯) changes the same row code. Whichever lands second rebases.

Agent session: cosmic-gray

🤖 Generated with Claude Code