{"record":{"id":"7fc6953621f3ab79","repo":"BigPizzaV3/CodexPlusPlus","slug":"codex-rollout","errorCode":null,"errorMessage":"当前分享内容不是可导入的 Codex rollout 会话","messagePattern":"当前分享内容不是可导入的 Codex rollout 会话","errorType":"validation","errorClass":"anyhow::Error","httpStatus":null,"severity":"error","filePath":"crates/codex-plus-core/src/session_share.rs","lineNumber":102,"sourceCode":"        .context(\"分享会话不存在、已撤销或已过期\")?\n        .json::<Value>()\n        .await\n        .context(\"分享会话响应格式无效\")?;\n    let encrypted = record\n        .get(\"encrypted\")\n        .context(\"分享会话缺少加密内容\")?;\n    let key_value = parsed\n        .fragment()\n        .and_then(|fragment| {\n            fragment\n                .split('&')\n                .find_map(|pair| pair.strip_prefix(\"k=\"))\n        })\n        .context(\"分享链接缺少解密密钥\")?;\n    let plaintext = decrypt_shared_payload(encrypted, key_value)?;\n    let payload: Value = serde_json::from_slice(&plaintext).context(\"分享会话内容格式无效\")?;\n    if payload.get(\"kind\").and_then(Value::as_str) != Some(\"codex-rollout\") {\n        bail!(\"当前分享内容不是可导入的 Codex rollout 会话\");\n    }\n    import_rollout(home, &payload)\n}\n\nfn validate_share_url(url: &str) -> anyhow::Result<reqwest::Url> {\n    let parsed = reqwest::Url::parse(url.trim()).context(\"分享 URL 格式无效\")?;\n    if parsed.scheme() != \"https\" || !parsed.host_str().is_some_and(|host| SHARE_HOSTS.contains(&host)) {\n        bail!(\"仅支持 Codex++ 分享站点链接\");\n    }\n    if parsed.fragment().is_none() {\n        bail!(\"分享链接缺少解密密钥\");\n    }\n    Ok(parsed)\n}\n\nfn decrypt_shared_payload(encrypted: &Value, key_value: &str) -> anyhow::Result<Vec<u8>> {\n    if encrypted.get(\"v\").and_then(Value::as_u64) != Some(1) {\n        bail!(\"不支持此分享的数据格式\");","sourceCodeStart":84,"sourceCodeEnd":120,"githubUrl":"https://github.com/BigPizzaV3/CodexPlusPlus/blob/b1ed92e5e4a2d74095d4b8db5af43cef7acba9c6/crates/codex-plus-core/src/session_share.rs#L84-L120","documentation":"import_shared_session_url fetched the share record, decrypted it with the key from the URL fragment, parsed the JSON, and found payload.kind != 'codex-rollout'. The link and key were valid, but the content is not a Codex rollout session, so it cannot be imported as one.","triggerScenarios":"The decrypted shared payload JSON lacks a \"kind\" field of \"codex-rollout\" — e.g. the share page exported a different payload type or a hand-crafted/garbled payload was uploaded.","commonSituations":"Importing a share created by an older or newer Codex++ version with a different payload schema; someone crafting a custom share link with arbitrary JSON; corrupted share content.","solutions":["Re-share the session with the current Codex++ version so the payload has kind:\"codex-rollout\"","Verify the share link points at a genuine Codex rollout export, not arbitrary JSON","Check for version mismatch between sharer and importer and upgrade"],"exampleFix":null,"handlingStrategy":"validation","validationCode":"fn payload_is_rollout(payload: &serde_json::Value) -> bool {\n    payload.get(\"kind\").and_then(serde_json::Value::as_str) == Some(\"codex-rollout\")\n}","typeGuard":"fn as_rollout_payload(v: &serde_json::Value) -> Option<&serde_json::Value> {\n    (v.get(\"kind\").and_then(serde_json::Value::as_str) == Some(\"codex-rollout\")).then_some(v)\n}","tryCatchPattern":null,"preventionTips":["Check payload \"kind\" before invoking import","Keep sharer and importer versions aligned","Log the received kind value to diagnose schema mismatches"],"tags":["import","schema","session"],"backgroundTag":"schema-validation-failed","analyzedSha":"b1ed92e5e4a2d74095d4b8db5af43cef7acba9c6","analyzedAt":"2026-09-19T23:35:21.129Z","contentChangedAt":"2026-09-19T23:35:21.129Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}