chore: 导入旧记忆备份供恢复

This commit is contained in:
2026-09-23 22:38:40 +08:00
parent 5313fcee7a
commit 6a6a895eaf
638 changed files with 29816 additions and 1 deletions
@@ -0,0 +1,23 @@
---
title: CC Switch 切换中转站后 Codex 旧会话报 provider not found
type: experience
permalink: main/projects/211ab78b-753e-4017-8533-79ae2c92d218/cc-switch-切换中转站后-codex-旧会话报-provider-not-found
stable_id: c14af6ad-2409-4223-a0d2-19de3201ae3d
scope: project
memory_type: experience
project_id: 211ab78b-753e-4017-8533-79ae2c92d218
usage_profile_id: 7aee455b-24cc-4008-bdaf-443721e6f939
status: active
revision: 1
request_id: codex-ccswitch-provider-repair-experience-20260908-1138
created_at: '2026-09-08T03:34:51.144053+00:00'
updated_at: '2026-09-08T03:34:51.144053+00:00'
tags:
- codex
- cc-switch
- config.toml
- model-provider
- troubleshooting
---
现象:Codex App 打开任意旧会话提示无法加载 config.toml,错误为历史会话引用的 model provider 不存在;切回 AICodings 正常。根因:旧会话及 state_5.sqlite/local_thread_catalog 持久化为 `aicodings-codex`,而其他 CC Switch 中转站只写入 `model_provider = "custom"` 和 `[model_providers.custom]`。config.toml 的 TOML 语法本身正常。修复:关闭 Codex/CC Switch,先完整备份;把活动及归档 JSONL 中结构化字段 `model_provider`/`model_provider_id` 从旧 ID 迁移为 `custom`,同步更新 `state_5.sqlite.threads.model_provider` 和 `sqlite/codex-dev.db.local_thread_catalog.model_provider`;把 AICodings 的 CC Switch 模板顶层 provider 也改为 `custom`;启用 `unifyCodexSessionHistory`。验证需检查所有历史 JSONL 可解析、SQLite integrity_check=ok、会话/目录库 provider 全为 custom、当前 config 的 provider 在 model_providers 中存在,并用 Codex CLI加载配置。不要仅添加临时 alias,因为 CC Switch 下次切换会重写 config.toml。