You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Approach check: making Grok's model inventory replace on successful probe (#14366)
#14379
shouldRetainMissingProviderModels returned true for every driver except antigravity, codex and opencode, so mergeProviderModels re-appended previously-discovered non-custom rows for Grok. After disconnecting a third-party gateway, the removed gateway models stayed in the picker and in the persisted snapshot.
The approach
Three source edits across two files:
GrokProvider.ts — the boot snapshot reports installed: false instead of true
ProviderRegistry.ts — isGrok added to the driver guard and to the (!enabled || unauthenticated) -> return false early-out
The boot-snapshot change is the interesting one. It makes the pre-existing generic isPendingInitialProbe clause match the window before the first probe, exactly as it already does for Codex, whose boot snapshot has the same shape. That lets me avoid a Grok-specific exception clause — and a Grok-specific clause cannot be written correctly: status: "warning" with auth: "unknown" is ambiguous between before the first probe and after a probe where grok models returned a complete list but only the ACP initialize handshake failed. Keying on that shape retains stale rows in the second case, which leaves this bug unfixed for anyone whose ACP probe fails.
Net +6 source lines; the rest is tests. Four of five new tests fail against the unfixed code.
What I want feedback on
This is the part I'm least sure of, and it's the reason I'm asking rather than just handing over the PR:
Two windowed behavior changes beyond the reported bug. During the boot window, before the first Grok probe lands:
On web, the Settings row reads "Not found" instead of "Needs attention". Codex already reports the identical boot shape and already gets this string, so I read it as a pre-existing wart the change extends rather than creates. The copy fix belongs in getProviderSummary, which has no "checking" branch — that would fix Codex and Grok together, and I've left it out rather than widen this diff.
On mobile, buildModelOptions skips providers with !installed, so Grok drops out of the picker until the first probe completes, and an active Grok selection resolves to null during that window. That's a visible model switch on the new-task screen, not just a missing entry. Codex behaves identically today.
If maintainers would rather the boot window not change user-visible strings or mobile selection at all, the alternative is a narrower guard that keys on something more precise than installed — but as far as I can tell that reintroduces the ambiguity above. I'd rather know that's a line you don't want crossed than guess.
Also worth knowing
The cold-boot hydration window is unchanged: providerStatusCache re-appends cached non-custom rows for every driver at startup with no predicate, so stale rows on disk still appear briefly before the first probe clears them. It self-heals, and it's identical for Codex and Antigravity, so I left it alone.
Full detail, including validation commands, is in the PR.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
Posting ahead of review per CONTRIBUTING's "Discuss Changes First" — happy to be redirected here before you spend time on the diff.
PR: #14366 · Issue: #14349 (reported by @NOirBRight, not by me)
The bug
shouldRetainMissingProviderModelsreturnedtruefor every driver except antigravity, codex and opencode, somergeProviderModelsre-appended previously-discovered non-custom rows for Grok. After disconnecting a third-party gateway, the removed gateway models stayed in the picker and in the persisted snapshot.The approach
Three source edits across two files:
GrokProvider.ts— the boot snapshot reportsinstalled: falseinstead oftrueProviderRegistry.ts—isGrokadded to the driver guard and to the(!enabled || unauthenticated) -> return falseearly-outThe boot-snapshot change is the interesting one. It makes the pre-existing generic
isPendingInitialProbeclause match the window before the first probe, exactly as it already does for Codex, whose boot snapshot has the same shape. That lets me avoid a Grok-specific exception clause — and a Grok-specific clause cannot be written correctly:status: "warning"withauth: "unknown"is ambiguous between before the first probe and after a probe wheregrok modelsreturned a complete list but only the ACPinitializehandshake failed. Keying on that shape retains stale rows in the second case, which leaves this bug unfixed for anyone whose ACP probe fails.Net +6 source lines; the rest is tests. Four of five new tests fail against the unfixed code.
What I want feedback on
This is the part I'm least sure of, and it's the reason I'm asking rather than just handing over the PR:
Two windowed behavior changes beyond the reported bug. During the boot window, before the first Grok probe lands:
getProviderSummary, which has no "checking" branch — that would fix Codex and Grok together, and I've left it out rather than widen this diff.buildModelOptionsskips providers with!installed, so Grok drops out of the picker until the first probe completes, and an active Grok selection resolves tonullduring that window. That's a visible model switch on the new-task screen, not just a missing entry. Codex behaves identically today.If maintainers would rather the boot window not change user-visible strings or mobile selection at all, the alternative is a narrower guard that keys on something more precise than
installed— but as far as I can tell that reintroduces the ambiguity above. I'd rather know that's a line you don't want crossed than guess.Also worth knowing
The cold-boot hydration window is unchanged:
providerStatusCachere-appends cached non-custom rows for every driver at startup with no predicate, so stale rows on disk still appear briefly before the first probe clears them. It self-heals, and it's identical for Codex and Antigravity, so I left it alone.Full detail, including validation commands, is in the PR.
All reactions