Description
During a normal session/prompt turn, the ACP agent echoes back the user's message as a session/update with user_message_chunk. This causes ACP clients (e.g. Zed Editor,Obsidian Agent Client) to display the user message twice.
Per the ACP spec, user_message_chunk should only be sent during session/load or session/fork to replay conversation history — not during an active prompt turn. The client already knows the message it sent, so echoing it back is incorrect and results in duplication.
This behavior was introduced in #18625, which intentionally added user_message_chunk emission on the live prompt path to align output between the live and replay paths. While the goal of consistency is understandable, the ACP prompt turn lifecycle does not include user_message_chunk, and compliant clients interpret it as a new message — causing the duplication.
If the underlying need is to expose the internal messageId to clients (e.g. for revert), that should be addressed through a different mechanism (such as including it in the session/prompt response) rather than echoing back user messages during the prompt turn.
Related: RAIT-09/obsidian-agent-client#209
I'd like to submit a PR to fix this.
Plugins
No response
OpenCode version
1.4.1
Steps to reproduce
- Connect to OpenCode via an ACP client (e.g. Zed Editor, Obsidian Agent Client)
- Send any prompt (e.g. "Hello World")
- The user message is immediately displayed twice — once from the client's own input, and once from the echoed user_message_chunk session/update
Screenshot and/or share link
Operating System
No response
Terminal
No response
Description
During a normal
session/promptturn, the ACP agent echoes back the user's message as asession/updatewithuser_message_chunk. This causes ACP clients (e.g. Zed Editor,Obsidian Agent Client) to display the user message twice.Per the ACP spec,
user_message_chunkshould only be sent duringsession/loadorsession/forkto replay conversation history — not during an active prompt turn. The client already knows the message it sent, so echoing it back is incorrect and results in duplication.This behavior was introduced in #18625, which intentionally added
user_message_chunkemission on the live prompt path to align output between the live and replay paths. While the goal of consistency is understandable, the ACP prompt turn lifecycle does not includeuser_message_chunk, and compliant clients interpret it as a new message — causing the duplication.If the underlying need is to expose the internal
messageIdto clients (e.g. for revert), that should be addressed through a different mechanism (such as including it in thesession/promptresponse) rather than echoing back user messages during the prompt turn.Related: RAIT-09/obsidian-agent-client#209
I'd like to submit a PR to fix this.
Plugins
No response
OpenCode version
1.4.1
Steps to reproduce
Screenshot and/or share link
Operating System
No response
Terminal
No response