feat(codex): migrate third-party history provider bucket to unified "custom" ID

Codex CLI filters conversations by model_provider — after normalizing
all third-party providers to "custom", old sessions with their original
provider IDs become invisible. This migration rewrites JSONL session
files and state_5.sqlite threads to use the unified ID.

Uses a three-tier trust model for source ID collection:
- Known legacy preset whitelist (46 IDs, case-insensitive)
- cc-switch-created custom providers (identified by created_at)
- User-maintained custom providers are explicitly skipped

Adds scanned_history_files flag to prevent stale v1 markers from
blocking re-runs with the improved source ID collection logic.
This commit is contained in:
Jason
2026-05-25 19:08:18 +08:00
parent 177eef6682
commit b15d9dfa11
3 changed files with 292 additions and 7 deletions
+1
View File
@@ -233,6 +233,7 @@ mod tests {
source_provider_ids: vec!["rightcode".to_string()],
migrated_jsonl_files: 2,
migrated_state_rows: 3,
scanned_history_files: true,
},
),
}),