Uh oh!
There was an error while loading. Please reload this page.
feat(tui): add session_list_limit for session picker - #6138
feat(tui): add session_list_limit for session picker#6138CasualDeveloper wants to merge 1 commit into
Conversation
There was a problem hiding this comment.
Pull request overview
This PR adds a configurable message_limit option to control the number of messages loaded per session in the TUI. The default value remains 100, but users can now configure it up to 10,000 messages through the config file.
- Add
message_limitconfiguration field to TUI schema with validation constraints (1-10,000) - Update implementation to use the configured value with fallback to 100
- Generate corresponding TypeScript type definitions
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
packages/sdk/openapi.json | Adds message_limit field to the schema with integer constraints (1-10,000) and description |
packages/sdk/js/src/v2/gen/types.gen.ts | Generated TypeScript types for the new message_limit config option |
packages/sdk/js/src/gen/types.gen.ts | Generated TypeScript types with incorrect default value in documentation |
packages/opencode/src/config/config.ts | Adds Zod schema validation for message_limit with proper constraints |
packages/opencode/src/cli/cmd/tui/context/sync.tsx | Updates message loading to use configured limit with fallback to 100 |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Uh oh!
There was an error while loading. Please reload this page.
f0fea03 to
0a0b93eCompareCasualDeveloper
commented
Dec 24, 2025
Fixed the inconsistent default value in the SDK types (was 500, now correctly 100). Thanks Copilot! |
0a0b93e to
9f54237CompareCasualDeveloper
commented
Dec 24, 2025
Fixed second hardcoded |
I have a working implementation ready - typechecks pass. |
@CasualDeveloper I also want to see this feature. I've had a half-finished PR in my pocket for a while that addresses this (and also makes the length of I cordially invite you to steal anything you think might be useful from my unfinished PR: ariane-emory#43 The team may (or may not) conclude that this also resolves my original Issue on the topic, #4918. |
9f54237 to
c22ee69CompareCasualDeveloper
commented
Dec 25, 2025
@ariane-emory Thanks for linking your PR! I've incorporated |
ef4a090 to
4a4438cCompareCasualDeveloper
commented
Dec 25, 2025
Re-committed with valid GPG signature. PR ready. |
4596a07 to
da1e0bcCompare872e100 to
1e84d56CompareCasualDeveloper
commented
Dec 30, 2025
Will continue rebasing on top of release tags as they're set. |
1e84d56 to
0414034Compare325c7f5 to
8fc7ac0Comparec0282dc to
a566be1CompareAdds an optional `session_list_limit` setting to `tui.json` (default 150) that caps how many root sessions the picker renders when not searching. Search still requests the existing server-limited result set and renders an empty pending state instead of falling back to the full synced list. The active session has priority inside capped lists; pinned session-switching entries are preserved when space remains, and remaining slots follow the picker's updated-time recency order.
CasualDeveloper
commented
Jun 16, 2026
Closing this PR in its current form. After re-reviewing the original goal and the newer session-dialog work in #31132, I no longer think this implementation is the right layer for the problem. This PR applies The better immediate fix is #31132: make the session dialog load root sessions directly and safely, without changing shared sync state. If a configurable picker size is still needed later, it should be implemented as a page size / query limit for the dialog-local root-session browse request, not as a client-side slice of synced sessions. Superseded by #31132. |
Issue for this PR
Closes#20754
Related to #6137, #8535, and #4918.
Type of change
What does this PR do?
Adds optional
session_list_limitconfig intui.jsonfor the TUI session picker. The picker uses a default cap of 150 root sessions when not searching, while search keeps the existing server-limited request path.The current session stays visible when capped. Pinned session-switching entries are preserved within the cap when room exists, and remaining picker entries stay aligned with updated-time recency.
This is intentionally scoped to the picker render list, not broader session loading or pagination.
How did you verify your code works?
packages/opencode:bun run test test/cli/tui/session-list.test.tspackages/opencode:bun test --timeout 300000 test/cli/tui/session-list.test.ts test/config/tui.test.ts --max-concurrency=1bun turbo typecheckScreenshots / recordings
N/A. This is a TUI config and picker behavior change with no visual layout change.
Notes
AI Assistance: OpenCode + openai/gpt-5.5; Review: Human operator reviewed.
Checklist