feat(tui): add session_list_limit for session picker (#6137)
Summary
- Add configurable
session_list_limitfor the session picker (default 150) - Apply limit only when not searching (search continues to use server-side limit 30)
- Regenerate SDK types and openapi.json
Notes
-
message_limithas been removed; cursor-based pagination (#8535) now covers message history - No changes to sync.tsx to avoid pagination conflicts
Testing
-
bun run --cwd packages/opencode typecheck
Closes #6137 and maybe also #4918
Fixed the inconsistent default value in the SDK types (was 500, now correctly 100). Thanks Copilot!
Fixed second hardcoded 100 in the message.updated event handler at line 191. Without this, new messages arriving during active sessions would trim the array back to 100, defeating the configurable limit.
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 session_list similarly configurable) I haven't found the time to finish it and yours looks like it may be cleaner than mine.
I cordially invite you to steal anything you think might be useful from my unfinished PR: https://github.com/ariane-emory/opencode/pull/43
The team may (or may not) conclude that this also resolves my original Issue on the topic, #4918.
@ariane-emory Thanks for linking your PR! I've incorporated session_list_limit from your work. Kept the implementation simpler (no "none" option, proper types instead of as any casts). Added a reference to #4918 in the PR description.
Re-committed with valid GPG signature. PR ready.
Will continue rebasing on top of release tags as they're set.
Rebased onto v1.1.3. Merged with the new session search functionality - the configurable session_list_limit now only applies when not searching (search results use server limit).