mirror of
https://github.com/farion1231/cc-switch.git
synced 2026-07-25 13:45:03 +08:00
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:
@@ -198,6 +198,8 @@ pub struct CodexThirdPartyHistoryProviderBucketMigration {
|
||||
pub migrated_jsonl_files: usize,
|
||||
#[serde(default)]
|
||||
pub migrated_state_rows: usize,
|
||||
#[serde(default)]
|
||||
pub scanned_history_files: bool,
|
||||
}
|
||||
|
||||
/// 应用设置结构
|
||||
@@ -594,7 +596,7 @@ pub fn is_codex_third_party_history_provider_bucket_migrated() -> bool {
|
||||
.codex_third_party_history_provider_bucket_v1
|
||||
.as_ref()
|
||||
})
|
||||
.is_some()
|
||||
.is_some_and(|m| m.scanned_history_files)
|
||||
}
|
||||
|
||||
pub fn mark_codex_third_party_history_provider_bucket_migrated(
|
||||
|
||||
Reference in New Issue
Block a user