Skip to content

fix(tui): align session-history pagination page size #35905

Description

@opencode-agent

Summary

The V2 TUI pagination implementation and its regression test disagree on the message page size.

Evidence

Commit cc29f86 defines:

const MESSAGE_PAGE_SIZE = 25

packages/tui/src/context/data.tsx uses that constant for both initial and older-page requests and for completion detection.

But packages/tui/test/cli/tui/data.test.tsx constructs a 50-message full page and asserts both requests use limit=50:

expect(pages).toEqual([{ limit: "50", order: "desc", cursor: null }])

The implementation therefore requests 25 while the checked-in test requires 50. This also means the fixture's notion of a full page does not match the implementation's completion boundary.

Expected

Define one page-size contract and use it consistently in implementation, fixtures, request assertions, and completion detection.

Source

Found during the hourly V2 slop review: https://slack.com/archives/C0BE69AHCQP/p1783490782234659

Metadata

Metadata

Assignees

Labels

2.0bugSomething isn't workingtui

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions