{"record":{"id":"1fbf9fa4800a4864","repo":"BigPizzaV3/CodexPlusPlus","slug":"error-1fbf9f","errorCode":null,"errorMessage":"会话文件没有内容","messagePattern":"会话文件没有内容","errorType":"validation","errorClass":"anyhow::Error","httpStatus":null,"severity":"error","filePath":"crates/codex-plus-core/src/session_share.rs","lineNumber":440,"sourceCode":"                .file_name()\n                .and_then(|value| value.to_str())\n                .is_some_and(|name| name.contains(session_id))\n        {\n            return Some(path);\n        }\n    }\n    None\n}\n\nfn rewrite_rollout(content: &str, old_id: &str, new_id: &str) -> anyhow::Result<String> {\n    let mut lines = Vec::new();\n    for line in content.lines() {\n        let mut value: Value = serde_json::from_str(line).context(\"会话文件包含无效 JSON 行\")?;\n        replace_id(&mut value, old_id, new_id);\n        lines.push(serde_json::to_string(&value)?);\n    }\n    if lines.is_empty() {\n        bail!(\"会话文件没有内容\");\n    }\n    Ok(format!(\"{}\\n\", lines.join(\"\\n\")))\n}\n\nfn replace_id(value: &mut Value, old_id: &str, new_id: &str) {\n    match value {\n        Value::String(text) if text == old_id => *text = new_id.to_string(),\n        Value::Array(items) => items\n            .iter_mut()\n            .for_each(|item| replace_id(item, old_id, new_id)),\n        Value::Object(object) => object\n            .values_mut()\n            .for_each(|item| replace_id(item, old_id, new_id)),\n        _ => {}\n    }\n}\n\nfn find_session_id(content: &str) -> Option<String> {","sourceCodeStart":422,"sourceCodeEnd":458,"githubUrl":"https://github.com/BigPizzaV3/CodexPlusPlus/blob/f2074595a281bc057525c748175c8eb9805b0673/crates/codex-plus-core/src/session_share.rs#L422-L458","documentation":"Thrown by rewrite_rollout when the input content parsed line-by-line fine but produced zero lines — there is nothing to rewrite IDs in. The offending input is the rollout content string passed by import_rollout: effectively empty of JSONL lines despite passing earlier non-empty checks, so the import refuses to emit an empty rewritten file.","triggerScenarios":"Thrown at crates/codex-plus-core/src/session_share.rs:440 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["确认源文件是非空的 rollout JSONL","重新导出会话再导入"],"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"}