Repository navigation
Refresh model catalogs after a minute and load only the provider tab in view - #6491
Merged
ymichael merged 1 commit intoOct 28, 2026
Conversation
…in view A provider model catalog stayed fresh for ten minutes, so a model the provider started offering could be missing from the picker for that long. Catalogs now go stale after 60 seconds, the same age at which a thread start or override that names a missing model already waits for a refresh, so the two thresholds are one constant. Opening the model picker prefetched every other provider, so each open past the freshness window started a background refresh of every stale provider at once. The picker now prefetches a provider only when its tab is hovered or focused; clicking a tab still loads it. The tab preview query keeps the prefetch's semantics, so a failed load shows its error instead of a remembered list and previews are not remembered, whether or not the tab was hovered first. Co-Authored-By: Claude Opus 5.5 <[email protected]>
ymichael
deleted the
bb/investigate-shorter-provider-model-catalog-ttl-w-thr_cahpbdrkcu
branch
October 28, 2026 22:47
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Human comments
What was wrong
A provider model catalog stayed fresh for ten minutes (
FRESH_MSinprovider-model-catalog-store.ts). Background refreshes start only when something reads a catalog. So when a provider started offering a model, the picker kept the old list until the stored one was ten minutes old and something read it. While testing #6477, omp advertised 119 models (addingopenai-codex/gpt-5.6-luna,solandterra) while the picker kept showing 116 for about ten minutes. Shortening the window alone would have made a second cost worse: opening the picker prefetched every other provider (ModelReasoningPicker). Every open past the window then started a background refresh of every stale provider at once, and each ACP refresh launches the agent, creates a session, probes models and deletes the session.What changed
provider-model-catalog-store.ts:FRESH_MSdrops from 10 min to 60 s. This is the age at whichthread update --modelwith a missing model already waits for a refresh (VALIDATION_MIN_AGE_MS), so both rules now share onestalecheck and the extra constant is gone. Persistence, failure backoff, prewarm, session-pushed catalogs and invalidation are unchanged.ModelReasoningPicker.tsx: removed the open-time sibling prefetch. A provider tab now prefetches its own catalog onpointerenter/focus, and clicking a tab still loads it. A refresh therefore only starts for providers the user looks at.system-queries.ts:prefetchSystemExecutionOptionstakes a single provider. The tab preview uses the newuseProviderPreviewExecutionOptions, which keeps the prefetch's semantics (writeLastKnown: false): a failed load shows its error instead of a remembered list, and previewed catalogs are not written to localStorage, whether or not the tab was hovered first.bb-guide-providers.md: documents the one-minute background refresh.No wire, protocol or SDK changes.
How you verified
PluginProviderModelPicker › does not commit loading, placeholder, or failed provider catalogstest caught a regression that preview semantics would otherwise have changed, and passes with the preview hook.pnpm exec turbo run test typecheck lint --filter=@bb/appand--filter=@bb/server:PluginSettingsautosave, timeline output preview,install-machine-script) and passed when rerun alone.pnpm start:worktreeservers, this branch and its basebe6ec62151, with real providers. Both started from the same 116-model omp list, about 90 s old:bb provider models acp-omp, read twice ~5 s apartgpt-5.6openai-codex5.6 models still missing after 15.8 sthread update --model openai-codex/gpt-5.6-solon a stale listthread update --model openai-codex/not-a-modelA codex smoke thread (
Reply only with ok.) completed on the branch, andbb provider modelsloads every signed-in provider.🤖 Generated with Claude Code