Skip to content

feat(tui): add Ctrl+R force-refresh to the model picker#3564

Merged
dgageot merged 2 commits into
docker:mainfrom
dgageot:model-picker-refresh
Jul 10, 2026
Merged

feat(tui): add Ctrl+R force-refresh to the model picker#3564
dgageot merged 2 commits into
docker:mainfrom
dgageot:model-picker-refresh

Conversation

@dgageot

@dgageot dgageot commented Jul 9, 2026

Copy link
Copy Markdown
Member

The /model picker sources its list from models.dev, but that data is cached with a TTL — so newly added or changed models don't show up until the cache expires. There was no way for a user to force a fresh fetch without restarting the agent.

Pressing Ctrl+R in the model picker now bypasses the cache, re-fetches the models.dev catalog (and any in-memory model data), and reopens the picker with the updated choices. The current search query is preserved across the refresh so the user lands back in a filtered view rather than a blank one. Refreshes are serialized via a dedicated mutex so that rapid Ctrl+R presses don't stack concurrent fetches, and the store's read lock is never held during network I/O. Errors (including HTTP 304 not-modified and cache-still-valid cases) are handled gracefully and surfaced to the user rather than silently swallowed.

Tests cover cache bypass, 304/not-modified and error paths, concurrent refresh coalescing, query preservation, and the Ctrl+R key binding in the picker component.

dgageot added 2 commits July 9, 2026 20:32
Pressing Ctrl+R in the model picker bypasses the models.dev cache TTL,
re-fetches the catalog, and reopens the picker with updated choices.

Assisted-By: docker/docker-agent
Prevent picker stacking on ctrl+r, preserve the search query across
refreshes, and avoid holding the store mutex during network I/O.
Coalesce refreshes with a dedicated refreshMu, improve error handling
for in-memory and not-modified edge cases, and add covering tests.

Assisted-By: Claude (Anthropic)
@dgageot dgageot requested a review from a team as a code owner July 9, 2026 19:03
@aheritier aheritier added area/docs Documentation changes area/models LLM model integrations and model providers area/tui For features/issues/fixes related to the TUI kind/feat PR adds a new feature (maps to feat:). Use on PRs only. labels Jul 9, 2026
@dgageot dgageot merged commit f80c88d into docker:main Jul 10, 2026
14 of 15 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/docs Documentation changes area/models LLM model integrations and model providers area/tui For features/issues/fixes related to the TUI kind/feat PR adds a new feature (maps to feat:). Use on PRs only.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants