{"record":{"id":"2b6be110b96bad8a","repo":"Kuberwastaken/claurst","slug":"poll-bridge-messages-server-returned-http","errorCode":null,"errorMessage":"poll_bridge_messages: server returned HTTP {}","messagePattern":"poll_bridge_messages: server returned HTTP (.+?)","errorType":"http","errorClass":"anyhow::Error","httpStatus":null,"severity":"error","filePath":"src-rust/crates/bridge/src/lib.rs","lineNumber":1108,"sourceCode":"                    serde_json::from_str(&text).context(\"poll_bridge_messages: JSON parse\")?;\r\n                return Ok(msgs);\r\n            }\r\n            204 => return Ok(vec![]),\r\n            429 => {\r\n                attempt += 1;\r\n                if attempt > max_retries {\r\n                    anyhow::bail!(\"poll_bridge_messages: rate-limited (HTTP 429) after {} retries\", max_retries);\r\n                }\r\n                let backoff = std::time::Duration::from_millis(1_000 * 2u64.pow(attempt - 1));\r\n                warn!(attempt, \"Bridge poll rate-limited; backing off {:?}\", backoff);\r\n                tokio::time::sleep(backoff).await;\r\n                continue;\r\n            }\r\n            401 | 403 => {\r\n                anyhow::bail!(\"poll_bridge_messages: auth error (HTTP {})\", status);\r\n            }\r\n            _ => {\r\n                anyhow::bail!(\"poll_bridge_messages: server returned HTTP {}\", status);\r\n            }\r\n        }\r\n    }\r\n}\r\n\r\n/// Post a response to a specific incoming message on an active bridge session.\r\n///\r\n/// PUTs `/api/bridge/sessions/<session_id>/messages/<msg_id>/response` with\r\n/// a JSON body `{\"content\": \"<response>\", \"done\": true}`.\r\npub async fn post_bridge_response(\r\n    info: &BridgeSessionInfo,\r\n    msg_id: &str,\r\n    content: &str,\r\n    done: bool,\r\n) -> anyhow::Result<()> {\r\n    let server_url = std::env::var(\"CLAURST_BRIDGE_URL\")\r\n        .or_else(|_| std::env::var(\"CLAUDE_BRIDGE_BASE_URL\"))\r\n        .unwrap_or_else(|_| \"https://claude.ai\".to_string());\r","sourceCodeStart":1090,"sourceCodeEnd":1126,"githubUrl":"https://github.com/Kuberwastaken/claurst/blob/b0637c97ec34144387cbf2f74f65df6d16a6cef1/src-rust/crates/bridge/src/lib.rs#L1090-L1126","documentation":"Catch-all failure for the bridge message poll: the GET returned a status outside the handled set (200/204/429/auth errors) — typically a 5xx or unexpected 3xx from the bridge server. The formatted status identifies which unclassified response ended the poll iteration.","triggerScenarios":"Thrown at src-rust/crates/bridge/src/lib.rs:1108 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Retry the poll after a short delay; transient server errors often clear","Capture the status code and response body to classify the failure if it persists","Verify the bridge endpoint URL matches the current deployment"],"exampleFix":null,"handlingStrategy":"fallback","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"b0637c97ec34144387cbf2f74f65df6d16a6cef1","analyzedAt":"2026-09-10T00:24:58.650Z","contentChangedAt":"2026-09-10T00:24:58.650Z","schemaVersion":2},"datasetVersion":"2026-09-17T15:17:12.973Z"}