BigPizzaV3/CodexPlusPlus · error
找不到原生会话文件
Error message
找不到原生会话文件
What it means
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.
Source
Thrown at crates/codex-plus-core/src/session_share.rs:186
.unwrap_or("导入的会话");
import_rollout(
home,
&json!({
"kind": "codex-rollout",
"session_id": session_id,
"content": content,
"title": title,
}),
)
}
pub fn export_rollout(home: &Path, session_id: &str) -> anyhow::Result<Value> {
let session_id = session_id.trim();
if session_id.is_empty() {
bail!("会话 ID 为空");
}
let path =
find_rollout(home, session_id).ok_or_else(|| anyhow::anyhow!("找不到原生会话文件"))?;
let bytes = fs::read(&path).with_context(|| format!("读取会话文件失败:{}", path.display()))?;
if bytes.len() > MAX_ROLLOUT_BYTES {
bail!("会话文件超过分享大小限制");
}
let content = String::from_utf8(bytes).context("会话文件不是有效的 UTF-8")?;
Ok(json!({
"status": "ok",
"kind": "codex-rollout",
"session_id": session_id,
"content": content,
"filename": path.file_name().and_then(|value| value.to_str()).unwrap_or("rollout.jsonl"),
}))
}
pub fn import_rollout(home: &Path, payload: &Value) -> anyhow::Result<Value> {
if payload.get("kind").and_then(Value::as_str) != Some("codex-rollout") {
bail!("不支持的会话文件格式");
}View on GitHub (pinned to f2074595a2)
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
Defensive patterns
Strategy: type-guard
When it happens
Trigger: Thrown at crates/codex-plus-core/src/session_share.rs:186 when the library encounters an invalid state.
Common situations: See trigger scenarios.
AI-assisted analysis of BigPizzaV3/CodexPlusPlus@f2074595a2 (2026-08-23).
Data as JSON: /api/errors/b03f7dbe03511fca.
Report an issue: GitHub.