You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
trimMiddle: negative edge for maxLength<120 overflows output and reports impossible truncated count #571
P3Low-risk cleanup, docs, polish, ergonomics, or speculative feature.clawsweeper:needs-live-reproClawSweeper needs live local, crabbox, or manual validation to confirm this issue.clawsweeper:needs-maintainer-reviewClawSweeper marked this issue as needing maintainer review before automation.clawsweeper:no-new-fix-prClawSweeper does not recommend queueing a new automated fix PR for this issue.issue-rating: 🐚 platinum hermitGood issue quality with a plausible reproduction path needing some confirmation.
trimMiddle(text, maxLength) in src/clawsweeper-text.ts:11 computes edge = Math.floor((maxLength - 120) / 2), which goes negative for any maxLength < 120. The head/tail slices then take from the wrong ends and the reported "truncated N chars" count exceeds the input length.
Repro (property-test found via einsiedlerkrebs):
trimMiddle("x".repeat(25), 20) => length 31 (> maxLength 20), text says "truncated 125 chars" for a 25-char input
Invariants violated: result length should be ~<= maxLength, and the reported removed-count should be in [0, text.length]. Guard edge to a sane minimum (and/or short-circuit when maxLength is below the header overhead).
Codex review: keeping this open for maintainer follow-up; there is still a little grit to resolve. Reviewed July 18, 2026, 10:35 PM ET / July 19, 2026, 02:35 UTC.
Summary
Keep open: the merged implementation PR was deliberately narrowed to the separate compactText issue, and the recent reopening note explicitly confirms that this issue’s trimMiddle fix was removed before merge. This remains a small, independently reported boundary bug for maintainer triage.
Reproducibility: no. high-confidence current-main execution was captured in this read-only review. The report provides a concrete source-level path and input/cap pair, so the bug is source-reproducible with focused helper coverage.
Ways to help us reproduce this
Add a screenshot or short recording showing the behavior.
Include the exact command, prompt, or workflow that triggered it.
Add expected vs actual behavior.
Next step
Recent human direction reopened this separate bug for maintainer triage, while the clawsweeper:no-new-fix-pr label means ClawSweeper should not dispatch a duplicate repair automatically.
Maintainer decision needed
Question: Should maintainers sponsor a narrow follow-up fix for trimMiddle now that the prior merged PR intentionally excluded this separate boundary bug?
Rationale: The defect is concrete and likely small, but the item carries clawsweeper:no-new-fix-pr and recent human direction explicitly restored it for separate maintainer triage rather than automatic duplicate dispatch.
Likely owner: steipete — The latest human decision on the merged PR scope and this issue’s reopened state came from steipete.
Options:
Sponsor a focused repair (recommended): Create or approve one narrow follow-up that bounds low-cap trimMiddle output and adds regression coverage for the reported invariants.
Defer the helper change: Leave the issue open until the current maintenance priorities permit a separately reviewed text-helper repair.
Review details
Best possible solution:
Add a narrow trimMiddle low-cap path that never returns more than maxLength, reports a removed count within the input length, and is protected by focused boundary tests around caps below 120.
Do we have a high-confidence way to reproduce the issue?
No high-confidence current-main execution was captured in this read-only review. The report provides a concrete source-level path and input/cap pair, so the bug is source-reproducible with focused helper coverage.
Is this the best way to solve the issue?
Yes. A narrow low-cap guard or short-circuit in trimMiddle, with boundary regression tests, directly restores the stated output-length and removed-count invariants without adding product surface.
AGENTS.md: found and applied where relevant.
Remaining risk / open question:
A fix should preserve trimMiddle’s normal middle-truncation behavior while defining a bounded result and truthful removed-count for caps smaller than the marker overhead.
The previous linked PR is merged but intentionally does not own this fix, so reopening a duplicate implementation against that branch would be incorrect.
Codex review notes: model internal, reasoning high; reviewed against f8d5393f5894.
Label changes
Label changes:
add issue-rating: 🐚 platinum hermit: Current issue advisory state selects this label.
add clawsweeper:needs-live-repro: Current issue advisory state selects this label.
add clawsweeper:needs-maintainer-review: Current issue advisory state selects this label.
remove issue-rating: 🦞 diamond lobster: Current issue advisory state no longer selects this label.
remove clawsweeper:source-repro: Current issue advisory state no longer selects this label.
remove clawsweeper:linked-pr-open: Current issue advisory state no longer selects this label.
Label justifications:
P3: This is a bounded text-formatting edge case with a clear invariant violation but no evidence of data loss, security impact, runtime unavailability, or broken message delivery.
Concrete source-level report: The issue identifies the negative edge calculation in src/clawsweeper-text.ts and gives a specific 25-character, cap-20 boundary case where the returned result and removed-count invariant fail. (src/clawsweeper-text.ts:11)
Likely related people:
steipete: Reopened this issue immediately after merging the narrowed PR and documented that the merged change does not fix this separate behavior. (role: recent merger and triage decision owner; confidence: high; commits: f8d5393f5894)
brokemac79: Provided the earlier maintenance-pass direction for reviewing this report alongside its linked implementation before that implementation was narrowed. (role: recent triage contributor; confidence: medium)
How this review workflow works
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.
Thanks for the report. We?ve confirmed this is separate from the recent ClawSweeper review/publication stability incident.
Our immediate priority is keeping the recovered path stable and completing a careful maintainer review of outstanding changes. We will review this report and its linked implementation together in the next maintenance pass, then leave a specific decision here.
Please do not treat this as a request for further changes at present.
I asked ClawSweeper to review this item again.
Action: item re-review queued (workflow sweep.yml, event repository_dispatch).
Result: the existing ClawSweeper review comment will be edited in place when the review finishes.
Re-review progress:
State: Complete
Detail: The durable review comment was published and its verdict was queued for target-serialized routing.
Reopening: #576 was deliberately narrowed before merge to the compactText fix for #573 only. This issue's implementation was removed from the final diff, so the merge did not fix it. GitHub nevertheless applied the PR's older closing relationship at merge time.
No new contributor changes requested. This restores the pre-merge open state for separate maintainer triage.
P3Low-risk cleanup, docs, polish, ergonomics, or speculative feature.clawsweeper:needs-live-reproClawSweeper needs live local, crabbox, or manual validation to confirm this issue.clawsweeper:needs-maintainer-reviewClawSweeper marked this issue as needing maintainer review before automation.clawsweeper:no-new-fix-prClawSweeper does not recommend queueing a new automated fix PR for this issue.issue-rating: 🐚 platinum hermitGood issue quality with a plausible reproduction path needing some confirmation.
Activity
clawsweeper commentedon Jul 15, 2026
Codex review: keeping this open for maintainer follow-up; there is still a little grit to resolve. Reviewed July 18, 2026, 10:35 PM ET / July 19, 2026, 02:35 UTC.
Summary
Keep open: the merged implementation PR was deliberately narrowed to the separate
compactTextissue, and the recent reopening note explicitly confirms that this issue’strimMiddlefix was removed before merge. This remains a small, independently reported boundary bug for maintainer triage.Reproducibility: no. high-confidence current-main execution was captured in this read-only review. The report provides a concrete source-level path and input/cap pair, so the bug is source-reproducible with focused helper coverage.
Ways to help us reproduce this
Next step
Recent human direction reopened this separate bug for maintainer triage, while the
clawsweeper:no-new-fix-prlabel means ClawSweeper should not dispatch a duplicate repair automatically.Maintainer decision needed
trimMiddlenow that the prior merged PR intentionally excluded this separate boundary bug?clawsweeper:no-new-fix-prand recent human direction explicitly restored it for separate maintainer triage rather than automatic duplicate dispatch.trimMiddleoutput and adds regression coverage for the reported invariants.Review details
Best possible solution:
Add a narrow
trimMiddlelow-cap path that never returns more thanmaxLength, reports a removed count within the input length, and is protected by focused boundary tests around caps below 120.Do we have a high-confidence way to reproduce the issue?
No high-confidence current-main execution was captured in this read-only review. The report provides a concrete source-level path and input/cap pair, so the bug is source-reproducible with focused helper coverage.
Is this the best way to solve the issue?
Yes. A narrow low-cap guard or short-circuit in
trimMiddle, with boundary regression tests, directly restores the stated output-length and removed-count invariants without adding product surface.AGENTS.md: found and applied where relevant.
Remaining risk / open question:
trimMiddle’s normal middle-truncation behavior while defining a bounded result and truthful removed-count for caps smaller than the marker overhead.Codex review notes: model internal, reasoning high; reviewed against f8d5393f5894.
Label changes
Label changes:
issue-rating: 🐚 platinum hermit: Current issue advisory state selects this label.clawsweeper:needs-live-repro: Current issue advisory state selects this label.clawsweeper:needs-maintainer-review: Current issue advisory state selects this label.issue-rating: 🦞 diamond lobster: Current issue advisory state no longer selects this label.clawsweeper:source-repro: Current issue advisory state no longer selects this label.clawsweeper:linked-pr-open: Current issue advisory state no longer selects this label.Label justifications:
P3: This is a bounded text-formatting edge case with a clear invariant violation but no evidence of data loss, security impact, runtime unavailability, or broken message delivery.Evidence reviewed
What I checked:
compactText(value, maxLength)and close compactText: overflows maxLength for small caps (returns bare '...') #573; they do not claim an after-fix result fortrimMiddle. (src/repair/text-utils.ts:1, f8d5393f5894)edgecalculation insrc/clawsweeper-text.tsand gives a specific 25-character, cap-20 boundary case where the returned result and removed-count invariant fail. (src/clawsweeper-text.ts:11)Likely related people:
How this review workflow works
@clawsweeper re-reviewcomments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.@clawsweeper re-reviewor@clawsweeper re-runon an open PR or issue to request a fresh review only.@clawsweeper reviewto request a fresh review only.@clawsweeper autofix,@clawsweeper automerge,@clawsweeper fix ci, or@clawsweeper address review.@clawsweeper explainto ask for more context, or@clawsweeper stopto stop active automation.fix(text): harden string helpers against small/degenerate inputs
brokemac79 commentedon Jul 16, 2026
Thanks for the report. We?ve confirmed this is separate from the recent ClawSweeper review/publication stability incident.
Our immediate priority is keeping the recovered path stable and completing a careful maintainer review of outstanding changes. We will review this report and its linked implementation together in the next maintenance pass, then leave a specific decision here.
Please do not treat this as a request for further changes at present.
brokemac79 commentedon Jul 18, 2026
@clawsweeper re-review
clawsweeper commentedon Jul 18, 2026
🦞🧹
ClawSweeper re-review requested.
I asked ClawSweeper to review this item again.
Action: item re-review queued (workflow
sweep.yml, eventrepository_dispatch).Result: the existing ClawSweeper review comment will be edited in place when the review finishes.
Re-review progress:
steipete commentedon Jul 19, 2026
Reopening: #576 was deliberately narrowed before merge to the
compactTextfix for #573 only. This issue's implementation was removed from the final diff, so the merge did not fix it. GitHub nevertheless applied the PR's older closing relationship at merge time.No new contributor changes requested. This restores the pre-merge open state for separate maintainer triage.
steipete commentedon Jul 19, 2026
Fixed by #687.
Proof:
a8336b7cbdc3760234b0af2030804d6b98e23bd8fix(text): bound compactText for tiny caps (openclaw#576)
fix(text): bound compactText for tiny caps (openclaw#576)