{"record":{"id":"668d8ca2f0301e47","repo":"BigPizzaV3/CodexPlusPlus","slug":"error-668d8c","errorCode":null,"errorMessage":"不支持的会话文件格式","messagePattern":"不支持的会话文件格式","errorType":"validation","errorClass":"anyhow::Error","httpStatus":null,"severity":"error","filePath":"crates/codex-plus-core/src/session_share.rs","lineNumber":203,"sourceCode":"    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    }\n    let source_id = payload\n        .get(\"session_id\")\n        .and_then(Value::as_str)\n        .unwrap_or_default();\n    let content = payload\n        .get(\"content\")\n        .and_then(Value::as_str)\n        .unwrap_or_default();\n    let title = payload\n        .get(\"title\")\n        .and_then(Value::as_str)\n        .unwrap_or(\"导入的会话\")\n        .trim();\n    if source_id.is_empty() || content.is_empty() {\n        bail!(\"会话文件内容不完整\");\n    }\n    if content.len() > MAX_ROLLOUT_BYTES {","sourceCodeStart":185,"sourceCodeEnd":221,"githubUrl":"https://github.com/BigPizzaV3/CodexPlusPlus/blob/f2074595a281bc057525c748175c8eb9805b0673/crates/codex-plus-core/src/session_share.rs#L185-L221","documentation":"Thrown by import_rollout when the payload's kind field is anything other than \"codex-rollout\". The importer accepts exactly one payload shape; the offending input is the kind field of the JSON handed in by import_shared_session_url or import_rollout_file, and the guard fires before session_id/content are inspected.","triggerScenarios":"Thrown at crates/codex-plus-core/src/session_share.rs:203 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["使用 Codex++ 导出的会话文件"],"exampleFix":null,"handlingStrategy":"validation","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"}