BigPizzaV3/CodexPlusPlus · error · anyhow::Error

微信连接 token 为空

Error message

微信连接 token 为空

What it means

Thrown by spawn_weixin_connect after building and normalizing the WeixinConnectConfig from BackendSettings. Fires when the normalized weixin_connect_token field is empty, meaning the user enabled the WeChat connect feature without pasting the verification token the WeChat side requires. The offending input is settings.weixin_connect_token (empty after normalization); the connection is never started until a token is supplied.

Source

Thrown at apps/codex-plus-manager/src-tauri/src/commands.rs:1185

}

fn spawn_weixin_connect(
    settings: BackendSettings,
) -> anyhow::Result<codex_plus_core::connect::WeixinConnectStatus> {
    let config = codex_plus_core::connect::WeixinConnectConfig {
        base_url: settings.weixin_connect_base_url,
        token: settings.weixin_connect_token,
        account_id: settings.weixin_connect_account_id,
        allow_from: settings.weixin_connect_allow_from,
        route_tag: settings.weixin_connect_route_tag,
        work_dir: settings.weixin_connect_work_dir,
        model: settings.weixin_connect_model,
        sandbox: settings.weixin_connect_sandbox,
        codex_path: settings.weixin_connect_codex_path,
    }
    .normalized();
    if config.token.is_empty() {
        anyhow::bail!("微信连接 token 为空");
    }
    let stop = Arc::new(AtomicBool::new(false));
    let mut runtime = weixin_runtime()
        .lock()
        .map_err(|_| anyhow::anyhow!("微信连接运行锁已损坏"))?;
    if runtime.is_some() {
        anyhow::bail!("微信连接已在运行或正在停止");
    }
    *runtime = Some(WeixinRuntime {
        stop: Arc::clone(&stop),
    });
    drop(runtime);
    let status = weixin_status();
    if let Ok(mut current) = status.lock() {
        current.state = "starting".to_string();
        current.message = "正在启动微信连接...".to_string();
        current.account_id = config.account_id.clone();
        current.has_token = true;

View on GitHub (pinned to f2074595a2)

Solutions

  1. Enter the weixin connect token in Codex++ settings
  2. Verify the token wasn't cleared by a settings migration
  3. Re-copy the token from the bridge service
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at apps/codex-plus-manager/src-tauri/src/commands.rs:1185 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/de8bccfedc496069. Report an issue: GitHub.