Skip to content

fix(commitments): reserve 3 chars for ellipsis in truncate() - #96117

Closed
whiteyzy wants to merge 1 commit into
openclaw:mainfrom
whiteyzy:fix/95921-commitments-truncate-ellipsis
Closed

whiteyzy wants to merge 1 commit into
openclaw:mainfrom
whiteyzy:fix/95921-commitments-truncate-ellipsis

Conversation

@whiteyzy

@whiteyzy whiteyzy commented Jun 23, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Fixes #95921: truncate() reserved only 1 char for ellipsis (maxChars-1) but appended "...", causing +2 overflow breaking fixed-width table columns.

Fix: maxChars-1 → maxChars-3.

Linked context

Closes #95921

Real behavior proof (required for external PRs)

  • Behavior or issue addressed: commitments table columns misaligned due to truncation overflow
  • Real environment tested: macOS, Node v22.22.3, latest upstream/main
  • Exact steps or command run after this patch:
node -e "function t(v,m){return v.length<=m?v:v.slice(0,m-3)+...} console.log(t(0123456789abcdefg,16).length)"
  • Evidence after fix (copied live output): 16 (before fix: 18, overflowed +2)
  • Observed result after fix: Truncated strings exactly match maxChars
  • What was not tested: Full CLI commitments table output

Risk

None — deterministic one-character fix.


🤖 Generated with Claude Code

truncate() reserved maxChars-1 for a single-char ellipsis but
appended the three-character '...', causing truncated values to
overflow by 2 characters. This broke fixed-width padEnd() column
alignment in the commitments table.

Change maxChars-1 to maxChars-3 to match the actual ellipsis width.

Closes openclaw#95921.
@openclaw-barnacle openclaw-barnacle Bot added commands Command implementations size: XS triage: needs-pr-context Candidate: external PR body lacks required problem context or evidence. and removed triage: needs-pr-context Candidate: external PR body lacks required problem context or evidence. labels Jun 23, 2026
@clawsweeper

clawsweeper Bot commented Jun 23, 2026 •

Copy link
Copy Markdown
Contributor

Thanks for the context here. I did a careful shell check against current main, and this is already implemented.

Close: current main already fixes the commitments table truncation bug via #95923, with the repository-preferred single-character ellipsis and regression coverage; this PR is now a redundant conflicting branch.

Root-cause cluster
Relationship: superseded
Canonical: #95923
Summary: This PR is a same-root candidate for the commitments table truncation-width bug, but the canonical sibling has merged and current main now contains the fix.

Members:

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

So I’m closing this as already implemented rather than keeping a duplicate issue open.

Review details

Best possible solution:

Keep the current-main implementation from #95923 and close redundant candidate branches for the same commitments table bug.

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

No current-main failure reproduces from source inspection: truncate() now returns a max-width value using …, and tests assert long ID/scope table alignment. The original bug remains source-visible in v2026.6.10, which still has the old ... helper.

Is this the best way to solve the issue?

No, this PR is no longer the best landing path. The current-main fix uses the established one-character ellipsis convention and includes command-path regression tests, while this branch is redundant and conflicting.

Security review:

Security review cleared: The diff only changes CLI string formatting in one TypeScript command file and does not touch dependencies, workflows, credentials, package metadata, or execution surfaces.

AGENTS.md: found and applied where relevant.

What I checked:

Likely related people:

  • parveshsaini: Authored the merged sibling PR and landed commit that implemented the current-main commitments truncation fix with regression tests. (role: canonical fix author; confidence: high; commits: 33afb1ec70d5, 867c8e0a4841; files: src/commands/commitments.ts, src/commands/commitments.test.ts)
  • vincentkoc: Posted the squash-merge confirmation for the canonical commitments-table fix and linked the landed commit now present on main. (role: merger and routing candidate; confidence: medium; commits: 33afb1ec70d5; files: src/commands/commitments.ts, src/commands/commitments.test.ts)

Codex review notes: model internal, reasoning high; reviewed against d1b917120a47; fix evidence: commit 33afb1ec70d5, main fix timestamp 2026-06-24T07:18:49Z.

@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
@clawsweeper

clawsweeper Bot commented Jun 28, 2026

Copy link
Copy Markdown
Contributor

ClawSweeper applied the proposed close for this PR.

@clawsweeper clawsweeper Bot closed this Jun 28, 2026
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