GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — feat(tui): add session_list_limit for session picker by CasualDeveloper · Pull Request #6138 · anomalyco/opencode

Conversation

@CasualDeveloper

@CasualDeveloper CasualDeveloper commented Dec 24, 2025 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor

Issue for this PR

Closes #20754

Related to #6137, #8535, and #4918.

Type of change

  • Bug fix
  • New feature
  • Refactor / code improvement
  • Documentation

What does this PR do?

Adds optional session_list_limit config in tui.json for 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?

  • From packages/opencode: bun run test test/cli/tui/session-list.test.ts
  • From packages/opencode: bun test --timeout 300000 test/cli/tui/session-list.test.ts test/config/tui.test.ts --max-concurrency=1
  • From repo root: bun turbo typecheck

Screenshots / 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

  • I have tested my changes locally
  • I have not included unrelated changes in this PR

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

ariane-emory, nielpattin, and syo093c reacted with thumbs up emoji
All reactions
  • 👍 3 reactions
Copilot AI review requested due to automatic review settings December 24, 2025 23:46
Copilot started reviewing on behalf of CasualDeveloper December 24, 2025 23:47
View session
Copilot AI reviewed Dec 24, 2025
View reviewed changes

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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_limit configuration 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.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread packages/sdk/js/src/gen/types.gen.ts Resolved

Uh oh!

There was an error while loading. Please reload this page.

@CasualDeveloper
CasualDeveloper force-pushed the feat/tui-message-limit branch from f0fea03 to 0a0b93e Compare December 24, 2025 23:54
@CasualDeveloper

CasualDeveloper commented Dec 24, 2025

Copy link
Copy Markdown
Contributor Author

Fixed the inconsistent default value in the SDK types (was 500, now correctly 100). Thanks Copilot!

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@CasualDeveloper
CasualDeveloper force-pushed the feat/tui-message-limit branch from 0a0b93e to 9f54237 Compare December 24, 2025 23:59
@CasualDeveloper

CasualDeveloper commented Dec 24, 2025

Copy link
Copy Markdown
Contributor Author

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.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@CasualDeveloper

CasualDeveloper commented Dec 25, 2025 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor Author

I have a working implementation ready - typechecks pass.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@ariane-emory

ariane-emory commented Dec 25, 2025 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor

@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: ariane-emory#43

The team may (or may not) conclude that this also resolves my original Issue on the topic, #4918.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@CasualDeveloper
CasualDeveloper force-pushed the feat/tui-message-limit branch from 9f54237 to c22ee69 Compare December 25, 2025 03:40
@CasualDeveloper

CasualDeveloper commented Dec 25, 2025

Copy link
Copy Markdown
Contributor Author

@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.

ariane-emory reacted with thumbs up emoji
All reactions
  • 👍 1 reaction

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@CasualDeveloper
CasualDeveloper force-pushed the feat/tui-message-limit branch 2 times, most recently from ef4a090 to 4a4438c Compare December 25, 2025 03:46
@CasualDeveloper

CasualDeveloper commented Dec 25, 2025

Copy link
Copy Markdown
Contributor Author

Re-committed with valid GPG signature. PR ready.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@CasualDeveloper
CasualDeveloper force-pushed the feat/tui-message-limit branch 3 times, most recently from 4596a07 to da1e0bc Compare December 26, 2025 06:51
@CasualDeveloper CasualDeveloper changed the title feat(tui): add configurable message_limit for session history [#4918] feat(tui): add configurable message_limit for session history Dec 26, 2025
@CasualDeveloper CasualDeveloper changed the title [#4918] feat(tui): add configurable message_limit for session history [#4918][#6137] feat(tui): add configurable message_limit for session history Dec 26, 2025
@CasualDeveloper CasualDeveloper changed the title [#4918][#6137] feat(tui): add configurable message_limit for session history [#6137] feat(tui): add configurable message_limit for session history Dec 26, 2025
@CasualDeveloper CasualDeveloper changed the title [#6137] feat(tui): add configurable message_limit for session history [6137] feat(tui): add configurable message_limit for session history Dec 26, 2025
@CasualDeveloper CasualDeveloper changed the title [6137] feat(tui): add configurable message_limit for session history [#6137] feat(tui): add configurable message_limit for session history Dec 26, 2025
@CasualDeveloper CasualDeveloper changed the title [#6137] feat(tui): add configurable message_limit for session history feat(tui): add configurable message_limit for session history (#6137) Dec 26, 2025
@CasualDeveloper
CasualDeveloper force-pushed the feat/tui-message-limit branch 5 times, most recently from 872e100 to 1e84d56 Compare December 30, 2025 19:06
@CasualDeveloper

CasualDeveloper commented Dec 30, 2025

Copy link
Copy Markdown
Contributor Author

Will continue rebasing on top of release tags as they're set.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@CasualDeveloper
CasualDeveloper force-pushed the feat/tui-message-limit branch from 1e84d56 to 0414034 Compare December 31, 2025 04:39
@CasualDeveloper
CasualDeveloper force-pushed the feat/tui-message-limit branch 3 times, most recently from 325c7f5 to 8fc7ac0 Compare January 23, 2026 19:20
@github-actions github-actions Bot added needs:issue and removed needs:issue labels Jan 23, 2026
@CasualDeveloper
CasualDeveloper force-pushed the feat/tui-message-limit branch 7 times, most recently from c0282dc to a566be1 Compare January 30, 2026 03:44
@github-actions
github-actions Bot force-pushed the dev branch from bd214cc to a7d1cc1 Compare January 30, 2026 04:46
@thdxr
thdxr force-pushed the dev branch from cbab81f to 2d3c7a0 Compare January 30, 2026 04:50
@opencode-agent
opencode-agent Bot force-pushed the dev branch from 00637c0 to 71e0ba2 Compare January 30, 2026 14:32
@thdxr
thdxr force-pushed the dev branch from f1ae801 to 71e0ba2 Compare January 30, 2026 14:35
@github-actions github-actions Bot mentioned this pull request Feb 5, 2026
fix: session not found when selecting sessions from TUI picker #12343
Closed
@ryanwyler ryanwyler mentioned this pull request Feb 22, 2026
feat(session): add ts_before and breakpoint params to Session.messages API #14666
Closed
@github-actions github-actions Bot mentioned this pull request Mar 31, 2026
fix: remove 30-day limit from TUI session list #20341
Closed
2 tasks
@CasualDeveloper CasualDeveloper mentioned this pull request Apr 2, 2026
[QUESTION] Configurable session picker limit (#6138) #20754
Closed
This was referenced Apr 28, 2026
fix(tui): sort session picker by full updated timestamp #24725
Merged
TUI session picker sorts by day instead of actual timestamp #24727
Closed
This was referenced May 2, 2026
📊 AI CLI 工具社区动态日报 2026-05-02 zx0828/big_model_radar#5
Open
📊 AI CLI 工具社区动态日报 2026-05-02 zx0828/big_model_radar#10
Open
📊 AI CLI 工具社区动态日报 2026-05-02 zx0828/big_model_radar#14
Open
📊 AI CLI 工具社区动态日报 2026-05-08 zx0828/big_model_radar#43
Open
📊 AI CLI 工具社区动态日报 2026-05-08 ivanweng2077/big_model_radar#10
Open
@CasualDeveloper
feat(tui): add session_list_limit to cap the session picker
d23f65a
Adds 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

CasualDeveloper commented Jun 16, 2026

Copy link
Copy Markdown
Contributor Author

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 session_list_limit as a render-time slice over sync.data.session, but that shared sync list is already backend-limited and mixed root/child session data. So the setting cannot reliably make more root sessions visible.

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.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@ManX-SAFE21 ManX-SAFE21 mentioned this pull request Aug 29, 2026
[FEATURE] Option to show all sessions in the session list without repeated 'Load more' #46123
Open
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

Copilot code review Copilot
Copilot review effort
Applies to this pull request for everyone.Learn more about Copilot code review.
Copilot left review comments

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

[QUESTION] Configurable session picker limit (#6138)

Uh oh!

There was an error while loading. Please reload this page.

4 participants

@CasualDeveloper @ariane-emory @benitogonzalezh
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.