Problem
When the gateway's failover system exhausts all auth profiles and model fallbacks, the resulting error log entries are missing provider and session_id metadata. This makes it difficult to attribute errors during post-mortem analysis.
Evidence
Analyzing the last 100 errors from our api_health_log table (structured ingestion from gateway.err.log):
- 18 of 100 errors (18%) had no
provider or session_id populated
- These are all failover/wrapper errors — the final
FailoverError after all profiles/models have been tried
- The underlying per-profile errors DO have provider attribution, but the wrapper error that gets logged does not carry it through
Expected behavior
Failover wrapper errors should include:
- The provider(s) attempted (even if multiple)
- The session_id / lane that originated the request
- Consistent
session_id format (currently we see both session:browser-XXXX and browser-XXXX for the same session)
Impact
When triaging rate limit storms or auth failures, the missing attribution means you have to manually correlate wrapper errors with nearby per-profile errors by timestamp. At scale (we had 6,000+ rate limit errors in 12 days), this makes automated analysis unreliable.
Environment
- OpenClaw version: 2026.3.7
- Providers: anthropic (token), openai-codex (OAuth)
- Config: 3 anthropic profiles, 1 openai-codex profile, 2 model fallbacks
Suggestion
In the FailoverError constructor or the error logging path, propagate the provider from the last-attempted profile and the sessionId / lane from the originating request. For the session_id normalization, ensure the session: prefix is consistently applied.
Problem
When the gateway's failover system exhausts all auth profiles and model fallbacks, the resulting error log entries are missing
providerandsession_idmetadata. This makes it difficult to attribute errors during post-mortem analysis.Evidence
Analyzing the last 100 errors from our
api_health_logtable (structured ingestion fromgateway.err.log):providerorsession_idpopulatedFailoverErrorafter all profiles/models have been triedExpected behavior
Failover wrapper errors should include:
session_idformat (currently we see bothsession:browser-XXXXandbrowser-XXXXfor the same session)Impact
When triaging rate limit storms or auth failures, the missing attribution means you have to manually correlate wrapper errors with nearby per-profile errors by timestamp. At scale (we had 6,000+ rate limit errors in 12 days), this makes automated analysis unreliable.
Environment
Suggestion
In the
FailoverErrorconstructor or the error logging path, propagate theproviderfrom the last-attempted profile and thesessionId/lanefrom the originating request. For the session_id normalization, ensure thesession:prefix is consistently applied.