[BUG] Remote Control presence pulses get intermittent 401 on healthy connected bridges (no retry) — session shows offline/missing in mobile session list
Summary
While a Remote Control bridge is connected and fully functional (SSE transport connected, message sends succeed, CCR heartbeats every ~20 s), the periodic presence pulses to POST /v1/code/sessions/<id>/client/presence intermittently fail with 401 Authentication failed — in my logs 13 of 20 pulses (~65 %) over a ~70-minute window, across three different bridge sessions created the same morning.
Unlike createCodeSession (which retries 3×), presence pulses appear to have no retry — a failed pulse is simply dropped until the next interval.
User-visible impact: the session intermittently shows as offline / disappears from the session list in the mobile app, even though the bridge is healthy and the session works fine when opened via its direct claude.ai/code/session_… URL. This is easy to misdiagnose as "remote control is broken" when the bridge is actually alive.
Key data points
- Fresh credentials are also rejected — this is not credential expiry. A newly created bridge fetched credentials (
expires_in=28800) at03:48:07Zand its first presence pulse at03:48:25Z(17 s later) got 401:
2026-07-17T03:48:03.389Z [remote-bridge] Created session cse_0185KYpknxgyFL7K2gfzL4JY
2026-07-17T03:48:04.769Z [code-session] /bridge failed 401: Authentication failed
2026-07-17T03:48:04.769Z [remote-bridge] fetchRemoteCredentials failed (attempt 1/3), retrying in 591ms
2026-07-17T03:48:07.812Z [remote-bridge] Fetched bridge credentials (expires_in=28800s)
2026-07-17T03:48:08.584Z [remote-bridge] v2 transport connected
2026-07-17T03:48:08.586Z [bridge:sdk] State change: connected
2026-07-17T03:48:25.155Z [presence] pulse → https://api.anthropic.com/v1/code/sessions/cse_0185KYpknxgyFL7K2gfzL4JY/client/presence
2026-07-17T03:48:26.621Z [presence] pulse got 401 ← 17 s after fresh creds
- It is intermittent, not total — some pulses succeed (no error logged), most fail. Sample across two bridges:
2026-07-17T02:44:00.073Z [presence] pulse → …/cse_01CmRoLwXDA2WrTpnVg9xzwV/client/presence
2026-07-17T02:44:01.545Z [presence] pulse got 401
2026-07-17T02:53:23.958Z [presence] pulse → …/cse_01NjH8vtfJtdrQreJetSr3Au/client/presence (no 401 → ok)
2026-07-17T02:57:24.872Z [presence] pulse → …/cse_01CmRoLwXDA2WrTpnVg9xzwV/client/presence
2026-07-17T02:57:26.176Z [presence] pulse got 401
2026-07-17T03:11:56.302Z [presence] pulse → …/cse_01CmRoLwXDA2WrTpnVg9xzwV/client/presence
2026-07-17T03:11:57.856Z [presence] pulse got 401
2026-07-17T03:25:02.996Z [presence] pulse → …/cse_01CmRoLwXDA2WrTpnVg9xzwV/client/presence (no 401 → ok)
2026-07-17T03:35:51.093Z [presence] pulse → …/cse_01CmRoLwXDA2WrTpnVg9xzwV/client/presence
2026-07-17T03:35:54.412Z [presence] pulse got 401
2026-07-17T03:52:56.999Z [presence] pulse → …/cse_0185KYpknxgyFL7K2gfzL4JY/client/presence
2026-07-17T03:52:58.436Z [presence] pulse got 401
Totals for 2026-07-17 02:44–03:54 UTC: 20 pulses, 13 × pulse got 401.
- Message flow on the same bridges is unaffected —
[remote-bridge] Sending 1 message(s)succeeds, SSE events arrive, heartbeats continue. Only the presence surface degrades.
Relationship to the current intermittent-401 reports
This looks like the same backend intermittent-401 condition reported in #78307 (bridge POST after creation), #78309 (startup 401s from code-session endpoints) and #78323 (createCodeSession 401 on attempts 1–2) — my logs from the same window show createCodeSession failing 3/3 at one attempt (03:30:32Z) and succeeding on retry at others (03:24:18Z, 03:48:03Z).
Filing separately because the presence surface is steady-state and unretried: the startup paths at least retry 3×, while a presence pulse fails permanently for that interval. Even after the backend flakiness is fixed, presence pulses would benefit from the same retry/backoff treatment, and/or the mobile session list tolerating N missed pulses before marking a session offline.
Environment
- Claude desktop app 1.22209.0, bundled Claude Code 2.1.209 (darwin arm64, macOS 26.5.1)
- Max subscription (OAuth), bridges hosted by the desktop app
- Same behaviour observed on bridges created at 02:42Z (×2) and 03:48Z on 2026-07-17
Expected behaviour
- Presence pulses retry with backoff like
createCodeSessiondoes, and/or - A connected session is not shown offline in the mobile list after a single failed pulse while heartbeats/SSE are alive.