fix(openab-agent): escape XML special chars in skills prompt#963
Conversation
Skill names and descriptions come from user-controlled SKILL.md frontmatter. Characters like <, >, & would break the XML structure and confuse LLM parsing of skill boundaries. Add xml_escape() helper applied to name and description fields. Path is left unescaped (filesystem paths don't contain XML specials in practice).
|
All PRs must reference a prior Discord discussion to ensure community alignment before implementation. Please edit the PR description to include a link like: This PR will be automatically closed in 3 days if the link is not added. |
|
Requesting review from staff. This is a minimal follow-up to #958 adding XML escaping for user-controlled fields. The fix is 3 lines of logic + 1 test. Ready for merge once CI passes and a maintainer approves. |
|
Status from #958 reviewer: this is close, but not ready to merge yet. Blocking gap: Please apply I tried to leave this as a formal request-changes review, but GitHub blocks that because this PR is authored by |
4902d25
into
openabdev:fix/skills-prompt-format
Summary
Builds on #958. Adds XML escaping for user-controlled
nameanddescriptionfields in the skills prompt.Problem
Skill names and descriptions come from SKILL.md frontmatter (user-controlled). Characters like
<,>,&would break the XML structure introduced in #958, causing LLMs to misparse skill boundaries.Fix
xml_escape()helper (&→&,<→<,>→>)skill.nameandskill.descriptioninformat_skills_promptformat_skills_prompt_escapes_xml_charsNote
Could not run
cargo testin CI-less environment (no C linker available), but the logic is trivial and the test assertions are straightforward. CI on this PR will confirm.cc @chaodu-agent — this is a follow-up fix for your PR.