{"record":{"id":"f828d7398401168a","repo":"BigPizzaV3/CodexPlusPlus","slug":"codex-f828d7","errorCode":null,"errorMessage":"不是 Codex++ 会话导入链接","messagePattern":"不是 Codex\\+\\+ 会话导入链接","errorType":"validation","errorClass":"anyhow::Error","httpStatus":null,"severity":"error","filePath":"crates/codex-plus-core/src/session_share.rs","lineNumber":18,"sourceCode":"use aes_gcm::{Aes256Gcm, KeyInit, Nonce, aead::Aead};\nuse anyhow::{Context, bail};\nuse base64::Engine;\nuse rusqlite::Connection;\nuse serde_json::{Value, json};\nuse std::fs::{self, OpenOptions};\nuse std::io::Write;\nuse std::path::{Path, PathBuf};\nuse std::time::{SystemTime, UNIX_EPOCH};\nuse uuid::Uuid;\n\nconst MAX_ROLLOUT_BYTES: usize = 16 * 1024 * 1024;\nconst SHARE_HOSTS: &[&str] = &[\"share.codexpp.cc\", \"codexpp-share.pages.dev\"];\n\npub fn save_pending_session_share_from_protocol_url(url: &str) -> anyhow::Result<String> {\n    let parsed = reqwest::Url::parse(url).context(\"会话导入链接格式无效\")?;\n    if parsed.scheme() != \"codexplusplus\" || parsed.host_str() != Some(\"session\") {\n        bail!(\"不是 Codex++ 会话导入链接\");\n    }\n    let share_url = parsed\n        .query_pairs()\n        .find(|(key, _)| key == \"url\")\n        .map(|(_, value)| value.into_owned())\n        .context(\"会话导入链接缺少分享 URL\")?;\n    validate_share_url(&share_url)?;\n    let path = crate::paths::default_pending_session_share_path();\n    if let Some(parent) = path.parent() {\n        fs::create_dir_all(parent)?;\n    }\n    fs::write(&path, format!(\"{share_url}\\n\"))?;\n    Ok(share_url)\n}\n\npub fn load_pending_session_share() -> anyhow::Result<Option<String>> {\n    let path = crate::paths::default_pending_session_share_path();\n    if !path.exists() {","sourceCodeStart":1,"sourceCodeEnd":36,"githubUrl":"https://github.com/BigPizzaV3/CodexPlusPlus/blob/f2074595a281bc057525c748175c8eb9805b0673/crates/codex-plus-core/src/session_share.rs#L1-L36","documentation":"Thrown by save_pending_session_share_from_protocol_url when a codexpp://-style protocol URL does not carry the marker that identifies a Codex++ session import link. The URL parsed successfully but is some other protocol payload; the offending input is the protocol URL's identifying fields, and the handler refuses to treat foreign links as session shares.","triggerScenarios":"Thrown at crates/codex-plus-core/src/session_share.rs:18 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-14T05:17:10.506Z"}