{"record":{"id":"b03f7dbe03511fca","repo":"BigPizzaV3/CodexPlusPlus","slug":"error-b03f7d","errorCode":null,"errorMessage":"找不到原生会话文件","messagePattern":"找不到原生会话文件","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/codex-plus-core/src/session_share.rs","lineNumber":186,"sourceCode":"        .unwrap_or(\"导入的会话\");\n    import_rollout(\n        home,\n        &json!({\n            \"kind\": \"codex-rollout\",\n            \"session_id\": session_id,\n            \"content\": content,\n            \"title\": title,\n        }),\n    )\n}\n\npub fn export_rollout(home: &Path, session_id: &str) -> anyhow::Result<Value> {\n    let session_id = session_id.trim();\n    if session_id.is_empty() {\n        bail!(\"会话 ID 为空\");\n    }\n    let path =\n        find_rollout(home, session_id).ok_or_else(|| anyhow::anyhow!(\"找不到原生会话文件\"))?;\n    let bytes = fs::read(&path).with_context(|| format!(\"读取会话文件失败：{}\", path.display()))?;\n    if bytes.len() > MAX_ROLLOUT_BYTES {\n        bail!(\"会话文件超过分享大小限制\");\n    }\n    let content = String::from_utf8(bytes).context(\"会话文件不是有效的 UTF-8\")?;\n    Ok(json!({\n        \"status\": \"ok\",\n        \"kind\": \"codex-rollout\",\n        \"session_id\": session_id,\n        \"content\": content,\n        \"filename\": path.file_name().and_then(|value| value.to_str()).unwrap_or(\"rollout.jsonl\"),\n    }))\n}\n\npub fn import_rollout(home: &Path, payload: &Value) -> anyhow::Result<Value> {\n    if payload.get(\"kind\").and_then(Value::as_str) != Some(\"codex-rollout\") {\n        bail!(\"不支持的会话文件格式\");\n    }","sourceCodeStart":168,"sourceCodeEnd":204,"githubUrl":"https://github.com/BigPizzaV3/CodexPlusPlus/blob/f2074595a281bc057525c748175c8eb9805b0673/crates/codex-plus-core/src/session_share.rs#L168-L204","documentation":"export_rollout trims the session ID, rejects empty IDs, then locates the rollout file under the Codex home via find_rollout. This error fires when find_rollout returns None — no rollout file exists for that session ID under sessions — so the requested session cannot be exported.","triggerScenarios":"Thrown at crates/codex-plus-core/src/session_share.rs:186 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Verify the session ID is correct and the session actually exists","Check CODEX_HOME/sessions for the rollout file","Re-check whether the session was deleted or belongs to a different home directory"],"exampleFix":null,"handlingStrategy":"type-guard","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"}