openclaw - 💡(How to fix) Fix Gateway should refresh auth epoch immediately after credential rotation

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…

When credentials rotate on a host running OpenClaw Gateway, the gateway can keep stale in-memory auth state until its next heartbeat/auth-epoch refresh. If a user message arrives in that window, the request can fail with a generic "Something went wrong while processing... use /new" instead of refreshing credentials before handling the message.

Error Message

  • Request failed with generic processing error.

Root Cause

When credentials rotate on a host running OpenClaw Gateway, the gateway can keep stale in-memory auth state until its next heartbeat/auth-epoch refresh. If a user message arrives in that window, the request can fail with a generic "Something went wrong while processing... use /new" instead of refreshing credentials before handling the message.

Fix Action

Fix / Workaround

  1. Watch relevant credential files, e.g. fs.watch/mtime check on ~/.claude/.credentials.json, and bump auth epoch immediately when credentials change.
  2. On every inbound user message, perform a cheap freshness check: compare current credential file mtime/hash with the in-memory credential epoch/hash. If mismatched, reset/reload before dispatching the request.
  3. Improve fallback UX: replace generic "Something went wrong, use /new" with a credential-rotation-specific retry/reconnect message where detectable.
RAW_BUFFERClick to expand / collapse

Summary

When credentials rotate on a host running OpenClaw Gateway, the gateway can keep stale in-memory auth state until its next heartbeat/auth-epoch refresh. If a user message arrives in that window, the request can fail with a generic "Something went wrong while processing... use /new" instead of refreshing credentials before handling the message.

Observed case

Host: Mac Mini running OpenClaw Gateway.

Timeline observed 2026-05-02 EDT:

  • User re-logged into Claude Max via SSH, rewriting ~/.claude/.credentials.json around 12:31:15.
  • User message arrived around 12:34, inside the stale-cache window.
  • Request failed with generic processing error.
  • Gateway self-corrected at 12:39:59 via auth-epoch/session reset on heartbeat.

The delay was about 3 minutes from credential rewrite to failed message, and about 9 minutes until self-correction.

Expected behavior

Credential rotation should not surface as a generic user-visible failure. Gateway should detect credential file freshness before processing inbound user messages, refresh/reset auth state if needed, and continue or return a specific "credentials rotated, reconnecting" style message.

Suggested fixes

  1. Watch relevant credential files, e.g. fs.watch/mtime check on ~/.claude/.credentials.json, and bump auth epoch immediately when credentials change.
  2. On every inbound user message, perform a cheap freshness check: compare current credential file mtime/hash with the in-memory credential epoch/hash. If mismatched, reset/reload before dispatching the request.
  3. Improve fallback UX: replace generic "Something went wrong, use /new" with a credential-rotation-specific retry/reconnect message where detectable.

Notes

  • Two-machines-same-account/session-conflict was ruled out in the original investigation: no observed claim/session-conflict/409 pattern.
  • This card was tracked locally as Saga PT #44103523628429312 and is being filed upstream for visibility.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

FAQ

Expected behavior

Credential rotation should not surface as a generic user-visible failure. Gateway should detect credential file freshness before processing inbound user messages, refresh/reset auth state if needed, and continue or return a specific "credentials rotated, reconnecting" style message.

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING

openclaw - 💡(How to fix) Fix Gateway should refresh auth epoch immediately after credential rotation