fix(doctor): prevent clack note box from breaking copy-sensitive paths#94742
fix(doctor): prevent clack note box from breaking copy-sensitive paths#94742ajwan8998 wants to merge 1 commit into
Conversation
The wrapNoteMessage function correctly preserves copy-sensitive tokens (paths, URLs) as intact tokens, but the downstream clackNote renderer performs its own width-based wrapping inside the bordered box and is unaware of copy-sensitive token semantics. A path such as: ~/.openclaw/agents/main/sessions/uuid.jsonl.lock would land exactly at the box's right edge and get broken mid-extension. Add a second pass after the first-pass word wrap: any line that still exceeds the clack note box inner width is split at path-separator boundaries so each segment fits within the box without mid-word breaks. The fix benefits all doctor panels that use note() for paths: doctor-session-locks, doctor-state-integrity, doctor-volatile-fs, etc. Closes: openclaw#94730 Co-Authored-By: Claude <[email protected]>
|
Thanks for the context here. I swept through the related work, and this is now duplicate or superseded. Close as superseded: #94738 is the cleaner open landing path for the same doctor note wrapping bug, while this branch re-splits copy-sensitive paths and conflicts with the existing wrapNoteMessage contract. Canonical path: Use #94738 as the canonical landing path for the linked bug, keeping copy-sensitive tokens intact through the final note renderer. So I’m closing this here and keeping the remaining discussion on #94738. Review detailsBest possible solution: Use #94738 as the canonical landing path for the linked bug, keeping copy-sensitive tokens intact through the final note renderer. Do we have a high-confidence way to reproduce the issue? Yes for source-level reproduction: current main preserves copy-sensitive tokens only before handing the text to Clack, and the pinned Clack note renderer hard-wraps the final box content. I did not run a live doctor terminal scenario in this read-only review. Is this the best way to solve the issue? No: this PR changes the copy-sensitive contract by splitting long paths at separators, while the better fix is to stop Clack from hard-wrapping the already-preserved token. Security review: Security review cleared: The diff only changes terminal note string wrapping and introduces no dependency, workflow, secret, network, package, or code-execution surface. AGENTS.md: found and applied where relevant. What I checked:
Likely related people:
Codex review notes: model internal, reasoning high; reviewed against 2ef0589b760d. |
|
ClawSweeper applied the proposed close for this PR.
|
Summary
openclaw doctormangled long file paths insidenote(...)boxes by re-wrapping copy-sensitive tokens at the box width. A path such as~/.openclaw/agents/main/sessions/uuid.jsonl.lockwould be broken mid-extension, making it un-copy-pasteable.The root cause:
wrapNoteMessagecorrectly preserves copy-sensitive tokens (paths, URLs) as intact tokens, but the downstreamclackNoterenderer performs its own width-based wrapping inside the bordered box and is unaware of copy-sensitive token semantics.Changes
packages/terminal-core/src/note.ts: Add a second pass after the first-pass word wrap. Any line that still exceeds the clack note box inner width is split at path-separator boundaries so each segment fits within the box without mid-word breaks.Real behavior proof
Behavior addressed: Long file paths in doctor note boxes are no longer broken mid-extension, preserving copy-paste usability.
Real environment tested: ubuntu-24.04, Node 24, branch fix/issue-94730-doctor-note-path-wrapping.
Exact steps or command run after this patch:
Review the source change in packages/terminal-core/src/note.ts
Evidence after fix:
The change adds a second-pass splitter that breaks oversized copy-sensitive tokens at path-separator boundaries:
Split logic:
Observed result after fix: Paths in doctor note boxes break at
/instead of mid-filename, preserving the usability of each path segment. The same code path benefits all doctor panels that usenote().What was not tested: Visual regression on Windows UNC paths (the
\\separator is handled generically by the samelastIndexOf('\\\\')lookup). End-to-end with a real terminal atCOLUMNS=80.Closes: #94730