Skip to content

fix(ui): drop the slash-command echo of the local user message in the ACP adapter - #11671

Open
yixuanzhong wants to merge 1 commit into
aaif-goose:mainfrom
yixuanzhong:fix/acp-slash-command-user-echo
Open

fix(ui): drop the slash-command echo of the local user message in the ACP adapter#11671
yixuanzhong wants to merge 1 commit into
aaif-goose:mainfrom
yixuanzhong:fix/acp-slash-command-user-echo

Conversation

@yixuanzhong

Copy link
Copy Markdown
Contributor

Fixes: #11670

Summary

Slash commands make the agent yield the user's own prompt back into the reply stream (command_preamble / yield AgentEvent::Message(user_message) in agent.rs). The desktop already rendered that prompt locally when it was sent, so the echoed user_message_chunk either merged into the local message and doubled its text (/plan add tests/plan add tests, before #10716) or, now that the echo carries a server-generated id, landed as a second identical user bubble.

This drops a non-steer user_message_chunk whose text equals the single text block of the last locally rendered user message, in applyContentChunk. The check runs before the id lookup so it covers both shapes. Steer confirmations are untouched (they are reconciled by id and replace text rather than append), and the agent stream is unchanged for the CLI and other ACP clients.

Testing

  • New unit tests in sessionNotificationAdapter.test.ts: the echo is dropped whether it arrives without an id or with a server id, the agent chunk that follows still lands as a separate message, and a genuine id-less user delta still merges.
  • vitest run src/acp: 21 files, 175 tests pass. tsc --noEmit, eslint --max-warnings 0 and prettier --check clean on the touched files.
  • Manual: reproduced the duplicate with /plan ... and /goal ... on a build of this adapter; with the guard the command appears once.

Related Issues

Discussion: #9261 (structured slash-command lifecycle events would remove the need for the echo altogether)

Screenshots/Demos (for UX changes)

Before: the sent /goal ... message rendered twice in one bubble, joined with no separator.

After: the message renders once.

… ACP adapter

Slash commands make the agent yield the user's own prompt back into the
reply stream. The desktop already rendered that prompt when it was sent, so
the echoed user_message_chunk either merges into the local message and
doubles its text, or lands as a second identical user message once the
server assigns it an id. Ignore a non-steer user text chunk that repeats
the locally rendered user message.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Desktop shows a slash-command message twice (agent echoes the prompt into the ACP stream)

1 participant