Skip to content

feat(tui): add manual model list refresh action - #40303

Closed
RubenPari wants to merge 3 commits into
anomalyco:devfrom
RubenPari:feat/manual-model-refresh
Closed

feat(tui): add manual model list refresh action#40303
RubenPari wants to merge 3 commits into
anomalyco:devfrom
RubenPari:feat/manual-model-refresh

Conversation

@RubenPari

Copy link
Copy Markdown

Summary

  • Adds a POST /provider/refresh HTTP endpoint that force-refreshes the ModelsDev catalog from models.opencode.ai, bypassing the 60-minute automatic schedule
  • Regenerates the OpenAPI spec and SDK so sdk.client.provider.refresh() is available
  • Adds a refreshProviders() helper to the sync context that calls the endpoint and batch-updates the provider stores
  • Adds a "Refresh models" footer action button in the TUI model selection dialog (<leader>m / /models) — Tab to it and press Enter to pull in newly published models on demand

Closes #40252

Test plan

  • Open the model selection dialog (<leader>m or /models)
  • Tab to the "Refresh models" footer action and press Enter
  • Confirm the dialog remains open and no error occurs; model list reflects latest catalog
  • Run bun typecheck in packages/tui and packages/opencode — both pass

🤖 Generated with Claude Code

RubenPari and others added 3 commits August 3, 2026 17:23
Providers that enforce a one-minute limit window can return HTTP 400
with a JSON body whose `detail` says "rate limit exceeded". OpenCode
previously treated all 400s as terminal. When `retry400RateLimit: true`
is set under `provider.<id>.options`, matching 400 responses now enter
the existing retry flow. Generic 400s and the default (flag absent/false)
remain non-retryable.

Fixes anomalyco#40241

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Exposes a new POST /provider/refresh endpoint that force-refreshes the
ModelsDev catalog from models.opencode.ai (bypassing the 60-minute
background schedule), regenerates the SDK, and wires a "Refresh models"
action button into the TUI model selection dialog so users can pull in
newly published models on demand.

Closes anomalyco#40252

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@github-actions github-actions Bot added the needs:compliance This means the issue will auto-close after 2 hours. label Aug 3, 2026
@github-actions

github-actions Bot commented Aug 3, 2026

Copy link
Copy Markdown
Contributor

This PR doesn't fully meet our contributing guidelines and PR template.

What needs to be fixed:

  • PR description is missing required template sections. Please use the PR template.

Please edit this PR description to address the above within 2 hours, or it will be automatically closed.

If you believe this was flagged incorrectly, please let a maintainer know.

@github-actions

github-actions Bot commented Aug 3, 2026

Copy link
Copy Markdown
Contributor

This pull request has been automatically closed because it was not updated to meet our contributing guidelines within the 2-hour window.

Feel free to open a new pull request that follows our guidelines.

@github-actions github-actions Bot removed the needs:compliance This means the issue will auto-close after 2 hours. label Aug 3, 2026
@github-actions github-actions Bot closed this Aug 3, 2026
@9thChasingWindGirl

Copy link
Copy Markdown

Disappointed to see that this improvement came from a PR rather than the developer realizing how annoying it is to update the custom vendor model list on desktop.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[FEATURE]:model list can't refresh by itself

2 participants