{"record":{"id":"bcf96d853a57f683","repo":"BigPizzaV3/CodexPlusPlus","slug":"error-bcf96d","errorCode":null,"errorMessage":"会话文件超过分享大小限制","messagePattern":"会话文件超过分享大小限制","errorType":"validation","errorClass":"anyhow::Error","httpStatus":null,"severity":"error","filePath":"crates/codex-plus-core/src/session_share.rs","lineNumber":189,"sourceCode":"        &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    }\n    let source_id = payload\n        .get(\"session_id\")\n        .and_then(Value::as_str)","sourceCodeStart":171,"sourceCodeEnd":207,"githubUrl":"https://github.com/BigPizzaV3/CodexPlusPlus/blob/f2074595a281bc057525c748175c8eb9805b0673/crates/codex-plus-core/src/session_share.rs#L171-L207","documentation":"Thrown by export_rollout after locating and reading the rollout file: its byte length exceeds MAX_ROLLOUT_BYTES (16 MiB), the cap the share pipeline enforces so exported payloads stay transmittable. The offending input is the size of the found session file at the located path.","triggerScenarios":"Thrown at crates/codex-plus-core/src/session_share.rs:189 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["先精简会话内容再分享","改为直接拷贝文件传输"],"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"}