# Fix repeated prompts in opencode acp \(\#53216\) · gitcafe/zed

[View on GitCafe](https://git.cafe/gitcafe/zed/commit/08e43aed1f6383609910af44d17d149487bbcb5f)

Repository: [gitcafe/zed](https://git.cafe/gitcafe/zed)

Visibility: public

Requested revision: 08e43aed1f6383609910af44d17d149487bbcb5f

Requested commit: 08e43aed1f6383609910af44d17d149487bbcb5f

Commit: 08e43aed1f6383609910af44d17d149487bbcb5f

Tree: 649887f6e2817eb7454aa418fa68faa106acf32d

Author: Om Chillure

Committer: GitHub

## Message

```
Fix repeated prompts in opencode acp (#53216)

### Summary
Fixes duplicated Prompts/context in ACP threads after sending a message,
as reported in #53201.

### Root Cause
The thread already inserts the user prompt optimistically at send time.
If an ACP server also echoes UserMessageChunk updates for the same
prompt, the same content is appended again, which can duplicate rendered
context sections.

### Fix
Ignore echoed UserMessageChunk updates while a turn is actively running,
so user prompt content is not appended twice.

### Validation
- Reproduced with OpenCode ACP flow from the issue.
- Confirmed duplication appears after send (not in the input box).
- Confirmed duplicate Prompts/context no longer appears with the fix.

### Video 

[Screencast from 2026-04-06
08-21-32.webm](https://github.com/user-attachments/assets/33075312-9af7-4dd5-a2a3-5e1169b80243)


### Self-Review Checklist
- [x] I've reviewed my own diff for quality, security, and reliability
- [x] Unsafe blocks (if any) have justifying comments
- [x] The content is consistent with the [UI/UX
checklist](https://github.com/zed-industries/zed/blob/main/CONTRIBUTING.md#uiux-checklist)
- [x] Tests cover the new/changed behavior
- [x] Performance impact has been considered and is acceptable

Closes #53201

## Release Notes
- Fixed duplicated Prompts/context in ACP conversations when servers
echo user message chunks after send.
```

## Parents

- [d1871d5cf868223e8ea8763ac80557e1b8911fca](https://git.cafe/gitcafe/zed/commit/d1871d5cf868223e8ea8763ac80557e1b8911fca?format=markdown)

[Source at this commit](https://git.cafe/gitcafe/zed/tree/08e43aed1f6383609910af44d17d149487bbcb5f?format=markdown)
