Kuberwastaken/claurst · error · anyhow::Error

post_bridge_event: server returned HTTP

Error message

post_bridge_event: server returned HTTP {}

What it means

The POST that uploads a bridge event (e.g. status/state changes) to the server returned a non-2xx status. The event was dropped from the server's view; causes range from auth failure to server errors on the events endpoint.

Solutions

  1. Log the status code and retry the event post; events are idempotent from the client's perspective
  2. Re-authenticate if the status is 401/403
  3. If failures persist, verify network access to the bridge API base URL
Defensive patterns

Strategy: retry

When it happens

Trigger: Thrown at src-rust/crates/bridge/src/lib.rs:1231 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/d7df9b03833a7d5d. Report an issue: GitHub.

Appendix: source

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

        session_id = %info.session_id,
        "Posting bridge event"
    );

    let resp = http
        .post(&url)
        .bearer_auth(&info.token)
        .header("anthropic-version", "2023-06-01")
        .json(&body)
        .send()
        .await
        .context("post_bridge_event: HTTP POST failed")?;

    let status = resp.status().as_u16();
    if resp.status().is_success() {
        debug!(session_id = %info.session_id, "Bridge event posted");
        Ok(())
    } else {
        anyhow::bail!(
            "post_bridge_event: server returned HTTP {}",
            status
        )
    }
}

// ---------------------------------------------------------------------------
// TUI-facing bridge event types (bridge → TUI state machine)
// ---------------------------------------------------------------------------

/// How the remote UI responded to a permission request.
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
#[serde(rename_all = "snake_case")]
pub enum PermissionResponseKind {
    Allow,
    Deny,
    AllowSession,
}

View on GitHub (pinned to b0637c97ec)