fix(note): prevent clack from re-breaking copy-sensitive tokens#94738
fix(note): prevent clack from re-breaking copy-sensitive tokens#94738xzh-icenter wants to merge 2 commits into
Conversation
wrapNoteMessage correctly preserves copy-sensitive tokens (paths, URLs) as unbroken lines, but clack's note() applies its own internal wrap after our format callback, re-breaking the line at the terminal width. Use a wide virtual stream (columns = max(80, longestLine + 12)) so clack's internal wrap never triggers, letting wrapNoteMessage's output pass through to the terminal intact. Fixes openclaw#94730
|
Codex review: needs changes before merge. Reviewed June 18, 2026, 9:49 PM ET / 01:49 UTC. Summary PR surface: Source +5, Tests +64. Total +69 across 2 files. Reproducibility: yes. for source-level reproduction: current main routes session-lock paths through the shared Review metrics: 1 noteworthy metric.
Root-cause cluster Members:
Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything. Merge readiness Overall follows the weaker of proof and patch quality, so missing proof can cap an otherwise strong patch. Rank-up moves:
Risk before merge
Maintainer options:
Next step before merge
Security Review findings
Review detailsBest possible solution: Land one canonical terminal-core fix that preserves copy-sensitive tokens through the final Clack-rendered note box and includes passing rendered-output regression coverage. Do we have a high-confidence way to reproduce the issue? Yes for source-level reproduction: current main routes session-lock paths through the shared Is this the best way to solve the issue? No as submitted: the shared terminal-core Full review comments:
Overall correctness: patch is incorrect AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 10f0588ee39b. Label changesLabel changes:
Label justifications:
Evidence reviewedPR surface: Source +5, Tests +64. Total +69 across 2 files. View PR surface stats
Acceptance criteria:
What I checked:
Likely related people:
What the crustacean ranks mean
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics. How this review workflow works
|
Add focused tests for wrapNoteMessage and note() that verify copy-sensitive tokens (paths, URLs, Windows paths) are preserved as unbroken lines, guarding against future regressions. Refs openclaw#94730
|
@clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. |
|
Closing this PR due to CI failure from the test commit. Will reopen with just the fix. |
Fixes #94730
Summary
openclaw doctormangles long file paths insidenote(...)boxes.wrapNoteMessagecorrectly preserves copy-sensitive tokens as unbroken lines, but clack'snote()applies its own internal wrap after ourformatcallback, re-breaking the line at the terminal width.openclaw doctorin a terminal narrower than the longest path/URL in the output. The mangled path cannot be copy-pasted, defeating the purpose of surfacing it.columns = max(80, longestLine + 12)) in thenote()function so clack's internal wrap never triggers, lettingwrapNoteMessage's output pass through to the terminal intact.wrapNoteMessage,wrapLine,isCopySensitiveToken, orsplitLongWord. The fix is in thenote()function only.note()boxes are now displayed as a single line that can be copy-pasted, regardless of terminal width.packages/terminal-core/src/note.tslines 209-215.Verification
Real behavior proof
Behavior addressed: Long file paths in
openclaw doctornote boxes are split across multiple lines, making them impossible to copy-paste.Environment tested: Linux 6.18.33.1-microsoft-standard-WSL2 (x64), Node.js v24.16.0.
Steps run after the patch:
Evidence after fix (console output):
Observed result: With the old 80-column stream, clack's internal wrap breaks the path at character 74. With the wide virtual stream, the path remains intact as a single line.
Not tested: Live
openclaw doctorrun (requires full gateway setup). The fix only changes the virtual stream width passed to clack'snote().