{"record":{"id":"0b8947a7b72cf95e","repo":"BigPizzaV3/CodexPlusPlus","slug":"error-0b8947","errorCode":null,"errorMessage":"微信连接已在运行或正在停止","messagePattern":"微信连接已在运行或正在停止","errorType":"exception","errorClass":"anyhow::Error","httpStatus":null,"severity":"error","filePath":"apps/codex-plus-manager/src-tauri/src/commands.rs","lineNumber":1192,"sourceCode":"        token: settings.weixin_connect_token,\n        account_id: settings.weixin_connect_account_id,\n        allow_from: settings.weixin_connect_allow_from,\n        route_tag: settings.weixin_connect_route_tag,\n        work_dir: settings.weixin_connect_work_dir,\n        model: settings.weixin_connect_model,\n        sandbox: settings.weixin_connect_sandbox,\n        codex_path: settings.weixin_connect_codex_path,\n    }\n    .normalized();\n    if config.token.is_empty() {\n        anyhow::bail!(\"微信连接 token 为空\");\n    }\n    let stop = Arc::new(AtomicBool::new(false));\n    let mut runtime = weixin_runtime()\n        .lock()\n        .map_err(|_| anyhow::anyhow!(\"微信连接运行锁已损坏\"))?;\n    if runtime.is_some() {\n        anyhow::bail!(\"微信连接已在运行或正在停止\");\n    }\n    *runtime = Some(WeixinRuntime {\n        stop: Arc::clone(&stop),\n    });\n    drop(runtime);\n    let status = weixin_status();\n    if let Ok(mut current) = status.lock() {\n        current.state = \"starting\".to_string();\n        current.message = \"正在启动微信连接...\".to_string();\n        current.account_id = config.account_id.clone();\n        current.has_token = true;\n    }\n    let task_status = Arc::clone(&status);\n    let task_stop = Arc::clone(&stop);\n    tauri::async_runtime::spawn(async move {\n        if let Err(error) = codex_plus_core::connect::run_weixin_connect(\n            config,\n            stop,","sourceCodeStart":1174,"sourceCodeEnd":1210,"githubUrl":"https://github.com/BigPizzaV3/CodexPlusPlus/blob/f2074595a281bc057525c748175c8eb9805b0673/apps/codex-plus-manager/src-tauri/src/commands.rs#L1174-L1210","documentation":"Guard inside spawn_weixin_connect that fires when the WeChat connect runtime refuses to start because another connect instance is currently active or a previous one is still shutting down. The offending input is the shared run-state (lock/stop flag) of the WeChat connect feature, not user text: it indicates a lifecycle conflict — stop the running instance (or wait for the in-progress stop to finish) before spawning again.","triggerScenarios":"Thrown at apps/codex-plus-manager/src-tauri/src/commands.rs:1192 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Wait for the existing connect to stop, then retry","Use the already-running connection instead of spawning a new one","Force-stop the current weixin connect if stuck"],"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-14T00:17:10.932Z"}