Repository navigation
fix(skills): stop executing escape sequences embedded in SKILL.md descriptions - #175601
wangmiao0668000666 wants to merge 2 commits into
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review completeClawSweeper finished reviewing this revision. The review result is being finalized. |
|
Codex review: needs maintainer review before merge. What this changesThis PR filters terminal controls from skill-list descriptions, sources, and verbose requirements while preserving layout whitespace. Example: Run openclaw skills list with a workspace description containing color escapes and BEL around RED.
Review scores
ProductKind: Bug fix · Worth it: Yes · Fix scope: Complete Merge readiness✅ Ready for maintainer review Keep this PR open: it fixes a current terminal-control defect, resolves the previous whitespace finding, and has no actionable introduced defects. Priority: P2 Before mergeNone. FindingsNone. Agent review detailsHow this fits togetherSkill discovery supplies metadata to the CLI formatter, which produces styled terminal tables or filtered JSON. flowchart LR
A[Workspace skill files] --> B[Skill discovery]
B --> C[Skill status report]
C --> D[CLI formatter]
D --> E[Control filtering and table layout]
E --> F[Terminal output]
D --> G[JSON serialization]
Technical reviewBest possible solution: Land whitespace-preserving filtering at the existing skill-list rendering boundary while coordinating the overlapping descriptor-hardening work. Do we have a high-confidence way to reproduce the issue? Current-main source exposes the reported controls, and supplied base/head CLI output confirms the mechanism; this review executed no target code. Is this the best way to solve the issue? Reusing the existing whitespace-preserving filter before trusted styling fixes the rendering boundary without changing discovery metadata or existing JSON filtering. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 8cfa2ec42441. Provenance checked
TestingProof path: shipped entry point. SecurityNone. EvidenceWhat I checked:
Likely related people:
PR surfaceSource +6, Tests +24. Total +30 across 2 files. Added test files: 0. View PR surface stats
LabelsLabel changes: No label changes. Label justifications:
Rating scale6/6 🦀 challenger crab · 5/6 🦞 diamond lobster · 4/6 🐚 platinum hermit · 3/6 🦐 gold shrimp · 2/6 🦪 silver shellfish · 1/6 🧂 unranked krab. Overall follows the weaker of proof and patch quality; ✨ marks media proof (a screenshot, video, or linked artifact) that directly shows the changed behavior. WorkflowClawSweeper edits this one comment on every review. Comment HistoryReview history (1 earlier review cycle)
Reviewed October 17, 2026, 10:59 AM ET / 14:59 UTC (Revision 2). |
|
Revision Base vs this head, real entry, same workspace-skill fixture (
The pre-existing spaced-word case is back to its original expectation and now also asserts no C1 byte:
@clawsweeper re-review |
|
🦞👀 Re-review progress:
|
…criptions The skills table passed workspace-owned SKILL.md description and source straight to the terminal, while the single-skill report already sanitized the same fields.
sanitizeForLog also removed tabs and line endings, which the skills table renders as spacing. Reuse the whitespace-preserving control filter the JSON path already used, and restore the spaced-word table expectation.
482ceb2 to
e21aca0
Compare
|
Rebased onto current Local proof: |
|
Thanks @wangmiao0668000666. #172872 (merged as 1d4ef25) now fixes this on main: human skill and hook reports pass names, descriptions and paths through the shared terminal-safe text owner, so escape sequences from SKILL.md descriptions are no longer printed. A built-CLI check showed main printing them and the fix printing none, with JSON output unchanged. Closing as superseded; your report helped confirm the scope. |
|
Thanks @obviyus — confirmed on main: |
What Problem This Solves
Fixes:
openclaw skills listprints each skill'sdescriptionandsourceverbatim, so a workspace skill whoseSKILL.mdfrontmatter carries ESC/BEL sequences changes the operator's terminal while they list skills.User Impact
User impact: the skills table renders skill text as text and no longer interprets escapes embedded in a workspace
SKILL.md;skills list --jsonkeeps the raw values for scripts.Why This Change Was Made
The single-skill report in the same module already sanitizes the same fields (
skills infopassesname,description,source, andhomepagethroughsanitizeForLog), while the list row builder handed them to the table raw. The row builder now sanitizes description, source, and the verbose missing-requirements summary before theming.One existing case changes meaning:
skills-cli.formatting.test.tspreviously asserted that a C1 sequence stayed in the description cell ("left right", i.e. the escape was still delivered and only its layout effect was measured). The cell now carries only printable text, so the case asserts"leftright"and that the report contains no C1 byte — same fixture, escape removed instead of forwarded.Evidence
711eb843136, head97d9379f732; secretless Linux container, Node 24.18.0, isolatedHOME/OPENCLAW_STATE_DIR.<state>/workspace/skills/evil/SKILL.mdwhose frontmatter description isEvil \x1b[31mRED\x1b[0m \x1b[2Kbell\x07 cr\r end.node --import ./scripts/tsx.mjs src/entry.ts skills list), counting raw C0/C1 bytes:Evil ^[[31mRED^[[0m ^[[2Kbell^G cr endEvil RED bell cr endFocused regression, red on base and green on head:
Command:
node_modules/.bin/vitest run --config vitest.config.ts src/cli/skills-cli.formatting.test.ts --maxWorkers=1. Oxfmt and Oxlint clean on the changed files.