修复自动故障转移中的供应商凭证串号 - #400
Open
wplct wants to merge 1 commit into
Open
Conversation
Draft
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.
问题
自动故障转移准备阶段会读取 live 配置并生成多个供应商快照,但 live 配置本身没有可靠的供应商归属。旧实现会把 live 中的 token 反向同步到 effective current provider,导致供应商 A 的
OPENAI_API_KEY永久覆盖供应商 B 的持久化配置。Codex 快照合并还可能把 live auth 中的 API key 带入其他供应商的 snapshot;升级前已经缓存的 snapshot 也不会自动修复。
修复
auto_failover_enabled=true时禁止 live token 同步回 current provider。auth.OPENAI_API_KEY强制来自目标 provider:测试
安全说明
PR 和测试仅使用占位 key,不包含真实凭证。
Problem
Automatic failover reads the live configuration while preparing snapshots for multiple providers, but the live configuration has no reliable provider identity. The previous implementation synchronized the live token back into the effective current provider, allowing provider A's
OPENAI_API_KEYto permanently overwrite provider B's stored configuration.Codex snapshot merging could also carry a live API key into another provider's snapshot, and stale cached snapshots were not repaired after upgrade.
Fix
auto_failover_enabled=true.auth.OPENAI_API_KEYto come from its target provider:Tests
Security note
The PR and tests use placeholder credentials only. No real key is included.