Skip to content

feat(rpc): add rowid-forward message pagination #200

Description

@vincentkoc

Problem

OpenClaw startup catchup currently has to approximate forward progress through messages.history, which is newest-first and capped at 500 rows. Equal timestamps and larger backlogs make a durable cursor ambiguous.

Proposed contract

Add an additive JSON-RPC method, messages.after, with:

  • required non-negative since_rowid, exclusive
  • optional positive chat_id; omit it to page across all chats
  • limit default 100, maximum 500
  • optional attachments, convert_attachments, and include_reactions booleans
  • stable message.ROWID ASC ordering
  • next_rowid as the authoritative physical scan cursor
  • has_more computed from the database/page boundary, not from result count

The default page is user-visible message catchup and may coalesce or suppress URL-preview rows while still advancing next_rowid. Callers that need the cursor to cover standalone reaction events set include_reactions: true.

Validation

Cover more than 500 equal-timestamp rows, optional chat filtering over interleaved rows, reactions, attachment payload parity, URL-preview coalescing across page boundaries, empty suppressed pages, and strict parameter validation.

Downstream consumer: openclaw/openclaw#116961

Metadata

Metadata

Assignees

No one assigned

    Labels

    P3Low-risk cleanup, docs, polish, ergonomics, or speculative feature.clawsweeper:linked-pr-openClawSweeper found an open linked pull request for this issue.clawsweeper:needs-product-decisionClawSweeper marked this issue as needing a product or behavior decision.clawsweeper:no-new-fix-prClawSweeper does not recommend queueing a new automated fix PR for this issue.impact:otherThis issue has meaningful maintainer-visible impact outside the owned taxonomy.issue-rating: 🌊 off-meta tidepoolIssue quality rating does not apply to this item.

    Type

    No type

    Fields

    Priority

    None yet

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions