Kuberwastaken/claurst · error
Bridge register: no session token
Error message
Bridge register: no session token
What it means
The bridge's `register` method creates a Remote Control session on the claude.ai server, which requires a session token for authentication. If `config.session_token` is `None`, registration cannot proceed and this error is returned. It indicates the bridge was started without complete credentials.
Solutions
- Set `session_token` on the `BridgeConfig` before starting the bridge, e.g. from the env var CLAURST_BRIDGE_TOKEN.
- Use the higher-level start function that resolves the token from overrides/env (the path at lib.rs:938) instead of constructing `BridgeConfig` by hand.
- Re-authenticate to obtain a fresh token from claude.ai (Settings → Remote Control) if the old one was cleared.
Example fix
// before
let config = BridgeConfig { server_url, session_token: None, .. };
// after
let config = BridgeConfig {
server_url,
session_token: std::env::var("CLAURST_BRIDGE_TOKEN").ok(),
..Default::default()
}; Defensive patterns
Strategy: validation
Validate before calling
// Validate before calling register
if bridge.config.session_token.as_deref().unwrap_or("").is_empty() {
anyhow::bail!("Set CLAURST_BRIDGE_TOKEN before starting Remote Control");
} Try / catch
bridge.register().await.inspect_err(|e| {
if e.to_string().contains("no session token") {
eprintln!("Enable Remote Control by setting CLAURST_BRIDGE_TOKEN");
}
})?; Prevention
- Always construct BridgeConfig through a builder/start path that resolves the token from env.
- Check for the token at app startup when the Remote Control feature is enabled.
- Never build BridgeConfig with session_token: None in production code paths.
When it happens
Trigger: Calling `bridge.register()` (directly or via `start_bridge_with_client` / `run_bridge_loop`) when the `BridgeConfig` was constructed with `session_token: None`.
Common situations: Starting Remote Control without setting CLAURST_BRIDGE_TOKEN; a config builder that skips the token field; token was cleared after logout; wiring the wrong config struct (e.g. main app config instead of bridge config).
Related errors
- Poll: no token
- Upload: no token
- Remote Control requires a session token. Set…
- No API key found. Options: - Set ANTHROPIC_API_KEY for…
- Login succeeded but could not obtain a usable credential
AI-assisted analysis of Kuberwastaken/claurst@b0637c97ec (2026-09-10).
Data as JSON: /api/errors/a2e4e9972a9cfd85.
Report an issue: GitHub.
Appendix: source
Thrown at src-rust/crates/bridge/src/lib.rs:448
fn set_state(&self, s: BridgeState) {
*self.state.write() = s;
}
// -----------------------------------------------------------------------
// Session registration / deregistration
// -----------------------------------------------------------------------
/// Register this bridge session with the CCR server.
///
/// POST `/api/claude_code/sessions` — mirrors the TypeScript
/// `registerBridgeEnvironment` call in `bridgeApi.ts`.
pub async fn register(&mut self) -> anyhow::Result<()> {
let token = self
.config
.session_token
.as_deref()
.ok_or_else(|| anyhow::anyhow!("Bridge register: no session token"))?;
let url = format!(
"{}/api/claude_code/sessions",
self.config.server_url
);
let body = serde_json::json!({
"session_id": self.session_id,
"device_id": self.config.device_id,
"client_version": self.config.runner_version,
});
debug!(session_id = %self.session_id, url = %url, "Registering bridge session");
let resp = self
.http
.post(&url)
.bearer_auth(token)
View on GitHub (pinned to b0637c97ec)