{"record":{"id":"a4321503fcb46f13","repo":"BigPizzaV3/CodexPlusPlus","slug":"session-index-cleanup-preview-task-failed-error","errorCode":null,"errorMessage":"session index cleanup preview task failed: {error}","messagePattern":"session index cleanup preview task failed: (.+?)","errorType":"exception","errorClass":"anyhow::Error","httpStatus":null,"severity":"error","filePath":"apps/codex-plus-manager/src-tauri/src/commands.rs","lineNumber":2899,"sourceCode":"                    is_saved: settings.provider_sync_saved_providers.contains(id),\n                });\n        }\n    }\n    targets.targets.sort_by(|left, right| {\n        right\n            .is_current_provider\n            .cmp(&left.is_current_provider)\n            .then_with(|| left.id.cmp(&right.id))\n    });\n}\n\n#[tauri::command]\npub async fn preview_session_index_cleanup() -> CommandResult<Value> {\n    let result = tauri::async_runtime::spawn_blocking(|| {\n        codex_plus_data::preview_session_index_cleanup(None)\n    })\n    .await\n    .map_err(|error| anyhow::anyhow!(\"session index cleanup preview task failed: {error}\"))\n    .and_then(|result| result);\n    match result {\n        Ok(preview) => ok(\n            &format!(\n                \"发现 {} 条仅存在于任务索引中的候选记录。\",\n                preview.candidates.len()\n            ),\n            json!({\n                \"snapshotSha256\": preview.snapshot_sha256,\n                \"candidates\": preview.candidates,\n            }),\n        ),\n        Err(error) => failed(&format!(\"预览失效任务索引失败：{error}\"), json!({})),\n    }\n}\n\n#[tauri::command]\npub async fn apply_session_index_cleanup(","sourceCodeStart":2881,"sourceCodeEnd":2917,"githubUrl":"https://github.com/BigPizzaV3/CodexPlusPlus/blob/f2074595a281bc057525c748175c8eb9805b0673/apps/codex-plus-manager/src-tauri/src/commands.rs#L2881-L2917","documentation":"Wrapped failure thrown by the preview_session_index_cleanup Tauri command when its spawn_blocking task around codex_plus_data::preview_session_index_cleanup fails at the task level (JoinError), surfaced as \"session index cleanup preview task failed: {error}\". The preview never produced a snapshot; domain-level preview errors come from the inner call instead.","triggerScenarios":"Thrown at apps/codex-plus-manager/src-tauri/src/commands.rs:2899 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["查看预览任务的 panic 堆栈","确认 __session_index 数据库状态正常","重试预览","修复 preview_session_index_cleanup 内的防御性校验"],"exampleFix":null,"handlingStrategy":"retry","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"f2074595a281bc057525c748175c8eb9805b0673","analyzedAt":"2026-08-23T12:52:24.489Z","contentChangedAt":"2026-08-23T12:52:24.489Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}