{"record":{"id":"6aa6abaf7e0e7f74","repo":"openai/codex","slug":"empty-session-file","errorCode":null,"errorMessage":"empty session file: {}","messagePattern":"empty session file: (.+?)","errorType":"exception","errorClass":"anyhow::Error","httpStatus":null,"severity":"error","filePath":"codex-rs/rollout/src/metadata.rs","lineNumber":118,"sourceCode":"/// Normal rollouts use `rollout-<timestamp>-<thread-id>.jsonl`, where the thread ID and rollout ID\n/// are the same. Threads that have been `reverted` use\n/// `rollout-<timestamp>-<thread-id>_<rollout-id>.jsonl`, where this returns the ID after `_`.\n///\n/// This can differ from [`SessionMeta::id`] when `thread/revert` keeps the thread ID stable while\n/// switching to a new immutable rollout file.\npub fn rollout_id_from_path(rollout_path: &Path) -> Option<RolloutId> {\n    let file_name = rollout_path.file_name()?.to_str()?;\n    Some(RolloutFileName::parse(file_name)?.rollout_id())\n}\n\npub async fn extract_metadata_from_rollout(\n    rollout_path: &Path,\n    default_provider: &str,\n) -> anyhow::Result<ExtractionOutcome> {\n    let (items, _thread_id, parse_errors) =\n        RolloutRecorder::load_rollout_items(rollout_path).await?;\n    if items.is_empty() {\n        return Err(anyhow::anyhow!(\n            \"empty session file: {}\",\n            rollout_path.display()\n        ));\n    }\n    let builder = builder_from_items(items.as_slice(), rollout_path).ok_or_else(|| {\n        anyhow::anyhow!(\n            \"rollout missing metadata builder: {}\",\n            rollout_path.display()\n        )\n    })?;\n    let mut metadata = builder.build(default_provider);\n    for item in &items {\n        apply_rollout_item(&mut metadata, item, default_provider);\n    }\n    if let Some(updated_at) = file_modified_time_utc(rollout_path).await {\n        metadata.updated_at = updated_at;\n        metadata.recency_at = updated_at;\n    }","sourceCodeStart":100,"sourceCodeEnd":136,"githubUrl":"https://github.com/openai/codex/blob/339751715c64496cb86246bfb3935f40e309dd3d/codex-rs/rollout/src/metadata.rs#L100-L136","documentation":"Error \"empty session file: {}\" thrown in openai/codex.","triggerScenarios":"Thrown at codex-rs/rollout/src/metadata.rs:118 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"339751715c64496cb86246bfb3935f40e309dd3d","analyzedAt":"2026-08-25T05:35:09.876Z","schemaVersion":2},"datasetVersion":"2026-08-25T06:17:31.827Z"}