ccswitchmulti icon indicating copy to clipboard operation
ccswitchmulti copied to clipboard

[Bug][Codex V2] 缺 modelSelection 的旧数据/同步 route 导致应用界面加载失败(undefined.modelSelection.mode 白屏)

Open zhushihao opened this issue 3 months ago • 2 comments

症状

应用界面加载直接失败,白屏报错:

undefined is not an object (evaluating 'n.modelSelection.mode')

复现环境:schema-v2 的 route 数据来自旧版本(v3.19.2-15 之前)或跨设备 WebDAV/S3 同步合并,route 对象缺少 modelSelection 字段。前端读取 route.modelSelection.mode 时对 undefined.mode 取值抛错,且发生在应用初始化渲染路径上,整个界面加载失败,无恢复路径。

根因

两处前端读取未做缺省保护:

  1. readCodexRouting(CodexRouterWorkspacePage.tsx):v2 分支先补了默认值 {mode:"all"} 却仍引用 route.modelSelection.mode——补丁与引用对象不一致,等于没保护。
  2. CodexMultiRouterWizard / codexMultiRouterWizard.ts 的预览与 alias 检查对 modelSelection 直接取 mode,同样未加 ?. 保护。

schema-v2 的 modelSelection 是 v3.19.2-10 之后新增的 route 字段,旧数据、跨设备同步的 provider 配置缺失该字段属正常情况,前端必须以缺省值容忍。

修复

  • readCodexRouting:先 const modelSelection = route.modelSelection ?? {mode:"all"} 再统一引用
  • CodexMultiRouterWizard 预览 + wizard alias-issue 检查:补 ?. 缺省守卫
  • 补 legacy/synced 数据(缺 modelSelection)回归测试

备注

母仓库 v3.19.2-16 发布后,7c3dc167 仅覆盖了 route normalize 路径,readCodexRouting 的完整修复在本 PR(d35d1d3a)中。修复同时解决 Codex 桌面端在旧数据/同步配置下白屏的问题。

zhushihao avatar Aug 23 '26 11:08 zhushihao

此 issue 已超过 60 天没有活动,已被标记为 stale。 如果此问题仍然存在,请回复以保持 issue 打开状态,否则将在 14 天后自动关闭。

This issue has been automatically marked as stale because it has not had activity for 60 days. Please reply to keep it open, otherwise it will be automatically closed in 14 days.

github-actions[bot] avatar Oct 23 '26 03:10 github-actions[bot]

此 issue 因长时间无活动已被自动关闭。如果问题仍然存在,欢迎重新打开。

This issue has been automatically closed due to inactivity. If the problem persists, feel free to reopen it.

github-actions[bot] avatar Nov 06 '26 05:11 github-actions[bot]