Skip to content

Fix model picker loading state during initial discovery#121

Open
Zeus-Deus wants to merge 1 commit into
Emanuele-web04:codex/fixesssfrom
Zeus-Deus:fix/103-model-discovery-loading-state
Open

Fix model picker loading state during initial discovery#121
Zeus-Deus wants to merge 1 commit into
Emanuele-web04:codex/fixesssfrom
Zeus-Deus:fix/103-model-discovery-loading-state

Conversation

@Zeus-Deus
Copy link
Copy Markdown

Follow-up on #117.

The discovery skeleton was gated on isLoading, but providerModelsQueryOptions uses placeholderData, which keeps the query in "success" status on its first fetch — so isLoading is never true there. Initial discovery skipped the skeleton and briefly showed the static fallback models while the CLI was still being queried.

Added isInitialModelDiscoveryPending (isFetching && isPlaceholderData) so the initial fetch is caught without re-gating on background refetches, and used it for both the Cursor and Kilo gates.

Also addressed the rest of the review on #117:

  • Trimmed the comments down to match the rest of the file.
  • Added a test covering the initial-fetch vs background-refetch behavior.

The discovery skeleton was gated on isLoading, but providerModelsQueryOptions
uses placeholderData, which keeps the query in "success" status during its
first fetch — so isLoading is never true there. Initial discovery skipped the
skeleton and briefly showed static fallback models while the CLI was still
being queried.

Add isInitialModelDiscoveryPending (isFetching && isPlaceholderData) so the
initial fetch is caught without re-gating on background refetches, and use it
for both the Cursor and Kilo gates. Also trim the comments from Emanuele-web04#117 and add a
test covering the initial-fetch vs refetch behavior.
@github-actions github-actions Bot added size:M vouch:unvouched PR author is not yet trusted in the VOUCHED list. labels May 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:M vouch:unvouched PR author is not yet trusted in the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant