{"record":{"id":"aca3d6d304738c95","repo":"Hmbown/CodeWhale","slug":"runtime-api-bridge-exited-before-becoming-ready-s","errorCode":null,"errorMessage":"runtime API bridge exited before becoming ready (status {status})","messagePattern":"runtime API bridge exited before becoming ready \\(status (.+?)\\)","errorType":"exception","errorClass":"anyhow::Error","httpStatus":null,"severity":"error","filePath":"crates/app-server/src/lib.rs","lineNumber":1072,"sourceCode":"            .arg(port.to_string())\n            .env(\"CODEWHALE_RUNTIME_TOKEN\", auth_token)\n            .env(\"DEEPSEEK_RUNTIME_TOKEN\", auth_token)\n            .stdin(Stdio::null())\n            .stdout(Stdio::null())\n            .stderr(Stdio::null());\n        if let Some(config_path) = config_path {\n            command.arg(\"--config\").arg(config_path);\n        }\n        Ok(command)\n    }\n\n    async fn wait_until_ready(&mut self) -> Result<()> {\n        let deadline = Instant::now() + Duration::from_secs(15);\n        loop {\n            if let Some(child) = self.child.as_mut()\n                && let Some(status) = child.try_wait()?\n            {\n                return Err(anyhow!(\n                    \"runtime API bridge exited before becoming ready (status {status})\"\n                ));\n            }\n\n            match self\n                .client\n                .get(format!(\"{}/health\", self.base_url))\n                .send()\n                .await\n            {\n                Ok(response) if response.status().is_success() => return Ok(()),\n                _ if Instant::now() >= deadline => {\n                    bail!(\n                        \"timed out waiting for runtime API bridge at {}/health\",\n                        self.base_url\n                    )\n                }\n                _ => tokio::time::sleep(Duration::from_millis(50)).await,","sourceCodeStart":1054,"sourceCodeEnd":1090,"githubUrl":"https://github.com/Hmbown/CodeWhale/blob/0c42157ee52f9d55af2b506d71b46249910f77d3/crates/app-server/src/lib.rs#L1054-L1090","documentation":"The spawned runtime API bridge child process terminated with the given {status} before its HTTP listener became ready within the 15-second startup deadline in wait_until_ready. The bridge is the local sidecar the app server proxies turn requests through, so this means the runtime never came up — the status code identifies how the child exited.","triggerScenarios":"Thrown at crates/app-server/src/lib.rs:1072 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Check the runtime bridge logs/stderr for why it exited (port conflicts, missing binary, bad config)","Verify the runtime token and --config path passed to the child are valid","Free the reserved port or restart the app server so a fresh child is spawned","Upgrade or reinstall the runtime binary in case it is corrupt or incompatible"],"exampleFix":null,"handlingStrategy":"retry","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"0c42157ee52f9d55af2b506d71b46249910f77d3","analyzedAt":"2026-08-20T21:50:45.477Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}