BigPizzaV3/CodexPlusPlus · error · anyhow::Error

session index cleanup task failed: {error}

Error message

session index cleanup task failed: {error}

What it means

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.

Source

Thrown at apps/codex-plus-manager/src-tauri/src/commands.rs:2925

            json!({
                "snapshotSha256": preview.snapshot_sha256,
                "candidates": preview.candidates,
            }),
        ),
        Err(error) => failed(&format!("预览失效任务索引失败:{error}"), json!({})),
    }
}

#[tauri::command]
pub async fn apply_session_index_cleanup(
    snapshot_sha256: String,
    thread_ids: Vec<String>,
) -> CommandResult<Value> {
    let result = tauri::async_runtime::spawn_blocking(move || {
        codex_plus_data::apply_session_index_cleanup(None, &snapshot_sha256, &thread_ids)
    })
    .await
    .map_err(|error| anyhow::anyhow!("session index cleanup task failed: {error}"));
    match result {
        Ok(Ok(cleanup)) => ok(
            &format!(
                "已清理 {} 条失效任务索引;原索引已完整备份。",
                cleanup.pruned_entries
            ),
            json!({
                "prunedEntries": cleanup.pruned_entries,
                "backupDir": cleanup.backup_dir,
            }),
        ),
        Ok(Err(error)) => {
            let backup_hint = error
                .backup_dir
                .as_ref()
                .map(|path| format!(" 备份目录:{}。", path.to_string_lossy()))
                .unwrap_or_default();
            failed(

View on GitHub (pinned to f2074595a2)

Solutions

  1. 查看清理任务的 panic 日志
  2. 确认快照哈希与 thread_ids 输入合法
  3. 重试清理(幂等操作)
  4. 修复 apply_session_index_cleanup 内的 unwrap 路径
Defensive patterns

Strategy: retry

When it happens

Trigger: Thrown at apps/codex-plus-manager/src-tauri/src/commands.rs:2925 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of BigPizzaV3/CodexPlusPlus@f2074595a2 (2026-08-23). Data as JSON: /api/errors/99b72f0a9b706459. Report an issue: GitHub.