BigPizzaV3/CodexPlusPlus · error · anyhow::Error

待处理的一键换肤记录无效

Error message

待处理的一键换肤记录无效

What it means

Raised in load_pending_community_link: the pending one-click-skin link record file exists but is invalid — it is not a regular file (symlink or other special file) or otherwise fails safety checks, so the stored link cannot be trusted and is rejected instead of being processed.

Source

Thrown at crates/codex-plus-core/src/dream_skin_community.rs:236

fn version_id_from_link(url: &str) -> anyhow::Result<String> {
    let version_id = url
        .strip_prefix("dreamskin://apply?version=")
        .or_else(|| url.strip_prefix("dreamskin://apply/?version="))
        .context("一键换肤链接无效")?;
    validate_version_id(version_id)?;
    Ok(version_id.to_string())
}

pub fn load_pending_community_link() -> anyhow::Result<Option<String>> {
    let path = pending_link_path();
    if !path.exists() {
        return Ok(None);
    }
    let metadata = std::fs::symlink_metadata(&path)?;
    if !metadata.file_type().is_file() || metadata.file_type().is_symlink() || metadata.len() > 4096
    {
        bail!("待处理的一键换肤记录无效");
    }
    let value: serde_json::Value = serde_json::from_slice(&std::fs::read(path)?)?;
    let version_id = value
        .get("versionId")
        .and_then(serde_json::Value::as_str)
        .context("待处理的一键换肤记录缺少版本 ID")?
        .to_string();
    validate_version_id(&version_id)?;
    Ok(Some(version_id))
}

pub fn clear_pending_community_link() -> anyhow::Result<()> {
    let path = pending_link_path();
    match std::fs::remove_file(path) {
        Ok(()) => Ok(()),
        Err(error) if error.kind() == std::io::ErrorKind::NotFound => Ok(()),
        Err(error) => Err(error.into()),
    }

View on GitHub (pinned to f2074595a2)

Solutions

  1. Delete the invalid pending-link file in the app state dir and re-apply the link
  2. Re-trigger the one-click skin apply from the community page
  3. Check for symlink attacks or manual tampering in the state dir
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at crates/codex-plus-core/src/dream_skin_community.rs:236 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/0e918d0b7568e42f. Report an issue: GitHub.