Skip to content

fix: use single-char ellipsis in commitments truncate() to prevent table misalignment - #96006

Closed
pengxuewu-lab wants to merge 1 commit into
openclaw:mainfrom
pengxuewu-lab:fix/issue-95921-truncate-ellipsis
Closed

pengxuewu-lab wants to merge 1 commit into
openclaw:mainfrom
pengxuewu-lab:fix/issue-95921-truncate-ellipsis

Conversation

@pengxuewu-lab

@pengxuewu-lab pengxuewu-lab commented Jun 23, 2026 •

Copy link
Copy Markdown
Contributor

What Problem This Solves

In openclaw commitments, the truncate() helper reserved only 1 character for the overflow indicator (maxChars - 1) but appended a 3-character ASCII ..., making the truncated string maxChars + 2 characters wide. This caused padEnd-based table columns to misalign — truncated rows pushed past the column boundary, breaking visual alignment of the commitments table output.

Root cause: src/commands/commitments.ts — truncate() appended 3 chars of ellipsis after slicing to maxChars - 1, producing maxChars + 2 total width instead of the expected maxChars.

Fix: Replace ... with single Unicode ellipsis \u2026, matching the identical pattern already used in flows.ts, tasks.ts, and onboard-skills.ts.

Evidence

Fix (commitments.ts, line 27)

 function truncate(value: string, maxChars: string): string {
-  return value.length <= maxChars ? value : `${value.slice(0, maxChars - 1)}...`;
+  return value.length <= maxChars ? value : `${value.slice(0, maxChars - 1)}\u2026`;
 }

Consistency with existing codebase

The single-char Unicode ellipsis is already the repo convention for truncation helpers:

File Ellipsis
src/cli/flows.ts \u2026 (single unicode)
src/cli/tasks.ts \u2026 (single unicode)
src/cli/onboard-skills.ts \u2026 (single unicode)
src/commands/commitments.ts (BEFORE) ... (3-char ASCII)
src/commands/commitments.ts (AFTER) \u2026 (single unicode)

Impact

  • Single-character change; zero behavioral difference for text content
  • padEnd(maxChars) now produces correctly aligned columns since truncated values are exactly maxChars wide
  • Consistent with the existing truncation convention used across the CLI

🤖 Generated with Claude Code

@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 contains the same commitments-table truncation fix and stronger regression coverage from the merged sibling PR, so this branch no longer carries unique work to merge.

Root-cause cluster
Relationship: superseded
Canonical: #95923
Summary: This PR is superseded by a merged PR that implements the same commitments truncation fix and tests it.

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 the merged sibling PR and close duplicate candidate branches for the same commitments table bug.

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

Yes. Source inspection shows the old helper could return an 18-character value for a 16-character column, and current main now has regression tests that exercise the long ID and Scope table rows through commitmentsListCommand.

Is this the best way to solve the issue?

Yes for current main, not this PR as the landing vehicle. The merged sibling PR applies the same one-character ellipsis fix and adds focused command-path coverage, making this one-line branch redundant.

Security review:

Security review cleared: The diff only changes one CLI string-formatting helper and does not touch dependencies, workflows, secrets, package metadata, or code execution setup.

AGENTS.md: found and applied where relevant.

What I checked:

Likely related people:

  • Parvesh Saini: Authored the merged sibling PR that changed the same helper and added the regression tests now present on current main. (role: canonical fix author; confidence: high; commits: 33afb1ec70d5; files: src/commands/commitments.ts, src/commands/commitments.test.ts)
  • vincentkoc: Posted the merge note for the canonical sibling PR and tied the landed commit to the prepared head SHA. (role: merger; confidence: medium; commits: 33afb1ec70d5; files: src/commands/commitments.ts, src/commands/commitments.test.ts)
  • lin-hongkuan: In this shallow/grafted checkout, git blame for the current fixed helper and tests points to commit 67118d5ab9129f6444dc8a65b982ebaec0b3e4ed; this is useful for audit provenance but likely not the original fix author. (role: current-main snapshot provenance; confidence: low; commits: 67118d5ab912; 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-24T15:18:49+08:00.

@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 added rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. and removed rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. labels Jun 28, 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: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. 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.

1 participant