fix: prevent model reload from interrupting ACP startup#1178
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: a3297eb5e1
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
|
|
||
| useEffect(() => { | ||
| if (!currentAgent || switchingModelRef || optimisticModelRef) return; | ||
| if (!providerSnapshotReady || providerError || !currentAgent || switchingModelRef || optimisticModelRef) return; |
There was a problem hiding this comment.
Gate model cleanup while providers are refreshing
When an initial provider snapshot fails and a later snapshot is retried, refreshProviderSnapshot clears error before awaiting the new fetch (src/stores/providers.ts:82-84) while leaving the old accounts/statuses in place. Since providerSnapshotReady stays true and this guard only checks providerError, the effect can run during that in-flight retry with empty/stale modelOptions and call updateAgentModel(..., null) before the providers settle, reintroducing the premature override clearing this patch is intended to avoid.
Useful? React with 👍 / 👎.
No description provided.