Skip to content

refactor(terminal): simplify copy-sensitive token checks - #146934

Merged
vincentkoc merged 1 commit into
mainfrom
refactor/terminal-note-token-classification-20260913
Sep 13, 2026
Merged

vincentkoc merged 1 commit into
mainfrom
refactor/terminal-note-token-classification-20260913

Conversation

@vincentkoc

@vincentkoc vincentkoc commented Sep 13, 2026 •

Copy link
Copy Markdown
Member

What Problem This Solves

Terminal note wrapping repeats path-prefix checks already covered by its slash and backslash checks.

User Impact

No user-visible behavior changes.

Why This Change Was Made

Remove the redundant checks and retain file-like underscore handling. Production changes: −19 lines; tests unchanged.

Evidence

  • 11,127 actual predicate inputs matched the original; downstream wrapping source is byte-identical. This does not claim execution of width measurement or the terminal renderer. Existing public wrapping tests passed on the exact head in hosted CI.
  • Independent source review and fresh P2 autoreview are clean. Targeted formatting and the normal commit hook passed with installed oxfmt 0.65.0.
  • Exact-head CI 34752315164, attempt 1 passed. Job 103710903284 executed all 21 wrapNoteMessage cases and 74 renderTable cases successfully; current lint/type/format gates passed. The shared local install was not reconciled.

@vincentkoc vincentkoc self-assigned this Sep 13, 2026
@clawsweeper

clawsweeper Bot commented Sep 13, 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 13, 2026
@vincentkoc
vincentkoc marked this pull request as ready for review September 13, 2026 10:36
@clawsweeper clawsweeper Bot added P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. 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 13, 2026
@clawsweeper

clawsweeper Bot commented Sep 13, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed September 13, 2026, 6:41 AM ET / 10:41 UTC.

ClawSweeper review

What this changes

Simplifies terminal note wrapping by removing redundant URL and path-prefix checks while preserving copyable paths and underscore-containing filenames.

Merge readiness

✅ Ready for maintainer review

Keep open: the simplification preserves string classification, introduces no identified defect, and remains absent from inspected main. This member-authored, maintainer-labeled PR is protected from automatic closure.

Priority: P3
Reviewed head: 0873e6c1cd72d8f4e489eaadca0d1253c8f27d34

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A focused, equivalent simplification with existing behavioral coverage and no actionable correctness finding.
Proof confidence 🌊 off-meta tidepool Not applicable: The MEMBER-authored cleanup is exempt from external-contributor runtime proof; the reported predicate comparison is supplemental and does not demonstrate terminal rendering.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Not applicable Not applicable: The MEMBER-authored cleanup is exempt from external-contributor runtime proof; the reported predicate comparison is supplemental and does not demonstrate terminal rendering.
Evidence reviewed 7 items Introduced change and equivalence: The pinned introduction removes only redundant predicate branches and their regex constants. Every removed positive match contains a slash or backslash; the retained condition covers all of them. Empty strings still return false, and the file-like underscore condition is unchanged.
Production caller boundary: The complete module normalizes incoming messages to strings and splits them into nonempty string words before classification. Downstream wrapping, width calculation, suppression, and output routing are unchanged.
Existing behavioral coverage: Existing wrapping tests protect long filesystem paths, URLs, underscore tokens, Windows paths, UNC paths, ordinary word fragmentation, and terminal output width. These tests were inspected, not executed.
Findings None None.
Security None None.

How this fits together

Terminal notes display messages from CLI commands and setup flows. Their wrapping logic keeps paths and URLs intact before passing formatted text to the terminal renderer.

flowchart LR
  A[CLI and setup messages] --> B[Normalize note text]
  B --> C[Measure and classify words]
  C --> D[Preserve copyable tokens]
  C --> E[Wrap ordinary words]
  D --> F[Render terminal note]
  E --> F
Loading

Before merge

None.

Agent review details

Security

None.

PR surface

Source -19. Total -19 across 1 file.

View PR surface stats
Area Files Added Removed Net
Source 1 0 19 -19
Tests 0 0 0 0
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 1 0 19 -19

Review metrics

None.

Technical review

Best possible solution:

Keep token classification in the existing wrapping owner with the simpler equivalent predicate and retain the public wrapping tests.

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

Not applicable: this PR claims no behavioral defect; source inspection establishes that the removed conditions are redundant for the caller's string inputs.

Is this the best way to solve the issue?

Yes: removing subsumed checks is a narrow simplification that preserves the existing owner, public API, and wrapping behavior.

AGENTS.md: found and applied where relevant.

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

Labels

Label changes:

  • add P3: This is a bounded, behavior-preserving cleanup of terminal formatting logic.
  • add rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🌊 off-meta tidepool and patch quality is 🐚 platinum hermit.
  • add status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Not applicable: The MEMBER-authored cleanup is exempt from external-contributor runtime proof; the reported predicate comparison is supplemental and does not demonstrate terminal rendering.

Label justifications:

  • P3: This is a bounded, behavior-preserving cleanup of terminal formatting logic.
  • 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 MEMBER-authored cleanup is exempt from external-contributor runtime proof; the reported predicate comparison is supplemental and does not demonstrate terminal rendering.

Evidence

What I checked:

  • Introduced change and equivalence: The pinned introduction removes only redundant predicate branches and their regex constants. Every removed positive match contains a slash or backslash; the retained condition covers all of them. Empty strings still return false, and the file-like underscore condition is unchanged. (packages/terminal-core/src/note.ts:22, 0873e6c1cd72)
  • Production caller boundary: The complete module normalizes incoming messages to strings and splits them into nonempty string words before classification. Downstream wrapping, width calculation, suppression, and output routing are unchanged. (packages/terminal-core/src/note.ts:45, 0873e6c1cd72)
  • Existing behavioral coverage: Existing wrapping tests protect long filesystem paths, URLs, underscore tokens, Windows paths, UNC paths, ordinary word fragmentation, and terminal output width. These tests were inspected, not executed. (packages/terminal-core/src/table.test.ts:973, 0873e6c1cd72)
  • Current-main necessity check: Inspected main still contains the redundant URL, path-prefix, Windows-drive, and empty-string branches. The branch therefore retains a distinct cleanup contribution; no merged replacement was established. (packages/terminal-core/src/note.ts:24, f3bdcc10d628)
  • Area history and routing: The bounded main-history inspection identifies repeated recent terminal-note work by Peter Steinberger, including fragment emission, grapheme iteration, line-ending preservation, and width reuse. GitHub commit metadata independently identifies steipete for the fragment-emission change. This supports routing, not original feature attribution. (packages/terminal-core/src/note.ts, 3111f4a1eb16)
  • Captured proof and review limits: The supplied body reports 11,127 matching predicate inputs and expressly excludes renderer execution. The author association is MEMBER and the maintainer label is present. Deeper local history encountered an unavailable object; release-source retrieval and GitHub canonical search were unavailable. No release inclusion or complete original-introduction history is claimed. (0873e6c1cd72)

Likely related people:

  • steipete: 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.

@vincentkoc
vincentkoc merged commit 818a9c7 into main Sep 13, 2026
187 checks passed
@vincentkoc
vincentkoc deleted the refactor/terminal-note-token-classification-20260913 branch September 13, 2026 12:58
@vincentkoc

Copy link
Copy Markdown
Member Author

Merged via squash.

vincentkoc added a commit that referenced this pull request Sep 13, 2026
* temp/pr-145950: (101 commits)
  refactor(memory-wiki): share freshness result construction (#146935)
  improve(gateway): use metadata projection for presence (#146817)
  test(agents): reuse complete Responses model fixtures (#147015)
  fix(sessions): align the reclamation-memory test with the archive session owner (#147028)
  refactor(terminal): simplify copy-sensitive token checks (#146934)
  refactor(media): remove duplicate spaced path fallback (#146933)
  refactor(cli): reuse command-group names (#146893)
  improve(plugins): reduce JavaScript generation capture work (#146993)
  test: align plugin fixtures with current runtime contracts (#147000)
  refactor(browser): separate session tab tracking from cleanup (#146973)
  fix(tests): make systemd clock fixtures private (#146990)
  fix(linux): retire sleep guards when logind disconnects (#146046)
  refactor(matrix): share draft fallback delivery (#144840)
  fix(sessions): preserve cross-agent replies after reload (#146799)
  test(models): cover quota recovery during catalog discovery (#146708)
  fix(macos): recover browser sign-in when no browser opens (#146787)
  fix(process): prevent one-shot agents exiting while polling (#144268)
  fix(status): label the session inventory as stored (#146979)
  fix: avoid repeated background reads while loading chat (#146953)
  refactor(ui): narrow Skill Workshop proposal context (#146977)
  ...
vincentkoc added a commit that referenced this pull request Sep 13, 2026
* commit '060e856e5f9df245d63c98990fcb47e18108c6b9': (97 commits)
  refactor(memory-wiki): share freshness result construction (#146935)
  improve(gateway): use metadata projection for presence (#146817)
  test(agents): reuse complete Responses model fixtures (#147015)
  fix(sessions): align the reclamation-memory test with the archive session owner (#147028)
  refactor(terminal): simplify copy-sensitive token checks (#146934)
  refactor(media): remove duplicate spaced path fallback (#146933)
  refactor(cli): reuse command-group names (#146893)
  improve(plugins): reduce JavaScript generation capture work (#146993)
  test: align plugin fixtures with current runtime contracts (#147000)
  refactor(browser): separate session tab tracking from cleanup (#146973)
  fix(tests): make systemd clock fixtures private (#146990)
  fix(linux): retire sleep guards when logind disconnects (#146046)
  refactor(matrix): share draft fallback delivery (#144840)
  fix(sessions): preserve cross-agent replies after reload (#146799)
  test(models): cover quota recovery during catalog discovery (#146708)
  fix(macos): recover browser sign-in when no browser opens (#146787)
  fix(process): prevent one-shot agents exiting while polling (#144268)
  fix(status): label the session inventory as stored (#146979)
  fix: avoid repeated background reads while loading chat (#146953)
  refactor(ui): narrow Skill Workshop proposal context (#146977)
  ...
vincentkoc added a commit that referenced this pull request Sep 13, 2026
* temp/pr-137049: (110 commits)
  improve: reduce GitHub OAuth maintenance work for large agent rosters (#147021)
  fix(test): avoid settings lock writer startup timeouts (#147029)
  fix(update): correct backup guidance and cover incident regressions (#147023)
  refactor(gateway): share connection lifecycle across transports (#145950)
  refactor(telegram): share HTML text escaping (#146936)
  perf(build): reduce disk use in UI performance checks (#146687)
  refactor(memory-wiki): share freshness result construction (#146935)
  improve(gateway): use metadata projection for presence (#146817)
  test(agents): reuse complete Responses model fixtures (#147015)
  fix(sessions): align the reclamation-memory test with the archive session owner (#147028)
  refactor(terminal): simplify copy-sensitive token checks (#146934)
  refactor(media): remove duplicate spaced path fallback (#146933)
  refactor(cli): reuse command-group names (#146893)
  improve(plugins): reduce JavaScript generation capture work (#146993)
  test: align plugin fixtures with current runtime contracts (#147000)
  refactor(browser): separate session tab tracking from cleanup (#146973)
  fix(tests): make systemd clock fixtures private (#146990)
  fix(linux): retire sleep guards when logind disconnects (#146046)
  refactor(matrix): share draft fallback delivery (#144840)
  fix(sessions): preserve cross-agent replies after reload (#146799)
  ...
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Sep 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

maintainer Maintainer-authored PR P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. 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