{"record":{"id":"3ef6f3956cba2832","repo":"BigPizzaV3/CodexPlusPlus","slug":"bridge-context-is-not-initialized","errorCode":null,"errorMessage":"bridge context is not initialized","messagePattern":"bridge context is not initialized","errorType":"exception","errorClass":"anyhow::Error","httpStatus":null,"severity":"error","filePath":"apps/codex-plus-launcher/src/main.rs","lineNumber":43,"sourceCode":"        Self {\n            core: Arc::new(DefaultLaunchHooks::default()),\n            data: Arc::new(LauncherDataService::default()),\n            runtime: Arc::new(LauncherRuntimeService::new(\n                9229,\n                default_user_script_manager(),\n            )),\n            bridge_context: Arc::new(Mutex::new(None)),\n        }\n    }\n}\n\nimpl LauncherHooks {\n    fn watchdog_bridge_context(&self) -> anyhow::Result<BridgeContext> {\n        self.bridge_context\n            .lock()\n            .map_err(|_| anyhow::anyhow!(\"bridge context lock poisoned\"))?\n            .clone()\n            .ok_or_else(|| anyhow::anyhow!(\"bridge context is not initialized\"))\n    }\n}\n\n#[tokio::main]\nasync fn main() -> Result<()> {\n    let args = std::env::args().skip(1).collect::<Vec<_>>();\n    let helper_only = args.iter().any(|arg| arg == \"--helper-only\");\n    let options = parse_launch_options(args.iter());\n    if let Err(error) = launcher_main(args, helper_only, options.clone()).await {\n        let _ = codex_plus_core::diagnostic_log::append_diagnostic_log(\n            \"launcher.failed\",\n            json!({\n                \"message\": error.to_string()\n            }),\n        );\n        if !helper_only {\n            let _ = options.status_store.save_latest(&LaunchStatus {\n                status: \"failed\".to_string(),","sourceCodeStart":25,"sourceCodeEnd":61,"githubUrl":"https://github.com/BigPizzaV3/CodexPlusPlus/blob/f2074595a281bc057525c748175c8eb9805b0673/apps/codex-plus-launcher/src/main.rs#L25-L61","documentation":"Thrown by LauncherHooks::watchdog_bridge_context when the lock is acquired cleanly but the contained Option<BridgeContext> is None — the bridge was never initialized before the watchdog needed it. The offending input is the uninitialized bridge_context slot; start_bridge_watchdog hits this when it runs ahead of the first bridge setup.","triggerScenarios":"Thrown at apps/codex-plus-launcher/src/main.rs:43 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["等待首次 bridge 连接建立后再启动 watchdog","检查初始化 bridge_context 的代码路径是否失败或被跳过","确保 start_bridge_watchdog 在 init 写入 Some(ctx) 之后调用","watchdog 捕获此错误后延迟重试而非直接失败"],"exampleFix":null,"handlingStrategy":"retry","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"}