Skip to content

fix(message): thread --limit through to CLI formatter and surface provider pagination hints#99089

Merged
openclaw-clownfish[bot] merged 1 commit into
openclaw:mainfrom
wm0018:fix/message-formatter-display-limit
Jul 6, 2026
Merged

fix(message): thread --limit through to CLI formatter and surface provider pagination hints#99089
openclaw-clownfish[bot] merged 1 commit into
openclaw:mainfrom
wm0018:fix/message-formatter-display-limit

Conversation

@wm0018

@wm0018 wm0018 commented Jul 2, 2026

Copy link
Copy Markdown
Contributor

What Problem This Solves

Refs #71452

The CLI text renderer hard-coded messages.slice(0, 25), so message reads and pin lists could display only 25 rows even when the provider returned more and the user requested a higher --limit.

This is a partial fix for #71452. It removes the formatter bottleneck and surfaces existing pagination metadata, but it does not add end-to-end provider pagination or cursor iteration. Discord search remains limited to one page of up to 25 results; broader pagination stays tracked in #71452.

Why This Change Was Made

The change forwards the parsed CLI --limit into the shared message formatter while preserving the existing default of 25 rows. It also shows a hint when provider response metadata indicates that more results exist.

For Discord search, total_results can indicate that additional matches exist, but it is not a cursor and this PR does not implement Discord's offset-based pagination.

User Impact

  • message read and message pins can render more than 25 rows when the provider returns them and the user requests a higher limit.
  • Existing provider pagination metadata is visible in text output instead of being silently discarded.
  • Default text output remains capped at 25 rows when --limit is omitted.
  • JSON output is unchanged.
  • Multi-page iteration, including Discord search beyond its 25-result page, is not implemented by this PR.

Evidence

  • Added focused formatter coverage for read, pins, search, default limits, and pagination hints.
  • Existing message command coverage remained green.
  • PR-head CI completed successfully for 3364c11fd616e872c800a81ecac2802249dc4462.

@openclaw-barnacle openclaw-barnacle Bot added commands Command implementations size: M labels Jul 2, 2026
@clawsweeper

clawsweeper Bot commented Jul 2, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed July 2, 2026, 8:57 PM ET / 00:57 UTC.

Summary
The branch threads message --limit into CLI text rendering, adds pagination hints for provider cursor metadata and Discord search totals, and adds formatter tests.

PR surface: Source +66, Tests +191. Total +257 across 3 files.

Reproducibility: yes. Current main exposes --limit for message read, pins, and search, while renderMessageList still slices rendered rows to 25 and messageCommand does not forward the caller limit.

Review metrics: none identified.

Root-cause cluster
Relationship: fixed_by_candidate
Canonical: #71452
Summary: This PR is a candidate fix for the canonical shared message formatter display-limit and pagination-display issue.

Members:

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

Merge readiness
Overall: 🐚 platinum hermit
Proof: 🐚 platinum hermit
Patch quality: 🦞 diamond lobster
Result: ready for maintainer review.

Overall follows the weaker of proof and patch quality, so missing proof can cap an otherwise strong patch.

Rank-up moves:

  • [P2] Maintainer should decide whether the broader linked pagination issue needs a separate follow-up before merging with closing syntax.

Risk before merge

  • [P1] The linked issue also mentions broader provider pagination and cursor iteration, so maintainers should decide whether this narrow display-limit and hint fix is enough to close it or whether to track a follow-up.

Maintainer options:

  1. Decide the mitigation before merge
    Land this narrow formatter and CLI bridge fix after maintainer review, and track any broader cross-provider cursor iteration separately if maintainers still want it.
  2. Pause or close
    Do not merge this PR until maintainers decide whether the risk is worth taking.

Next step before merge

  • No automated repair lane is needed because this PR has no concrete blocking finding and is already the open fix candidate for the linked issue.

Security
Cleared: The diff is limited to CLI formatter plumbing and tests, with no dependency, workflow, credential, install, or supply-chain surface change.

Review details

Best possible solution:

Land this narrow formatter and CLI bridge fix after maintainer review, and track any broader cross-provider cursor iteration separately if maintainers still want it.

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

Yes. Current main exposes --limit for message read, pins, and search, while renderMessageList still slices rendered rows to 25 and messageCommand does not forward the caller limit.

Is this the best way to solve the issue?

Yes for the central bug. The shared formatter plus CLI bridge is the narrowest maintainable boundary for the display cap, while broader provider cursor UX can remain separate.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning high; reviewed against 9238d9aeae8d.

Label changes

Label justifications:

  • P2: This is a normal-priority CLI/message rendering bugfix with limited blast radius and focused coverage.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🐚 platinum hermit and patch quality is 🦞 diamond lobster.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Sufficient (live_output): The PR body includes copied after-fix live Matrix CLI output showing the new pagination hint; row-limit behavior is covered by focused formatter tests.
  • proof: sufficient: Contributor real behavior proof is sufficient. The PR body includes copied after-fix live Matrix CLI output showing the new pagination hint; row-limit behavior is covered by focused formatter tests.
Evidence reviewed

PR surface:

Source +66, Tests +191. Total +257 across 3 files.

View PR surface stats
Area Files Added Removed Net
Source 2 76 10 +66
Tests 1 191 0 +191
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 3 267 10 +257

What I checked:

  • Repository policy read: Root AGENTS.md was read fully and its read-beyond-diff, command-surface, proof, and changelog review guidance affected this review; no scoped command-path AGENTS.md or maintainer notes were present. (AGENTS.md:1, 9238d9aeae8d)
  • Current main formatter cap: Current main still renders message rows from messages.slice(0, 25), so text output cannot display more than 25 returned messages, pins, or search rows. (src/commands/message-format.ts:90, 9238d9aeae8d)
  • Current main bridge gap: Current main calls formatMessageCliText(result) without forwarding opts.limit, leaving the renderer unable to honor the already parsed CLI limit. (src/commands/message.ts:135, 9238d9aeae8d)
  • Affected CLI options exist: The read, pins, and search command registrations expose --limit, which makes the hardcoded formatter cap user-visible when the requested limit exceeds 25. (src/cli/program/message/register.read-edit-delete.ts:16, 9238d9aeae8d)
  • Latest release still has bug: Tag v2026.6.11 still contains the hardcoded 25-row cap and no formatter limit forwarding, so the behavior is not shipped-fixed. (src/commands/message-format.ts:90, e085fa1a3ffd)
  • PR head threads display limit: PR head replaces the literal cap with opts.displayLimit ?? 25, preserving the default while allowing text rendering to use caller-provided limits. (src/commands/message-format.ts:92, 3364c11fd616)

Likely related people:

  • steipete: git log -S 'messages.slice(0, 25)' points to the unified message tool and CLI refactor authored as Peter Steinberger, and the canonical issue also has prior review context from this account. (role: introduced formatter behavior and prior reviewer; confidence: high; commits: 3636a2bf51d9; files: src/commands/message-format.ts, src/commands/message.ts)
  • vincentkoc: Recent release/current-main commits carry the existing formatter cap into v2026.6.11 and current main, making this useful shipped-behavior routing context. (role: recent release/current area carrier; confidence: medium; commits: e085fa1a3ffd, 74e7b8d47b18; files: src/commands/message-format.ts, src/commands/message.ts)
  • sudie-codes: The linked issue mentions Teams pagination, and MSTeams message-action history includes the read, pin, unpin, and list-pins provider paths relevant to the broader pagination context. (role: adjacent MSTeams message action contributor; confidence: medium; commits: 0f192710924f, 355794c24a39; files: extensions/msteams/src/graph-messages.ts, extensions/msteams/src/channel.ts)
What the crustacean ranks mean
  • 🦀 challenger crab: rare, exceptional readiness with strong proof, clean implementation, and convincing validation.
  • 🦞 diamond lobster: very strong readiness with only minor maintainer review expected.
  • 🐚 platinum hermit: good normal PR, likely mergeable with ordinary maintainer review.
  • 🦐 gold shrimp: useful signal, but proof or patch confidence is still limited.
  • 🦪 silver shellfish: thin signal; proof, validation, or implementation needs work.
  • 🧂 unranked krab: not merge-ready because proof is missing/unusable or there are serious correctness or safety concerns.
  • 🌊 off-meta tidepool: rating does not apply to this item.

Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics.

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.

@clawsweeper clawsweeper Bot added proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. P2 Normal backlog priority with limited blast radius. labels Jul 2, 2026
@wm0018

wm0018 commented Jul 2, 2026

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Jul 2, 2026

Copy link
Copy Markdown
Contributor

🦞🧹
ClawSweeper re-review requested.

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.

@wm0018
wm0018 force-pushed the fix/message-formatter-display-limit branch from 85783ca to 6672371 Compare July 2, 2026 14:42
@clawsweeper clawsweeper Bot added rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: 🛠️ actively grinding The PR author has acted after the latest ClawSweeper review and work remains. and removed rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. labels Jul 2, 2026
@wm0018
wm0018 force-pushed the fix/message-formatter-display-limit branch from 6672371 to 3364c11 Compare July 3, 2026 00:43
@clawsweeper clawsweeper Bot added rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. and removed rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: 🛠️ actively grinding The PR author has acted after the latest ClawSweeper review and work remains. labels Jul 3, 2026
@openclaw-clownfish
openclaw-clownfish Bot merged commit 4029f1c into openclaw:main Jul 6, 2026
122 of 126 checks passed
@vincentkoc vincentkoc self-assigned this Jul 6, 2026
vincentkoc added a commit to zhangqueping/openclaw that referenced this pull request Jul 6, 2026
* origin/main: (1287 commits)
  fix(android): block loopback canvas navigation (openclaw#99874)
  fix(hooks): suppress unhandled stdout/stderr stream errors in gmail watcher (openclaw#100519)
  fix(memory-core): guard qmd mcporter JSON.parse against non-JSON stdout (openclaw#98381)
  fix(build): fall back to tsx for build TypeScript scripts (openclaw#91262)
  feat(skills): suggest saving detected reusable workflows by default (openclaw#95477) (openclaw#100692)
  docs(changelog): remove generated release-note entries
  feat(telegram): offer BotFather web app flow in setup help and docs (openclaw#100540)
  fix(ios): unify Talk and Settings row typography on one branded detail row (openclaw#100515)
  feat(gateway): add persisted crash-loop breaker and fatal-config exit contract
  refactor(macos): lock and unify PortGuardian tunnel record persistence so concurrent app instances cannot lose orphan records (openclaw#100601)
  fix: stop reconnecting on protocol mismatch (openclaw#98414)
  fix(maint): reuse recent hosted gates after rebase (openclaw#100663)
  fix(ui): reopen web terminals without stale content (openclaw#100665)
  fix(browser): diagnose empty WSL2 Chrome replies (openclaw#100590)
  fix(ios): chat snaps back to bottom when scrolling to top via status-bar tap (openclaw#100502)
  Treat already-compacted CLI compaction as no-op (openclaw#99136)
  docs(changelog): remove direct main fix entry
  fix(feishu): strip internal tool-trace banners from outbound text (openclaw#98705)
  fix(message): thread --limit through to CLI formatter and surface provider pagination hints (openclaw#99089)
  fix(voyage): close response body stream when batch output JSONL parsing throws (openclaw#98840)
  ...

# Conflicts:
#	extensions/memory-wiki/package.json
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Jul 6, 2026
giodl73-repo pushed a commit to giodl73-repo/openclaw that referenced this pull request Jul 8, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

commands Command implementations P2 Normal backlog priority with limited blast radius. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. size: M status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants