Skip to content

fix(cli): keep commitments table columns aligned - #96039

Closed
markoub wants to merge 1 commit into
openclaw:mainfrom
markoub:markoub/commitments-truncate-width
Closed

markoub wants to merge 1 commit into
openclaw:mainfrom
markoub:markoub/commitments-truncate-width

Conversation

@markoub

@markoub markoub commented Jun 23, 2026

Copy link
Copy Markdown
Contributor

Closes #95921

What Problem This Solves

Fixes an issue where users running openclaw commitments would see the fixed-width table drift out of alignment when long commitment fields were truncated.

The commitments table reserved one character for truncation but appended the three-character string ..., so every truncated cell overflowed its padEnd width by two characters and shifted later columns.

Why This Change Was Made

The table truncation helper now uses a single ellipsis character for shortened values, matching the one-character budget used before padding. A focused regression test covers a long commitment row and verifies that each displayed value starts under the same column as its header.

This is limited to the text table output path; JSON output and commitment storage/delivery behavior are unchanged.

User Impact

Users can read openclaw commitments output reliably even when commitment ids, agent ids, recipient addresses, or suggested text are long enough to be truncated.

Evidence

AI-assisted: yes. I used Codex to inspect the issue, implement the patch, and run validation; I reviewed the final diff and understand the change.

Validation run locally:

node scripts/run-vitest.mjs src/commands/commitments.test.ts
# Test Files 1 passed (1), Tests 5 passed (5)

git diff --check origin/main...HEAD
pnpm changed:lanes --json
# lanes: core=true, coreTests=true; changed paths limited to src/commands/commitments.ts and src/commands/commitments.test.ts
pnpm exec oxfmt --check src/commands/commitments.ts src/commands/commitments.test.ts
pnpm exec oxlint src/commands/commitments.ts src/commands/commitments.test.ts
codex review --base origin/main
# No concrete regression identified in the touched command, callers, or adjacent CLI docs.

@openclaw-barnacle openclaw-barnacle Bot added commands Command implementations size: XS labels Jun 23, 2026
@clawsweeper

clawsweeper Bot commented Jun 23, 2026 •

Copy link
Copy Markdown
Contributor

Thanks for the context here. I swept through the related work, and this is now duplicate or superseded.

Close: the same useful fix is already covered by an open, clean, proof-positive canonical sibling with broader regression coverage; this PR is directionally correct but redundant and lacks its own real CLI behavior proof.

Root-cause cluster
Relationship: superseded
Canonical: #95923
Summary: This PR is one of several candidate fixes for the same commitments table truncation bug; the proof-positive open sibling is the safer canonical landing path.

Members:

Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything.

Canonical path: Land #95923 as the canonical commitments-table fix, then close the duplicate candidate PRs and the linked issue after merge.

So I’m closing this here and keeping the remaining discussion on #95923.

Review details

Best possible solution:

Land #95923 as the canonical commitments-table fix, then close the duplicate candidate PRs and the linked issue after merge.

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

Yes. Source inspection and a focused helper evaluation show current main returns an 18-character truncated ID for a 16-character cell, which deterministically shifts later fixed-width columns.

Is this the best way to solve the issue?

No for this PR as the landing vehicle, though the fix direction is correct. The open canonical sibling applies the same one-character ellipsis fix with stronger regression coverage and real CLI proof.

Security review:

Security review cleared: The diff only changes CLI string formatting and colocated tests; it does not touch dependencies, workflows, secrets, package metadata, or other supply-chain surfaces.

AGENTS.md: found and applied where relevant.

What I checked:

  • Current main still has the bug: On current main, the commitments table helper slices to maxChars - 1 and appends the three-character ..., which can overflow fixed-width cells before padEnd() runs. (src/commands/commitments.ts:26, 654544b6b7c4)
  • Source-level reproduction: A current-main equivalent helper turns cm_abcdefghijklmnopqrstuvwxyz into an 18-character value for a 16-character column, proving the reported alignment bug from source. (src/commands/commitments.ts:26, 654544b6b7c4)
  • Sibling CLI invariant: The adjacent flows and tasks table helpers already reserve one character and append …, supporting the one-character ellipsis fix direction. (src/commands/flows.ts:30, 654544b6b7c4)
  • Current PR diff: The current PR changes the same helper to use … and adds one focused alignment test, but its body only reports tests and local checks, not a real after-fix openclaw commitments run. (src/commands/commitments.ts:26, 1068c1a0a17e)
  • Canonical sibling is viable: The canonical sibling is open, mergeable, clean, maintainer-editable, includes real openclaw commitments terminal proof, and adds broader command-output regression tests for ID and Scope alignment. (src/commands/commitments.test.ts:109, 8abd07755516)
  • Latest release still has old behavior: The latest release tag v2026.6.9 points at c645ec4555c017931de0e35ad9847dffae2741ef, whose commitments helper still appends ...; the bug is real but not yet shipped fixed. (src/commands/commitments.ts:26, c645ec4555c0)

Likely related people:

  • vincentkoc: Current-main blame points the commitments truncation helper to Vincent Koc, and recent GitHub commit history for src/commands/commitments.ts includes release/current-main touches by the same handle. (role: introduced behavior and recent area contributor; confidence: high; commits: fa263affd584, c645ec4555c0, 858a4471bd39; files: src/commands/commitments.ts, src/commands/commitments.test.ts, src/cli/program/register.status-health-sessions.ts)
  • steipete: Recent history for commitments and sibling CLI table helpers includes commitments timestamp handling and command table refactors by Peter Steinberger. (role: adjacent CLI command contributor; confidence: medium; commits: b13fb788b537, de1dfab03ef0, f72762ae8fc8; files: src/commands/commitments.ts, src/commands/commitments.test.ts, src/commands/tasks.ts)
  • parveshsaini: The canonical issue and proof-positive sibling PR for the same root cause come from this contributor, making them relevant for duplicate cleanup routing even though they are not current-main ownership evidence. (role: canonical bug reporter and candidate-fix author; confidence: medium; commits: 8abd07755516; files: src/commands/commitments.ts, src/commands/commitments.test.ts)

Codex review notes: model internal, reasoning high; reviewed against 654544b6b7c4.

@clawsweeper clawsweeper Bot added rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. labels Jun 23, 2026
@markoub

markoub commented Jun 23, 2026

Copy link
Copy Markdown
Contributor Author

Closing as superseded by the canonical proof-positive fix in #95923, per ClawSweeper's duplicate/root-cause triage. Thanks for the review.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

commands Command implementations P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. size: XS status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: openclaw commitments table misaligns - truncate() appends a 3-char "..." but reserves 1 char, overflowing padEnd columns by 2

1 participant