[PR #8300] Dedupe file ref tags in TUI display #12695

Closed
opened 2026-02-16 18:17:35 -05:00 by yindo · 0 comments
Owner

Original Pull Request: https://github.com/anomalyco/opencode/pull/8300

State: closed
Merged: No


The fix deduplicates file reference tags by tracking which files have already been seen using a Set. It uses the filename (or url for data URIs) as the unique key. When a duplicate is found, it returns an empty array instead of the file, effectively filtering it out.

The change is at packages/opencode/src/cli/cmd/tui/routes/session/index.tsx:1097. Now when users mention the same file multiple times in a prompt, only one tag badge will be displayed in the chat UI.

Closes #8298

New%20session%20-%202026-01-13T23%3A47%3A10.390Z
opencode session  |  github run

**Original Pull Request:** https://github.com/anomalyco/opencode/pull/8300 **State:** closed **Merged:** No --- The fix deduplicates file reference tags by tracking which files have already been seen using a Set. It uses the filename (or url for data URIs) as the unique key. When a duplicate is found, it returns an empty array instead of the file, effectively filtering it out. The change is at `packages/opencode/src/cli/cmd/tui/routes/session/index.tsx:1097`. Now when users mention the same file multiple times in a prompt, only one tag badge will be displayed in the chat UI. Closes #8298 <a href="https://opencode.ai/s/nDSN3k2t"><img width="200" alt="New%20session%20-%202026-01-13T23%3A47%3A10.390Z" src="https://social-cards.sst.dev/opencode-share/TmV3IHNlc3Npb24gLSAyMDI2LTAxLTEzVDIzOjQ3OjEwLjM5MFo=.png?model=opencode/claude-opus-4-5&version=1.1.18&id=nDSN3k2t" /></a> [opencode session](https://opencode.ai/s/nDSN3k2t)&nbsp;&nbsp;|&nbsp;&nbsp;[github run](/anomalyco/opencode/actions/runs/20976778506)
yindo added the pull-request label 2026-02-16 18:17:35 -05:00
yindo closed this issue 2026-02-16 18:17:35 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#12695