Repository navigation
refactor: share ANSI compatibility matching - #146998
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. Reviewed September 13, 2026, 2:34 PM ET / 18:34 UTC (Revision 2). ClawSweeper reviewWhat this changesThe PR shares ANSI escape compatibility matching across two terminal-text stripping branches without changing their output. Merge readiness✅ Ready for maintainer review No actionable findings. This is a focused, behavior-preserving cleanup that remains absent from current main; the member-authored, protected PR stays open. Priority: P3 Review scores
Verification
How this fits togetherTerminal Core removes escape sequences from shell output and terminal buffers before other OpenClaw components display or sanitize the text. Its scanner preserves the existing distinctions between standard escapes, compatibility sequences, and incomplete streaming input. flowchart TD
A[Shell output or terminal buffer] --> B[Terminal Core stripping]
B --> C[Complete OSC sequence]
C -->|Present| D[Remove sequence]
C -->|Absent| E[CSI scan and compatibility match]
E --> F[Preserve controls and pending input as configured]
D --> G[Text for display or sanitization]
F --> G
Before mergeNone. Agent review detailsSecurityNone. PR surfaceSource -4. Total -4 across 1 file. View PR surface stats
Review metricsNone. Technical reviewBest possible solution: Keep compatibility matching in the existing stripping owner with the same scanner ordering, grammar, and streaming behavior. Do we have a high-confidence way to reproduce the issue? Not applicable: this PR reports duplicated implementation, not broken user behavior; the duplication is directly visible on current main. Is this the best way to solve the issue? Yes: hoisting the identical setup preserves both branches' execution order and avoids introducing another helper or parsing owner. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 29517dc5f3ad. LabelsLabel justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (1 earlier review cycle)
|
|
Merged via squash.
|
* commit '28887b564210326174413d0d8ade72b38268d5f3': (1827 commits) fix(qa): bind coverage IDs to producer assertions (#144000) fix(linux): explain FreeBSD desktop setup prerequisites (#147211) fix(memory): split embedding batches rejected for an input array item cap (#139541) test: isolate timing metadata persistence from inherited settings (#147112) refactor(status): retire test-only helper publication (#147071) improve: reduce workspace agent lookup work for large fleets (#147144) refactor(macos): share connect credential selection (#144214) fix(plugins): restore Slack onboarding after core updates (#147109) refactor: share ANSI compatibility matching (#146998) fix(test): settle Models catalog before picker open (#147215) test(ui): reuse panel tab drag fixture (#147250) fix(install): use system Node for FreeBSD CLI setup (#147204) fix(cli): explain MCP probes with no enabled servers (#147216) docs: require UI screenshots in chat and PR (#147263) docs(skills): clarify remote gog OAuth setup for Gateway hosts (#145945) test: replace idle account catalog waits with synchronization (#147228) feat(qa): preserve maturity decision context (#147219) feat(macos): clarify agent activity in native chat (#147197) fix(runtime): complete Bun compatibility follow-ups (#147085) fix(ui): release closed chat panes after queued updates (#147240) ...
What Problem This Solves
ANSI stripping repeats compatibility matcher setup on both sides of its CSI decision.
User Impact
Output stays the same. Complete OSC handling, compatibility matching, control cancellation/restarts and incomplete streaming CSI are preserved.
Why This Change Was Made
Compute the existing conditional match once, at the same point after the canonical scanner. Production: −4 lines; tests unchanged.
Evidence
bcb5025ad36448cb08db4b46df9506ccf3a3ffa4. Actual ANSI/safe-text execution passed 86 ANSI cases and eight safe-text cases. Shell-utils execution passed 34 cases with one platform-specific skip. Selected type, lint and formatting gates passed.