Repository navigation
refactor(cli): simplify message result rendering - #131980
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. |
|
Codex review: needs maintainer review before merge. Reviewed August 28, 2026, 2:06 PM ET / 18:06 UTC. ClawSweeper reviewWhat this changesThe PR removes array wrappers from private CLI message-result table renderers and combines the duplicated read and pinned-message formatting paths without changing the public Merge readinessNo introduced regression was found: the private helpers now return their sole string directly while the public formatter still returns terminal lines. Keep this maintainer-authored, Priority: P3 Review scores
Verification
How this fits togetherThe flowchart LR
A[Message CLI command] --> B[Channel operation result]
B --> C[CLI result formatter]
C --> D{Action type}
D --> E[Read pins search reactions]
D --> F[Generic summary]
E --> G[Terminal lines]
F --> G
Before merge
Agent review detailsSecurityNone. PR surfaceSource -44, Other 0. Total -44 across 2 files. View PR surface stats
Review metrics
Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Land the compact private-helper refactor after exact-head CI is green and the current ClawSweeper review note has been checked for outstanding rank-up moves. Do we have a high-confidence way to reproduce the issue? Not applicable: this is an internal refactor, and source comparison shows that the observable terminal-line paths remain equivalent. Is this the best way to solve the issue? Yes: returning direct strings from private single-table renderers removes redundant adapters while preserving the public list-of-lines contract. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against e11c566824b1. LabelsLabel justifications:
EvidenceWhat I checked:
Likely related people:
Rank-up movesOptional improvements that raise the rating; they are not merge blockers.
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (1 earlier review cycle)
|
|
Ready to land after exact-head verification of The cleanup removes private single-string array wrappers and merges duplicate read/pins rendering while preserving the public The two existing formatter/command suites passed 51 tests. A separate actual before/after module comparison passed 19,936 cases across widths, limits, color modes, action families, empty results, errors, and payload-read order. Scoped formatting/lint and the full assertion guard passed. The initial CI failure correctly caught the stale assertion budget; the correction changed no production bytes and did not weaken the guard. Complete-change precommit review and distinct independent exact-head review found no actionable issues. CI and Workflow Sanity both completed successfully on the final head. The latest ClawSweeper review covers that head with no source findings. Its rank-up request to read the latest review and complete exact-head checks is satisfied; no rank-up was skipped. |
|
Merged via squash.
|
* refactor(cli): simplify message result rendering * chore(cli): tighten message formatter assertion budget
What Problem This Solves
The message CLI's human-readable formatter wraps individual table strings in arrays, then immediately unwraps them at its call sites. Message reads and pinned-message lists also repeat the same payload extraction, table rendering, and pagination flow. This is a bounded, maintainer-requested, AI-assisted internal cleanup.
Why This Change Was Made
Return one string from each private single-table renderer, remove the two one-use payload adapters, and keep read/pins rendering in one local flow. The public formatter still returns the same list of output lines. Repeated pagination-hint returns share their existing short-circuit condition.
Production changes are +56/-100, net -44 lines in one file. The assertion-safety baseline also tightens this file's count from 21 to 20 because the duplicate adapter casts disappear. No replacement abstraction or new export is introduced.
User Impact
No intended behavior change. Preserve empty output lines, empty-result messages, null versus empty-string handling, table formatting, limits, pagination precedence, reaction evaluation order, and existing send/poll/failure output. CLI flags, parsing, exit status, JSON output, plugin APIs, configuration, and persistence are untouched.
Evidence
OPENCLAW_VITEST_MAX_WORKERS=1 node scripts/run-vitest.mjs src/commands/message-format.test.ts src/commands/message.test.ts: 51 tests passed across two existing suites.0313c2dbc4234df6801626c6441a731dc5de5a19: 356 fixtures across four terminal widths, seven limits, and plain/colored output produced 19,936 matching cases. Public output bytes, thrown error names/messages, and payload-read order matched. The probe imported the real formatter dependencies and used an isolated fixture channel registry, without contacting channel services.oxfmt --check, core oxlint, andgit diff --checkpassed.20 < 21). The owned baseline entry is now 20; the full assertion-safety guard against the frozen base passes. No guard was weakened or unrelated baseline entry pruned.7ad4711bb1cee4a6e0dcea246fc95f9aa3773541found no actionable issues.