openclaw-matrix-multiaccounts/src/agents/auth-profiles
Dave Lauer 4b6347459b fix: fallback to main agent OAuth credentials when secondary agent refresh fails
When a secondary agent's OAuth token expires and refresh fails, the agent
would error out even if the main agent had fresh, valid credentials for
the same profile.

This fix adds a fallback mechanism that:
1. Detects when OAuth refresh fails for a secondary agent (agentDir is set)
2. Checks if the main agent has fresh credentials for the same profileId
3. If so, copies those credentials to the secondary agent and uses them
4. Logs the inheritance for debugging

This prevents the situation where users have to manually copy auth-profiles.json
between agent directories when tokens expire at different times.

Fixes: Secondary agents failing with 'OAuth token refresh failed' while main
agent continues to work fine.
2026-01-26 20:03:25 -05:00
..
constants.ts fix: stabilize logging imports and tests 2026-01-18 19:34:08 +00:00
display.ts chore: migrate to oxlint and oxfmt 2026-01-14 15:02:19 +00:00
doctor.ts refactor: normalize cli command hints 2026-01-20 07:43:00 +00:00
external-cli-sync.ts refactor(auth)!: remove external CLI OAuth reuse 2026-01-26 19:05:00 +00:00
oauth.fallback-to-main-agent.test.ts fix: fallback to main agent OAuth credentials when secondary agent refresh fails 2026-01-26 20:03:25 -05:00
oauth.ts fix: fallback to main agent OAuth credentials when secondary agent refresh fails 2026-01-26 20:03:25 -05:00
order.ts chore: migrate to oxlint and oxfmt 2026-01-14 15:02:19 +00:00
paths.ts chore: migrate to oxlint and oxfmt 2026-01-14 15:02:19 +00:00
profiles.ts chore: migrate to oxlint and oxfmt 2026-01-14 15:02:19 +00:00
repair.ts chore: migrate to oxlint and oxfmt 2026-01-14 15:02:19 +00:00
session-override.test.ts fix: normalize model override auth handling 2026-01-21 06:00:21 +00:00
session-override.ts fix: normalize model override auth handling 2026-01-21 06:00:21 +00:00
store.ts refactor(auth)!: remove external CLI OAuth reuse 2026-01-26 19:05:00 +00:00
types.ts Revert "fix: improve GitHub Copilot integration" 2026-01-23 07:14:00 +00:00
usage.ts chore: migrate to oxlint and oxfmt 2026-01-14 15:02:19 +00:00