Repository navigation
Conversation
ntdatt812
force-pushed
the
fix/edit-dialog-live-settings-6445
branch
from
August 15, 2026 06:43
9c82ad7 to
f7049de
Compare
Owner
|
@codex review |
|
Codex Review: Didn't find any major issues. Swish! Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
ntdatt812
force-pushed
the
fix/edit-dialog-live-settings-6445
branch
from
September 1, 2026 04:34
f7049de to
d7f26b8
Compare
EditProviderDialog reads the live config for the currently applied provider
and guarded that read with a hasLoadedLive boolean, which records that a
snapshot was loaded but not which provider it belongs to.
App.tsx sets open={Boolean(editingProvider)}, so selecting a different
provider swaps `provider` while the panel stays open. The effect re-ran, hit
the guard, and kept the previous snapshot — and since initialSettingsConfig
prefers liveSettings over provider.settingsConfig, the form showed the wrong
API key.
Keys the snapshot by (appId, provider.id) and derives liveSettings from that
key, mirroring formReadyToken in the same file. A stale key falls back to the
SSOT config, so no frame renders one provider's live config under another's
name.
Also gives the getCurrent call a catch: it had a finally but no catch, so a
failure there left the previous snapshot in place and never settled.
Refs farion1231#6445 — covers the "switching providers shows the wrong key" symptom
only. The reported case of the applied provider itself showing a relay key is
not accounted for here, so the issue should stay open.
ntdatt812
force-pushed
the
fix/edit-dialog-live-settings-6445
branch
from
September 19, 2026 02:16
d7f26b8 to
2ed9fc7
Compare
Contributor
Author
|
Rebased onto |
This branch has not been deployed
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.
Summary / 概述
Editing a provider could show another provider's API key.
EditProviderDialogloads the live config for whichever provider is currently applied, and guarded that load with a plainhasLoadedLiveboolean. The flag records that a snapshot was loaded but not which provider it belongs to.App.tsxderives the panel's open state from the selection itself:So picking a different provider swaps
providerwhileopenstaystrue. The effect re-runs, hitsif (hasLoadedLive) return, and the previous provider's live snapshot stays in state —initialSettingsConfigprefersliveSettingsoverprovider.settingsConfig, so the form renders the wrong key.The fix keys the snapshot by
(appId, provider.id)and derivesliveSettingsfrom it:A stale key now yields
null, so the form falls back to the SSOT config until the new load settles — there is no frame where one provider's live config is shown under another's name. This is the same shape asformReadyTokentwenty lines above in the same file, which already keys its state on[appId, open, provider?.id].While collapsing the four
setLiveSettings/setHasLoadedLivepairs into onesettle()helper, the outertryaroundprovidersApi.getCurrentturned out to have afinallybut nocatch, so a failure there left the previous snapshot in place and never settled. It now falls back to SSOT like the inner handler already did.Related Issue / 关联 Issue
Refs #6445 — partially.
#6445 reports two symptoms and this only accounts for the second one:
Fixesso the issue stays open for that half.Verification
Added a regression test that renders the active provider, waits for its live snapshot, then swaps in a different provider without closing — exactly what
Boolean(editingProvider)produces.One note on the numbers: an earlier baseline run on a clean checkout showed 2 unrelated failures that did not reproduce on re-run, so the suite looks mildly flaky somewhere. Without this change the only failure is the new test; with it the full run is green.
Unrelated observation, not changed here
isProxyTakeoveris passed to this dialog without theisProxyRunningconjunct that every other call site uses:With the proxy stopped but a takeover still recorded, the dialog therefore skips the live read and shows the SSOT config, which is the opposite of what the comment on that branch intends. It fails safe rather than showing a wrong key, so it is not the cause of either symptom above — flagging it rather than folding it into this PR. Happy to send it separately if you agree it is wrong.
Checklist / 检查清单
pnpm typecheckpasses / 通过 TypeScript 类型检查pnpm format:checkpasses / 通过代码格式检查cargo clippypasses (if Rust code changed) — no Rust changed