openclaw - 💡(How to fix) Fix Per-agent auth profiles cause credential drift and stale duplicate OAuth profiles across agents [1 participants]

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…
GitHub stats
openclaw/openclaw#59272Fetched 2026-04-08 02:26:38
View on GitHub
Comments
0
Participants
1
Timeline
0
Reactions
0
Author
Participants

Error Message

  • each agent stores auth in its own ~/.openclaw/agents/<agentId>/agent/auth-profiles.json
  • running openclaw models auth login --provider openai-codex on main created a new profile ID
  • the old openai-codex:default profile was not automatically removed or migrated
  • sibling agents kept only the old stale profile
  • result: different agents silently diverged in credential state

Fix Action

Workaround

We had to create a local sync/cleanup skill that:

  • treats main as the source of truth
  • propagates canonical provider profiles to sibling agents
  • deletes obsolete duplicate profiles
  • normalizes order and lastGood
RAW_BUFFERClick to expand / collapse

In multi-agent setups, each agent stores its own auth-profiles.json. This becomes fragile when OAuth profile naming changes across versions — for example, older openai-codex:default versus newer account-scoped IDs such as openai-codex:<email>.

Re-authenticating one agent updates only that agent. Other agents keep stale local copies, which leads to configuration drift, duplicate profiles, and confusing failures depending on which agent is active.

Observed behavior

  • each agent stores auth in its own ~/.openclaw/agents/<agentId>/agent/auth-profiles.json
  • running openclaw models auth login --provider openai-codex on main created a new profile ID
  • the old openai-codex:default profile was not automatically removed or migrated
  • sibling agents kept only the old stale profile
  • result: different agents silently diverged in credential state

Why this is problematic

  • credentials have to be maintained repeatedly across agents
  • stale OAuth profiles remain after successful re-authentication
  • profile naming migrations are not normalized automatically
  • there is no first-class built-in “main as source of truth” workflow
  • failures can appear inconsistent depending on which agent handles a request

Expected behavior / possible improvements

Ideally, OpenClaw should provide one or more of the following:

  1. a first-class shared/global auth profile store with explicit opt-in for agents
  2. a built-in sync command to propagate selected provider profiles from one agent to others
  3. automatic migration and cleanup when a provider changes profile naming conventions
  4. a clearer distinction between the canonical active profile and obsolete retained profiles
  5. an optional “inherit main agent credentials” mode for standard multi-agent setups, not only limited fallback cases

Reproduction

  1. Set up multiple agents such as main, coding-monkey, dr-house, and others
  2. Authenticate openai-codex while older :default profile naming is in use
  3. Re-authenticate later on one agent with a newer OpenClaw version
  4. Observe that a new profile like openai-codex:<email> is created only for that one agent
  5. Observe that old openai-codex:default entries remain present locally and on sibling agents
  6. Observe credential drift and inconsistent auth behavior across agents

Workaround

We had to create a local sync/cleanup skill that:

  • treats main as the source of truth
  • propagates canonical provider profiles to sibling agents
  • deletes obsolete duplicate profiles
  • normalizes order and lastGood

extent analysis

TL;DR

Implement a shared authentication profile store or a sync command to propagate provider profiles across agents to prevent credential drift and inconsistent authentication behavior.

Guidance

  • Consider creating a centralized auth profile store that all agents can access, reducing the need for individual agent storage and minimizing drift.
  • Develop a built-in sync command that allows propagating selected provider profiles from one agent (e.g., the main agent) to other agents, ensuring consistency across the system.
  • Implement automatic migration and cleanup mechanisms for handling changes in provider profile naming conventions, such as when moving from openai-codex:default to openai-codex:<email>.
  • Introduce an option for agents to inherit credentials from a main agent, serving as a source of truth for authentication profiles in multi-agent setups.

Example

A potential approach could involve creating a script or tool that periodically synchronizes auth profiles across agents, using the main agent as the source of truth. This script could compare profiles, update or add new ones as necessary, and remove obsolete profiles to maintain consistency.

Notes

The ideal solution would depend on the specific requirements and constraints of the OpenClaw system and its users. Implementing a shared auth profile store or a sync command would require careful consideration of security, scalability, and usability factors.

Recommendation

Apply a workaround by implementing a local sync/cleanup skill similar to the one described, which treats the main agent as the source of truth and propagates canonical provider profiles to sibling agents, deleting obsolete duplicates and normalizing settings. This approach can help mitigate the issue until a more integrated solution is available.

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…

Still need to ship something?

×6

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

Back to top recommendations

TRENDING