Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Suggest Edits should strip CDATA #24564

Open
subtleGradient opened this issue Feb 10, 2025 · 4 comments
Open

Suggest Edits should strip CDATA #24564

subtleGradient opened this issue Feb 10, 2025 · 4 comments

Comments

@subtleGradient
Copy link

Summary

Suggest Edits prompt uses XML. Some AI models insert CDATA notation. Zed sees the CDATA stuff as content. It shouldn't

When the AI suggests:

<new_text><![CDATA[THE NEW TEXT]]></new_text>

Zed tries to inject: <![CDATA[THE NEW TEXT]]>

It should inject: THE NEW TEXT instead

Zed Version and System Specs

Zed: v0.172.10 (Zed)
OS: macOS 15.1.0
Memory: 96 GiB
Architecture: aarch64

@subtleGradient
Copy link
Author

i dunno rust (yet)
but ai suggested this: https://gist.github.com/subtleGradient/d01aca56a6662f70731ae61ebc672e64

@probably-neb
Copy link
Contributor

Hmm, what models are generating CDATA for you?
The solution here may be just telling the AI not to use CDATA, but it would be useful to know which models are generating CDATA for you so we can figure out whether it's a model specific issue or if it's general enough and common enough that we should be checking for and handling it on every AI request

@stippi
Copy link
Contributor

stippi commented Feb 11, 2025

Actually, the LLM using this tag might be a good thing. Right now, the suggested edits better not contain </old_text>, </new_text> or any of the XML tags used for the tool invocation.

@stippi
Copy link
Contributor

stippi commented Feb 11, 2025

Image

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

No branches or pull requests

3 participants