Skip to content

fix(codex): publish projection only for active router when MultiRouters share a target (closes #46) - #47

Closed
zhushihao wants to merge 1 commit into
BigStrongSun:mainfrom
zhushihao:fix/42-active-router
Closed

fix(codex): publish projection only for active router when MultiRouters share a target (closes #46)#47
zhushihao wants to merge 1 commit into
BigStrongSun:mainfrom
zhushihao:fix/42-active-router

Conversation

@zhushihao

Copy link
Copy Markdown
Contributor

Closes #46

概述

配置了多个 MultiRouter(如公司 + 个人各一个),且它们共享同一个 target provider 时,切换/保存其中一个 router 的路由规则或子 Agent 配置,会静默改写另一个 router 的模型投影——另一个 router 的模型列表/顺序在 Codex 端被错误覆盖。

根因

persist_provider_mutation 在保存任一 router 时无条件发布该 router 的投影产物到共享 target 的 catalog。target 同一时刻只能承载一份投影,多个 router 轮番发布 → 互相覆盖,最后保存的 router 生效,其余 router 的配置"消失"(不是被删,是被投影覆盖)。

修复

mutation.rs::persist_provider_mutation:仅当该 router 是**当前 active(is_current)**时才发布投影到共享 target;非 active router 的保存只更新自身 settings_config,不发布投影,避免互相覆盖。

测试

  • cargo check:零警告
  • 场景验证:双 MultiRouter 共享 target,保存非 active router 后 active router 的 Codex 模型菜单不变

…le MultiRouters share a target

多个 MultiRouter 共享同一 target provider 时,任一 router 变更都会
发布投影并覆盖 target 的 catalog,导致另一个 router 的模型配置被
静默改写。persist_provider_mutation 改为仅对 active router 发布
投影。
BigStrongSun added a commit that referenced this pull request Aug 24, 2026
Re-audit PRs #37, #39, #45, #47, and #49 against their complete runtime contracts rather than file-level overlap. Unify v2 auth ownership through raw passthrough, default missing modelSelection in the backend schema, enforce unambiguous shared projection ownership, normalize DeepSeek role aliases, and recover documented partial ReplaceFileW states with an explicit backup. Add focused regressions for each missed path and record the corrected audit in release notes and repository memory.\n\n本次提交由BigStrongsSun完成
@zhushihao zhushihao closed this Aug 24, 2026
@zhushihao
zhushihao deleted the fix/42-active-router branch August 24, 2026 13:22
@zhushihao
zhushihao restored the fix/42-active-router branch August 24, 2026 13:29
@zhushihao zhushihao reopened this Aug 24, 2026
@zhushihao

Copy link
Copy Markdown
Contributor Author

已在 v3.19.2-17 以等价实现覆盖(母仓库作者按自己的理解修复,未直接合并本 PR),故关闭。/ Superseded by the equivalent implementation shipped in v3.19.2-17; closing.

@zhushihao zhushihao closed this Aug 25, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug][Codex V2] 多 MultiRouter 共享 target 时投影互相覆盖:非 active router 保存会静默改写另一 router 的模型 catalog

1 participant