BigPizzaV3/CodexPlusPlus · error · anyhow::Error

不支持此分享的数据格式

Error message

不支持此分享的数据格式

What it means

Thrown by decrypt_shared_payload when the encrypted record's v field is not 1 — the only share-payload crypto layout this client implements. The offending input is the version marker inside the share's `encrypted` JSON; a different version means newer/older crypto framing that cannot be decrypted here.

Source

Thrown at crates/codex-plus-core/src/session_share.rs:120

        bail!("当前分享内容不是可导入的 Codex rollout 会话");
    }
    import_rollout(home, &payload)
}

fn validate_share_url(url: &str) -> anyhow::Result<reqwest::Url> {
    let parsed = reqwest::Url::parse(url.trim()).context("分享 URL 格式无效")?;
    if parsed.scheme() != "https" || !parsed.host_str().is_some_and(|host| SHARE_HOSTS.contains(&host)) {
        bail!("仅支持 Codex++ 分享站点链接");
    }
    if parsed.fragment().is_none() {
        bail!("分享链接缺少解密密钥");
    }
    Ok(parsed)
}

fn decrypt_shared_payload(encrypted: &Value, key_value: &str) -> anyhow::Result<Vec<u8>> {
    if encrypted.get("v").and_then(Value::as_u64) != Some(1) {
        bail!("不支持此分享的数据格式");
    }
    let decode = |field: &str| -> anyhow::Result<Vec<u8>> {
        let value = encrypted
            .get(field)
            .and_then(Value::as_str)
            .with_context(|| format!("分享数据缺少 {field}"))?;
        base64::engine::general_purpose::URL_SAFE_NO_PAD
            .decode(value)
            .with_context(|| format!("分享数据 {field} 无效"))
    };
    let key = base64::engine::general_purpose::URL_SAFE_NO_PAD
        .decode(key_value)
        .context("分享链接解密密钥无效")?;
    let iv = decode("iv")?;
    let ciphertext = decode("ciphertext")?;
    if key.len() != 32 || iv.len() != 12 || ciphertext.len() > MAX_ROLLOUT_BYTES + 16 {
        bail!("分享数据大小或格式无效");
    }

View on GitHub (pinned to f2074595a2)

Solutions

  1. 升级 Codex++ 以支持新的分享加密格式
  2. 用兼容版本重新生成分享
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at crates/codex-plus-core/src/session_share.rs:120 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/de191b0bcb543008. Report an issue: GitHub.