Skip to content

fix(cli): keep note text with Windows and Unicode line endings - #139512

Merged
steipete merged 3 commits into
mainfrom
codex/qa30-30-note-line-separators-20260905
Sep 6, 2026
Merged

steipete merged 3 commits into
mainfrom
codex/qa30-30-note-line-separators-20260905

Conversation

@steipete

@steipete steipete commented Sep 5, 2026

Copy link
Copy Markdown
Contributor
Additional instructions

MUST: Keep Allow edits from maintainers enabled for this PR so maintainers can help update the branch when needed.

What Problem This Solves

Fixes an issue where users reading CLI setup or diagnostic notes would see missing lines or an empty note when its text contained Windows CRLF, bare CR, or Unicode line/paragraph separators. For example, First paragraph.\r\nSecond paragraph. displayed only the second paragraph.

Why This Change Was Made

The note wrapper split only on LF, leaving other line terminators inside a single line that its wrapping expression could not parse. Normalize logical line breaks at that existing boundary before wrapping, treating CRLF as one break and preserving blank lines, bullets, copyable paths, width handling, and Clack output routing.

User Impact

CLI notes retain all paragraphs across LF, CRLF, CR, U+2028, and U+2029 inputs. The repair changes one production line with no new configuration, dependency, or public API surface. Production LOC: +1/−1 (net 0); tests: +25.

Evidence

The regression exercises actual noteToStream/Clack output with a first paragraph, a blank line, and a bullet. Before the production change, CRLF, CR, U+2028, and U+2029 failed because the first paragraph disappeared; the LF control passed. After the change, all five variants preserve the text.

  • 118 tests passed across the complete terminal table/note suite and wizard prompter suite, using one worker on Node 24.19.0.
  • Five actual wizard cases passed through createClackPrompter.note → noteToStream → Clack 1.7.0 → Writable. Every line-ending variant produced identical complete output, including the blank line and bullet.
  • Stable v2026.9.1 source reproduced the same loss using immutable Git objects and the installed Clack renderer; this was source-level historical proof, not a published historical binary test.
  • Formatting and git diff --check passed. Managed independent review through P2 returned scoped-clean with no findings.

Focused verification:

OPENCLAW_VITEST_MAX_WORKERS=1 node scripts/run-vitest.mjs packages/terminal-core/src/table.test.ts src/wizard/clack-prompter.test.ts

The tested candidate is based on 7c4904e32e2b5dae23bb9e268d671fdb6cb5c7f1. The base renderer, adjacent helpers, wizard caller, and test paths are byte-identical in checked main 8bdeb2f9bc85f9d2c9e654b4c52c49b269e62ee9. Broad checks/build were not rerun locally; required hosted CI must pass on the published head before landing.

@clawsweeper

clawsweeper Bot commented Sep 5, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

Pull request received. I will update this pull request when review starts.

ClawSweeper review complete

ClawSweeper finished reviewing this revision. The review result is being finalized.

View the workflow run.

@openclaw-barnacle openclaw-barnacle Bot added size: XS maintainer Maintainer-authored PR labels Sep 5, 2026
@steipete
steipete marked this pull request as ready for review September 5, 2026 23:32
@clawsweeper clawsweeper Bot added P2 Normal backlog priority with limited blast radius. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. labels Sep 5, 2026
@clawsweeper

clawsweeper Bot commented Sep 5, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed September 5, 2026, 9:14 PM ET / September 6, 2026, 01:14 UTC.

ClawSweeper review

What this changes

Normalize Windows and Unicode line breaks before wrapping CLI notes so paragraphs, blank lines, and bullets remain visible.

Merge readiness

✅ Ready for maintainer review

This PR remains useful: fetched main and the latest release retain the faulty line splitting. The focused repair has no actionable correctness findings, and the changed files are unchanged since the previous review.

Priority: P2
Reviewed head: 43caa7b2be61e68ab8729c6e76b4ec74d4fefaad

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A narrow owner-level repair with meaningful regression coverage and no identified merge-blocking defect.
Proof confidence 🌊 off-meta tidepool Not applicable: The supplied repository state identifies a member-authored PR, so the external-contributor proof gate does not apply. Its body reports five wizard-to-noteToStream-to-Clack cases preserving complete output; this review inspected the source and tests but did not independently execute that evidence.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Not applicable Not applicable: The supplied repository state identifies a member-authored PR, so the external-contributor proof gate does not apply. Its body reports five wizard-to-noteToStream-to-Clack cases preserving complete output; this review inspected the source and tests but did not independently execute that evidence.
Evidence reviewed 8 items Introduced repair: The verified merge-base-to-head diff changes only the logical-line splitter and adds parameterized regression coverage; CRLF is consumed as one separator.
Current-main defect remains: Fetched main splits only on LF before applying an anchored, non-dotAll line expression. Embedded CR and Unicode line terminators can prevent the content capture from matching, leaving empty content.
Latest-release source: The supplied latest release, v2026.9.2, also contains the LF-only splitter; the central repair is not present in that release's source.
Findings None None.
Security None None.

How this fits together

CLI setup and diagnostic flows send informational text through the shared terminal note renderer. It wraps that text and passes it to Clack for output on the selected terminal stream.

flowchart LR
  A[Setup and diagnostic text] --> B[Normalize logical line breaks]
  B --> C[Wrap paragraphs and bullets]
  C --> D[Clack note renderer]
  D --> E[Selected terminal stream]
Loading

Before merge

None.

Agent review details

Security

None.

PR surface

Source 0, Tests +25. Total +25 across 2 files.

View PR surface stats
Area Files Added Removed Net
Source 1 1 1 0
Tests 1 25 0 +25
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 2 26 1 +25

Review metrics

None.

Technical review

Best possible solution:

Keep logical-line normalization in the shared note wrapper, preserving existing wrapping, copy-sensitive tokens, and selected-stream output.

Do we have a high-confidence way to reproduce the issue?

Yes, source establishes a focused reproduction: pass paragraphs separated by CRLF, CR, U+2028, or U+2029 through the current-main note wrapper. No tests or target code were executed during this read-only review.

Is this the best way to solve the issue?

Yes, normalizing logical breaks before the existing per-line parser repairs the owning boundary without adding competing caller logic or changing public interfaces.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning medium; reviewed against 1d9ce1ac9ffa.

Labels

Label justifications:

  • P2: This repairs lost informational note text for specific line endings without evidence of a blocked core workflow.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🌊 off-meta tidepool and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Not applicable: The supplied repository state identifies a member-authored PR, so the external-contributor proof gate does not apply. Its body reports five wizard-to-noteToStream-to-Clack cases preserving complete output; this review inspected the source and tests but did not independently execute that evidence.

Evidence

What I checked:

  • Introduced repair: The verified merge-base-to-head diff changes only the logical-line splitter and adds parameterized regression coverage; CRLF is consumed as one separator. (packages/terminal-core/src/note.ts:173, 43caa7b2be61)
  • Current-main defect remains: Fetched main splits only on LF before applying an anchored, non-dotAll line expression. Embedded CR and Unicode line terminators can prevent the content capture from matching, leaving empty content. (packages/terminal-core/src/note.ts:94, 1d9ce1ac9ffa)
  • Latest-release source: The supplied latest release, v2026.9.2, also contains the LF-only splitter; the central repair is not present in that release's source. (packages/terminal-core/src/note.ts:173, 3928bad9badf)
  • Behavioral regression coverage: Five separator variants exercise noteToStream output and exact normalized paragraph boundaries. Adjacent tests retain coverage for copy-sensitive paths, URLs, bullet indentation, output routing, coercion, and wide-character wrapping. (packages/terminal-core/src/table.test.ts:899, 43caa7b2be61)
  • Production entrypoint: The wizard's note method forwards message, title, and selected output directly to the shared note renderer, so repairing its splitter covers setup notes without caller-specific normalization. (src/wizard/clack-prompter.ts:228, 43caa7b2be61)
  • Review continuity: Neither changed file differs from the preceding reviewed head. The supplied completed review projection contains no findings or published rank-up moves. (43caa7b2be61)

Likely related people:

  • Peter Steinberger: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)
  • ly-wang19: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)

Rating scale

Score Internal tier Crab rank Meaning
6/6 S 🦀 challenger crab Exceptional readiness
5/6 A 🦞 diamond lobster Very strong readiness
4/6 B 🐚 platinum hermit Good normal PR; ordinary maintainer review
3/6 C 🦐 gold shrimp Useful, but confidence is limited
2/6 D 🦪 silver shellfish Proof or implementation needs work
1/6 F 🧂 unranked krab Not merge-ready
N/A NA 🌊 off-meta tidepool Rating does not apply

Overall follows the weaker of proof and patch quality.
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.

Workflow

  • ClawSweeper keeps one durable marker-backed review comment per issue or PR.
  • Re-runs edit this comment so the latest verdict, findings, and automation markers stay together instead of adding duplicate bot comments.
  • A fresh review can be triggered by eligible @clawsweeper re-review comments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.
  • PR/issue authors and users with repository write access can comment @clawsweeper re-review or @clawsweeper re-run on an open PR or issue to request a fresh review only.
  • Maintainers can also comment @clawsweeper review to request a fresh review only.
  • Fresh-review commands do not start repair, autofix, rebase, CI repair, or automerge.
  • Maintainer-only repair and merge flows require explicit commands such as @clawsweeper autofix, @clawsweeper automerge, @clawsweeper fix ci, or @clawsweeper address review.
  • Maintainers can comment @clawsweeper explain to ask for more context, or @clawsweeper stop to stop active automation.

History

Review history (2 earlier review cycles)
  • reviewed 2026-09-05T23:37:39.340Z sha cf7bad0 :: needs maintainer review before merge. :: none
  • reviewed 2026-09-06T00:54:48.174Z sha 21974c2 :: needs maintainer review before merge. :: none

@steipete

steipete commented Sep 6, 2026

Copy link
Copy Markdown
Contributor Author

Native preparation passed for head 43caa7b2be61e68ab8729c6e76b4ec74d4fefaad, using successful exact-head CI run 34003137745. The reviewed two-file patch is unchanged, and the latest ClawSweeper review has no findings or before-merge actions.

The regression first failed for CRLF, CR, U+2028, and U+2029 while the LF control passed. After the repair, all 118 terminal/wizard tests pass; five actual wizard-to-Clack-to-Writable cases preserve identical complete output, including blank lines and bullets. Production LOC remains +1/-1 (net zero), with 25 test lines added.

The current main baseline still has the faulty LF-only splitter. The fix is ready for native merge; broad build/type/check validation is provided by the green hosted run, not an unrun local full gate.

@steipete
steipete merged commit 82a74b1 into main Sep 6, 2026
128 checks passed
@steipete
steipete deleted the codex/qa30-30-note-line-separators-20260905 branch September 6, 2026 02:07
@steipete

steipete commented Sep 6, 2026

Copy link
Copy Markdown
Contributor Author

Merged via squash.

vincentkoc added a commit that referenced this pull request Sep 6, 2026
* origin/main:
  fix(cli): keep note text with Windows and Unicode line endings (#139512)
  fix(agents): keep isolated completion context on its admitted generation (#139607)
  fix: avoid declaration builds during source-server updates (#139392)
  fix(models): keep discovered models after catalog refresh failures (#139357)
  fix(gateway): record a transcript notice when a run fails before replying (#139439)
  refactor(ios): reuse shared integer conversion (#139581)
  fix(sessions): prevent database lock failures during reclamation (#139469)
  perf(test): reuse transforms within owned scheduler slots (#139553)
  test(agents): share sparse transcript input fixtures (#139589)
  chore(ui): refresh control ui locales (#139481)
  fix(slack): keep prototype-named emoji shortcodes intact (#136374)
  fix(gateway): deliver upgrade rejection responses under Bun (#139516)
  refactor(test): simplify catalog guards and fix native report fixture (#139496)
  fix(macos): prevent dashboard fixture loopback timeouts (#139556)
  fix(matrix): preserve selected reply targets inside threads (#139479)
vincentkoc added a commit to ylcn91/openclaw that referenced this pull request Sep 6, 2026
* commit '6c55a99226ed0611ca088004c81b00fb296f1f71': (182 commits)
  test(ui): scope dashboard settings setup to the top frame (openclaw#139618)
  refactor(skills): share pending proposal creation (openclaw#139617)
  fix(release): accept frozen targets before worker bundles (openclaw#136699)
  fix(gateway): preserve percent sequences in media filenames (openclaw#139508)
  fix: preserve current update availability alongside update history (openclaw#139501)
  feat(diagnostics): expose garbage collection duration metrics (openclaw#139592)
  fix(ui): keep Logbook timestamps clear of the activity stripe (openclaw#139539)
  fix(ui): keep Swarm outcomes visible after completion (openclaw#139490)
  test: check file accessibility without runtime-specific return values (openclaw#139590)
  refactor(sdk): keep helper types private (openclaw#139601)
  fix(cron): preserve current-session delivery intent (openclaw#139491)
  fix: prevent browser profile permission hangs in Doctor (openclaw#139612)
  fix(agents): repair storage-failure test fixture after failover owner move (openclaw#139531)
  fix(cli): keep note text with Windows and Unicode line endings (openclaw#139512)
  fix(agents): keep isolated completion context on its admitted generation (openclaw#139607)
  fix: avoid declaration builds during source-server updates (openclaw#139392)
  fix(models): keep discovered models after catalog refresh failures (openclaw#139357)
  fix(gateway): record a transcript notice when a run fails before replying (openclaw#139439)
  refactor(ios): reuse shared integer conversion (openclaw#139581)
  fix(sessions): prevent database lock failures during reclamation (openclaw#139469)
  ...
vincentkoc added a commit that referenced this pull request Sep 6, 2026
* commit 'refs/openclaw/tasks/pr-135167-main-latest':
  test(ui): scope dashboard settings setup to the top frame (#139618)
  refactor(skills): share pending proposal creation (#139617)
  fix(release): accept frozen targets before worker bundles (#136699)
  fix(gateway): preserve percent sequences in media filenames (#139508)
  fix: preserve current update availability alongside update history (#139501)
  feat(diagnostics): expose garbage collection duration metrics (#139592)
  fix(ui): keep Logbook timestamps clear of the activity stripe (#139539)
  fix(ui): keep Swarm outcomes visible after completion (#139490)
  test: check file accessibility without runtime-specific return values (#139590)
  refactor(sdk): keep helper types private (#139601)
  fix(cron): preserve current-session delivery intent (#139491)
  fix: prevent browser profile permission hangs in Doctor (#139612)
  fix(agents): repair storage-failure test fixture after failover owner move (#139531)
  fix(cli): keep note text with Windows and Unicode line endings (#139512)
  fix(agents): keep isolated completion context on its admitted generation (#139607)
  fix: avoid declaration builds during source-server updates (#139392)
  fix(models): keep discovered models after catalog refresh failures (#139357)
  fix(gateway): record a transcript notice when a run fails before replying (#139439)
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Sep 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

maintainer Maintainer-authored PR P2 Normal backlog priority with limited blast radius. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. size: XS status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant