fix: preserve takeover live state during provider refresh#1912
fix: preserve takeover live state during provider refresh#1912congmucc wants to merge 4 commits intofarion1231:mainfrom
Conversation
Generalize proxy takeover refresh for switch-mode apps and keep the takeover state updates consistent under concurrency. - Rebuild Claude, Codex, and Gemini takeover live configs from the current provider before applying proxy-safe overlays - Make proxy-active backup and live refresh atomic under the per-app switch lock to avoid inconsistent takeover state during concurrent updates
|
@codex review 审查 |
|
To use Codex here, create a Codex account and connect to github. |
|
@codex review |
|
@codex review 审查 |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 1469e5d2d7
ℹ️ About Codex in GitHub
Your team has set up Codex to 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 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
Hi, I owe you an apology for the long silence. As the sole maintainer of this project, I've been overwhelmed and fell behind on reviews — but that's on me, not on you. Your contribution matters and I will review this PR. If it needs a rebase, just let me know or I can handle it. Thank you for your time and patience. |
- refresh takeover updates from existing live and backup snapshots so Claude display fields stay aligned without dropping live-only settings - keep proxy-down restore and common-config transition paths consistent, including backup recreation and malformed backup tolerance - add regression coverage for takeover live refresh, common-config updates, and proxy-down fallback behavior
|
@farion1231 I pushed a focused follow-up update for this PR. The current revision keeps takeover live and backup state aligned during provider refresh without rebuilding unrelated live-only config, and it also addresses the earlier review findings from the previous rebuild-based path. A rebase should not be needed at the moment. This branch is currently based on upstream/main, so the PR should now be ready for review against the updated diff. |
|
@codex review |
- remove explicit auto-deref usage in Codex takeover merge logic so cargo clippy is clean again - keep the change scoped to warning-only cleanup without altering takeover refresh behavior
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 863aef8f41
ℹ️ About Codex in GitHub
Your team has set up Codex to 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 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
- downgrade previous common-config removal failures to a warning during takeover transition refresh - add regression coverage for malformed stored snippets so live and backup refresh continue
|
@codex review |
|
Codex Review: Didn't find any major issues. Nice work! ℹ️ 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". |
Summary / 概述
This PR fixes the original stale takeover config issue in switch-mode apps: after provider changes, Claude takeover could keep provider-owned live fields stale even though the current provider had already changed.
The follow-up update narrows the implementation so takeover refresh works from the existing live/backup state, refreshes provider-owned fields, and then reapplies takeover-owned overlay fields instead of rebuilding unrelated live config from scratch.
cargo fmt --manifest-path src-tauri/Cargo.toml --checkgit diff --checkcargo test sync_current_provider_for_app_skips_proxy_refresh_when_proxy_server_is_not_running --manifest-path src-tauri/Cargo.tomlcargo test sync_current_provider_for_app_preserves_taken_over_live_when_proxy_server_is_not_running_without_backup --manifest-path src-tauri/Cargo.tomlcargo test sync_current_common_config_for_app_tolerates_malformed_backup --manifest-path src-tauri/Cargo.tomlcargo test sync_current_common_config_for_app_tolerates_malformed_previous_snippet --manifest-path src-tauri/Cargo.tomlcargo test refresh_takeover_state_from_provider_reapplies_current_common_config_to_live --manifest-path src-tauri/Cargo.tomlRelated Issue / 关联 Issue
Fixes #1850
Follow-up to #1828 (which closed #1827)
Screenshots / 截图
N/A (backend / service-layer change)
Checklist / 检查清单
pnpm typecheckpasses / 通过 TypeScript 类型检查 [not applicable]pnpm format:checkpasses / 通过代码格式检查 [not applicable]cargo clippypasses (if Rust code changed) / 通过 Clippy 检查(如修改了 Rust 代码)