Skip to content

🐛Bugfix: Model config race conditions during connectivity verification and provider save - #3575

Merged
Dallas98 merged 2 commits into
developfrom
zjy/bugfix_project5
Aug 4, 2026
Merged

🐛Bugfix: Model config race conditions during connectivity verification and provider save#3575
Dallas98 merged 2 commits into
developfrom
zjy/bugfix_project5

Conversation

@ayiya12

@ayiya12 ayiya12 commented Aug 3, 2026

Copy link
Copy Markdown
Contributor

Summary

Fix two race conditions in the model configuration flow:

  1. Stale connectivity responses — Users could modify form fields while connectivity verification was in flight, causing returned responses to be applied to outdated state. Fix: lock all form inputs via disabled={verifyingConnectivity}, propagating the lock to ModelCapacityFields and ModelMaxTokensInput through a new disabled prop.
image
  1. Stale API key after provider save — After saving a new provider API key, the model list was prefetched with the previous key because the parent's models state had not yet propagated into the closure. Fix: add an onSuccess callback to ProviderConfigEditDialog that passes the just-saved apiKey directly into prefetchProviderModels via a new apiKeyOverride, and force a full remount via key so the dialog always initializes from the latest initialApiKey.
image image

Changes

  • frontend/app/[locale]/models/components/model/ModelAddDialog.tsx — disable all form fields during verification and reflect the verifying state on the Add button
  • frontend/app/[locale]/models/components/model/ModelCapacityFields.tsx — add disabled prop and forward to children
  • frontend/app/[locale]/models/components/model/ModelMaxTokensInput.tsx — add disabled prop and forward to children
  • frontend/app/[locale]/models/components/model/ModelEditDialog.tsx — add onSuccess callback to ProviderConfigEditDialog
  • frontend/app/[locale]/models/components/model/ModelDeleteDialog.tsx — add apiKeyOverride to prefetchProviderModels, invoke it in onSuccess with the saved key, and force remount via key prop

@ayiya12
ayiya12 requested review from Dallas98 and WMC001 as code owners August 3, 2026 12:15
@Dallas98
Dallas98 merged commit e8082de into develop Aug 4, 2026
7 of 8 checks passed
@ayiya12
ayiya12 deleted the zjy/bugfix_project5 branch August 5, 2026 06:37
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.

2 participants