Repository navigation
Conversation
Add Claude Code CLI credential sync to external-cli-sync, matching the existing Qwen CLI pattern. When ~/.claude/.credentials.json contains full OAuth credentials (access + refresh token), they are imported as type: oauth profiles enabling automatic token refresh. Changes: - external-cli-sync.ts: add Claude CLI sync (OAuth + setup-token fallback) - doctor-auth.ts: un-deprecate anthropic:claude-cli profile - external-cli-sync.test.ts: integration tests - isExternalProfileFresh: accept optional provider param Supersedes openclaw#4615. Complements openclaw#4593.
66ff22a to
81abade
Compare
|
CLAWDINATOR FIELD REPORT // PR Closure I am CLAWDINATOR — cybernetic crustacean, maintainer triage bot for OpenClaw. I was sent from the future to keep this repo shipping clean code. TARGET ACQUIRED. I have reviewed your PR. Your effort is br00tal. Reality check: OpenClaw is in feature freeze while we stabilize the system. That means any new feature PRs are getting cleared out, no matter how shiny. This one falls into that bucket, so I’m closing it to keep the queue from exploding. Think this belongs in the release after freeze? Come with me if you want to ship. Report to #pr-thunderdome-dangerzone on Discord — READ THE TOPIC or risk immediate termination. Bring the maintainers a clear briefing (impact, testing, why it survives the freeze). I’ll be back. Stay br00tal. 🤖 This is an automated message from CLAWDINATOR, the OpenClaw maintainer bot. |
|
Closing this PR because it has more than 20 labels, which usually means the branch is too noisy. Please recreate the PR from a clean branch. |
Summary
When Anthropic OAuth tokens expire, users must re-run
openclaw onboardwhich creates asetup-token— a limited token that only hasuser:inferencescope. This breaks usage tracking (/status) which requiresuser:profilescope, and the token itself cannot be auto-refreshed.Meanwhile, Claude Code CLI (
~/.claude/.credentials.json) stores full OAuth credentials with both access and refresh tokens, plus all scopes includinguser:profile. OpenClaw already syncs credentials from Qwen CLI viaexternal-cli-sync.ts, but not from Claude Code CLI.Changes
1. Claude CLI credential sync (
external-cli-sync.ts)Extends
syncExternalCliCredentials()to import credentials from Claude Code CLI, following the existing Qwen CLI pattern:type: "oauth", enabling auto-refresh via the existingrefreshOAuthTokenWithLock()infrastructuretype: "token"when no refresh token is available2. Un-deprecate Claude CLI profile (
doctor-auth.ts)The
anthropic:claude-cliprofile was previously deprecated in favor ofsetup-token. Since Claude CLI sync now provides superior credentials (full OAuth with refresh + all scopes), the deprecation warning is removed. The doctor hint now recommendsclaude loginto refresh credentials.3. Generalize
isExternalProfileFresh()Accepts an optional
providerparameter so it can check freshness for any CLI provider, not justqwen-portal.4. Integration tests (
external-cli-sync.test.ts)Five tests using temporary credential files:
Why this matters
openclaw onboardsetup-token=user:inferenceonlyuser:profile~/.claude/.credentials.jsonContext
Supersedes #4615 (which only warned about the scope issue) by addressing the root cause.
Complements #4593 (don't warn about expired OAuth tokens with valid refresh tokens).
Related Claude Code issues: