Sanitize untrusted tool-result bodies before applying renderer-owned theme styling, without modifying execution, stored data, or model-facing results.
Cover edit diff/patch metadata, legacy find/ls rendering details, and write-content previews as well as ordinary result text.
Use named intermediate values instead of nested function-call arguments throughout the new code and tests.
Add a patch changeset for @eleith-pi/tool-rendering.
Defensive implementation
Review reproduced two problems with Pi 1.5's terminal-sequence stripper on untrusted input: visible-text loss after cursor-visibility controls and quadratic scans for repeated unterminated sequences. The sanitizer therefore uses Node's VT helper plus a small forward-only OSC/APC pass and a binary-control filter, rather than private SDK APIs or the unsafe stripping path.
Validation
All 76 test files / 1,405 tests passed.
Typecheck, lint, repository formatting, staged whitespace checks, and builds for all nine extensions passed.
Focused sanitation tests passed on Node 22.20 and 26.5; exact minimum Node 22.19 and non-Linux platforms were not executed.
Regression coverage checks raw sequence removal, retained ANSI around styled body text, metadata bypasses, immutable model-facing data, cursor-control text preservation, and malformed-input handling in a subprocess with a hard deadline.
Reviews
Code, readability, and test reviews completed. Findings were fixed and re-reviewed with no remaining actionable issues.
Scope is intentionally limited to display bodies; timing, wrapping, header formatting, and other SDK-alignment recommendations remain separate batches.
## Summary
- Sanitize untrusted tool-result bodies before applying renderer-owned theme styling, without modifying execution, stored data, or model-facing results.
- Cover edit diff/patch metadata, legacy find/ls rendering details, and write-content previews as well as ordinary result text.
- Use named intermediate values instead of nested function-call arguments throughout the new code and tests.
- Add a patch changeset for `@eleith-pi/tool-rendering`.
## Defensive implementation
Review reproduced two problems with Pi 1.5's terminal-sequence stripper on untrusted input: visible-text loss after cursor-visibility controls and quadratic scans for repeated unterminated sequences. The sanitizer therefore uses Node's VT helper plus a small forward-only OSC/APC pass and a binary-control filter, rather than private SDK APIs or the unsafe stripping path.
## Validation
- All 76 test files / 1,405 tests passed.
- Typecheck, lint, repository formatting, staged whitespace checks, and builds for all nine extensions passed.
- Focused sanitation tests passed on Node 22.20 and 26.5; exact minimum Node 22.19 and non-Linux platforms were not executed.
- Regression coverage checks raw sequence removal, retained ANSI around styled body text, metadata bypasses, immutable model-facing data, cursor-control text preservation, and malformed-input handling in a subprocess with a hard deadline.
## Reviews
Code, readability, and test reviews completed. Findings were fixed and re-reviewed with no remaining actionable issues.
Scope is intentionally limited to display bodies; timing, wrapping, header formatting, and other SDK-alignment recommendations remain separate batches.
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Summary
@eleith-pi/tool-rendering.Defensive implementation
Review reproduced two problems with Pi 1.5's terminal-sequence stripper on untrusted input: visible-text loss after cursor-visibility controls and quadratic scans for repeated unterminated sequences. The sanitizer therefore uses Node's VT helper plus a small forward-only OSC/APC pass and a binary-control filter, rather than private SDK APIs or the unsafe stripping path.
Validation
Reviews
Code, readability, and test reviews completed. Findings were fixed and re-reviewed with no remaining actionable issues.
Scope is intentionally limited to display bodies; timing, wrapping, header formatting, and other SDK-alignment recommendations remain separate batches.