{"record":{"id":"30364283456a7d1b","repo":"Kuberwastaken/claurst","slug":"poll-bridge-messages-auth-error-http","errorCode":null,"errorMessage":"poll_bridge_messages: auth error (HTTP {})","messagePattern":"poll_bridge_messages: auth error \\(HTTP (.+?)\\)","errorType":"http","errorClass":"anyhow::Error","httpStatus":401,"severity":"error","filePath":"src-rust/crates/bridge/src/lib.rs","lineNumber":1105,"sourceCode":"                    return Ok(vec![]);\r\n                }\r\n                let msgs: Vec<SimpleMessage> =\r\n                    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","sourceCodeStart":1087,"sourceCodeEnd":1123,"githubUrl":"https://github.com/Kuberwastaken/claurst/blob/b0637c97ec34144387cbf2f74f65df6d16a6cef1/src-rust/crates/bridge/src/lib.rs#L1087-L1123","documentation":"Terminal authentication failure while long-polling bridge messages: the GET returned 401/403 (the formatted status), meaning the bearer session token is invalid, expired, or lacks scope. Retrying will not help until a fresh token is obtained.","triggerScenarios":"Thrown at src-rust/crates/bridge/src/lib.rs:1105 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Get a new token from https://claude.ai (Settings → Remote Control) and re-register the bridge session","Check that the token was copied in full without whitespace or truncation","Restart the bridge loop after updating the token so registration re-runs"],"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"}