messages: sanitize visible DCP metadata output#447
messages: sanitize visible DCP metadata output#447ricatix wants to merge 11 commits intoOpencode-DCP:devfrom
Conversation
v3.0.0 - Version bump
merge dev into master
v3.0.1 - Version bump
permissions: replace findLast
v3.0.2 - Version bump
v3.0.3 - Version bump
v3.0.4 - Version bump
Add GitHub issue templates
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent) Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent) Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
|
wow yea this actually looks really good. Can I ask what the motivation was for removing IDs from tool parts? I think you're right its probably better because its cleaner, but did you have something else in mind? Also I don't understand what you mean by IDs leaking into user visible tool outputs. Do you have a picture of what this looks like? I've never seen it or had any other reports of this happening. Tool outputs are user created, so I don't really see how any DCP xml tagged hallucinations could end up there. The other hallucination stripping logic was because some models would hallucinate responses that looked exactly like DCP injections because they had it in their context. I thought having the IDs in the tools maybe reduces this as well, because it would mean less injections into text parts for the model to be influenced by into hallucinations. What do you think? Is there some client other than TUI that is affected by DCP injections into tool outputs? |
Summary
Why
Internal DCP metadata should not leak into user-visible OpenCode output. This patch moves message-id injection away from completed tool output and sanitizes the visible render paths that can still surface DCP tags.
Testing
bun run testbun run typecheckbun run buildNotes
sanitizeVisibleOutput()also collapses 3+ newlines to 2 and trims trailing whitespace after metadata removal