{"record":{"id":"99b72f0a9b706459","repo":"BigPizzaV3/CodexPlusPlus","slug":"session-index-cleanup-task-failed-error","errorCode":null,"errorMessage":"session index cleanup task failed: {error}","messagePattern":"session index cleanup task failed: (.+?)","errorType":"exception","errorClass":"anyhow::Error","httpStatus":null,"severity":"error","filePath":"apps/codex-plus-manager/src-tauri/src/commands.rs","lineNumber":2925,"sourceCode":"            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(\n    snapshot_sha256: String,\n    thread_ids: Vec<String>,\n) -> CommandResult<Value> {\n    let result = tauri::async_runtime::spawn_blocking(move || {\n        codex_plus_data::apply_session_index_cleanup(None, &snapshot_sha256, &thread_ids)\n    })\n    .await\n    .map_err(|error| anyhow::anyhow!(\"session index cleanup task failed: {error}\"));\n    match result {\n        Ok(Ok(cleanup)) => ok(\n            &format!(\n                \"已清理 {} 条失效任务索引；原索引已完整备份。\",\n                cleanup.pruned_entries\n            ),\n            json!({\n                \"prunedEntries\": cleanup.pruned_entries,\n                \"backupDir\": cleanup.backup_dir,\n            }),\n        ),\n        Ok(Err(error)) => {\n            let backup_hint = error\n                .backup_dir\n                .as_ref()\n                .map(|path| format!(\" 备份目录：{}。\", path.to_string_lossy()))\n                .unwrap_or_default();\n            failed(","sourceCodeStart":2907,"sourceCodeEnd":2943,"githubUrl":"https://github.com/BigPizzaV3/CodexPlusPlus/blob/f2074595a281bc057525c748175c8eb9805b0673/apps/codex-plus-manager/src-tauri/src/commands.rs#L2907-L2943","documentation":"Wrapped failure thrown by the apply_session_index_cleanup Tauri command when its spawn_blocking task around codex_plus_data::apply_session_index_cleanup fails at the task level (JoinError), reported as \"session index cleanup task failed: {error}\". Distinguishes wrapper death from cleanup-domain errors (e.g. stale snapshot), which the inner call returns.","triggerScenarios":"Thrown at apps/codex-plus-manager/src-tauri/src/commands.rs:2925 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["查看清理任务的 panic 日志","确认快照哈希与 thread_ids 输入合法","重试清理（幂等操作）","修复 apply_session_index_cleanup 内的 unwrap 路径"],"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"}