Skip to content

refactor(auth): relocate auth store from per-agent to global path#450

Merged
alexey-pelykh merged 1 commit intomainfrom
refactor/auth-global-store
Mar 8, 2026
Merged

refactor(auth): relocate auth store from per-agent to global path#450
alexey-pelykh merged 1 commit intomainfrom
refactor/auth-global-store

Conversation

@alexey-pelykh
Copy link
Copy Markdown

Summary

  • Relocates auth profile store from per-agent (~/.remoteclaw/agents/{agentId}/agent/auth-profiles.json) to global (~/.remoteclaw/auth-profiles.json)
  • Removes agentDir parameter threading from all auth function signatures and call sites (34 files, -714 lines)
  • Removes auth store inheritance/merge logic, sibling agent sync, and legacy auth.json migration (OpenClaw dead code)
  • Per-agent credential selection now handled by config auth field instead of per-agent store files

Closes #438

Test plan

  • Type-check passes (npx tsc --noEmit — zero errors in src/)
  • Lint passes (pnpm lint — zero errors)
  • Full test suite passes (971 + 141 + 93 test files, 10,279 tests)
  • Updated tests for global store path (store.ensureauthprofilestore.test.ts, onboard-auth.test.ts, provider-usage.test.ts, doctor-auth.deprecated-cli-profiles.test.ts, provider-usage.auth.normalizes-keys.test.ts)

🤖 Generated with Claude Code

Per-agent auth profile stores added unnecessary complexity — auth
inheritance, merge logic, sibling sync, and agentDir threading through
the entire call chain. This moves the auth store to a single global
location at `${REMOTECLAW_STATE_DIR}/auth-profiles.json`.

- Remove agentDir parameter from all auth function signatures
- Remove auth store inheritance/merge between main and sub-agents
- Remove sibling agent sync (syncSiblingAgents, resolveSiblingAgentDirs)
- Remove legacy auth.json migration (OpenClaw dead code)
- Simplify ensureAuthProfileStore to a single global file read
- Update all call sites and tests for the new global store path

Per-agent credential selection is now handled by the config `auth` field
rather than per-agent store files.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@alexey-pelykh alexey-pelykh enabled auto-merge (squash) March 8, 2026 11:05
@alexey-pelykh alexey-pelykh merged commit dbdff5b into main Mar 8, 2026
5 checks passed
@alexey-pelykh alexey-pelykh deleted the refactor/auth-global-store branch March 8, 2026 11:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

refactor(auth): relocate auth store from per-agent to global path

1 participant