-
-
Notifications
You must be signed in to change notification settings - Fork 69.6k
macOS app: gateway auth token churn can cause token_mismatch + pairing_required reconnect spam #41407
Copy link
Copy link
Closed
Description
Summary
On macOS, when gateway auth token changes (or is regenerated) during config rewrites/restarts, OpenClaw.app can enter a reconnect loop with alternating errors:
unauthorized: gateway token mismatchpairing required- intermittent
Could not connect to the serverduring restart windows
This creates sustained log spam and makes the node appear broken even after approvals.
Environment
- Gateway CLI:
openclaw 2026.3.9 - macOS app observed:
2026.3.8-beta.1 - Local gateway:
ws://127.0.0.1:18789
Observed log signals
- Gateway out:
auth token was missing. Generated a new token and saved it to config (gateway.auth.token).- frequent SIGTERM/restart cycles
- Gateway/App:
unauthorized ... reason=token_mismatchclosed before connect ... code=1008 reason=pairing requiredCould not connect to the serverduring restart windows
Repro (approx)
- macOS app connected locally to gateway (
127.0.0.1:18789). - Trigger config writes touching auth/restart path.
- Gateway rotates/regenerates auth token and restarts.
- App/node attempts reconnect with stale auth/device role state.
- Loop: token mismatch + pairing required + connect failures.
Expected
- Token/auth state should remain stable across benign config writes/restarts, or
- clients should re-handshake cleanly once token changes, without prolonged spam loops.
Actual
- repeated auth/pairing/connect failures until manual repair/reset/pairing/token rotation.
Temporary mitigation that helped
- re-approve pending node pairing request
- rotate node token
- stabilize gateway (avoid further auth-token churn/restarts)
Suggested fixes
- Prevent silent auth token regeneration unless explicitly requested.
- If token changes, surface a single clear state transition to clients and suppress reconnect spam.
- Make node-role upgrade flow (
operator -> node) resilient to concurrent restart/auth transitions. - Consider backoff/jitter + deduplicated error emission in app logs for this class.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels
Type
Fields
Give feedbackNo fields configured for issues without a type.