Kuberwastaken/claurst · error · anyhow::Error

poll_bridge_messages: auth error

Error message

poll_bridge_messages: auth error (HTTP {})

What it means

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.

Solutions

  1. Get a new token from https://claude.ai (Settings → Remote Control) and re-register the bridge session
  2. Check that the token was copied in full without whitespace or truncation
  3. Restart the bridge loop after updating the token so registration re-runs
Defensive patterns

Strategy: fallback

When it happens

Trigger: Thrown at src-rust/crates/bridge/src/lib.rs:1105 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of Kuberwastaken/claurst@b0637c97ec (2026-09-10). Data as JSON: /api/errors/30364283456a7d1b. Report an issue: GitHub.

Appendix: source

Thrown at src-rust/crates/bridge/src/lib.rs:1105

                    return Ok(vec![]);
                }
                let msgs: Vec<SimpleMessage> =
                    serde_json::from_str(&text).context("poll_bridge_messages: JSON parse")?;
                return Ok(msgs);
            }
            204 => return Ok(vec![]),
            429 => {
                attempt += 1;
                if attempt > max_retries {
                    anyhow::bail!("poll_bridge_messages: rate-limited (HTTP 429) after {} retries", max_retries);
                }
                let backoff = std::time::Duration::from_millis(1_000 * 2u64.pow(attempt - 1));
                warn!(attempt, "Bridge poll rate-limited; backing off {:?}", backoff);
                tokio::time::sleep(backoff).await;
                continue;
            }
            401 | 403 => {
                anyhow::bail!("poll_bridge_messages: auth error (HTTP {})", status);
            }
            _ => {
                anyhow::bail!("poll_bridge_messages: server returned HTTP {}", status);
            }
        }
    }
}

/// Post a response to a specific incoming message on an active bridge session.
///
/// PUTs `/api/bridge/sessions/<session_id>/messages/<msg_id>/response` with
/// a JSON body `{"content": "<response>", "done": true}`.
pub async fn post_bridge_response(
    info: &BridgeSessionInfo,
    msg_id: &str,
    content: &str,
    done: bool,
) -> anyhow::Result<()> {

View on GitHub (pinned to b0637c97ec)