Skip to content

fix(anthropic): prevent retired Claude CLI profile from breaking setup - #130225

Merged
obviyus merged 2 commits into
mainfrom
openclaw/claude-cli-troubleshooting
Aug 27, 2026
Merged

obviyus merged 2 commits into
mainfrom
openclaw/claude-cli-troubleshooting

Conversation

@obviyus

@obviyus obviyus commented Aug 26, 2026 •

Copy link
Copy Markdown
Collaborator

Related: #129052

What Problem This Solves

Fixes an issue where users upgrading from the retired anthropic:claude-cli auth profile could complete a successful native Claude CLI inference check but still have setup fail with an inference-owner-changed error.

Why This Change Was Made

Claude CLI execution already discards this retired OpenClaw-managed profile and delegates authentication to Claude's native login. Route-owner projection now applies the same bundled native-profile policy, so setup and execution agree on the active owner while normal non-retired Claude profiles continue to be forwarded. doctor --fix still removes the legacy profile as migration cleanup, but runtime correctness no longer depends on Doctor running first.

User Impact

Upgraded users with a stale anthropic:claude-cli profile can activate and run Claude CLI normally through their existing native Claude login instead of being blocked by owner revalidation.

Evidence

  • Reconstructed on current main base bdc0c924ce0; exact head ba2886c427c.
  • Regression proof: reverting the production change makes the new resolver test fail because it returns anthropic:claude-cli instead of native/profile-free ownership.
  • node scripts/run-vitest.mjs src/agents/cli-execution-auth.test.ts src/agents/cli-runner/prepare.test.ts — 127 passed.
  • node scripts/run-vitest.mjs src/system-agent/setup-inference.test.ts src/system-agent/agent-turn.test.ts — 161 passed.
  • node scripts/run-vitest.mjs src/commands/doctor-auth.deprecated-cli-profiles.test.ts — 7 passed.
  • node scripts/check-changed.mjs -- src/agents/cli-execution-auth.ts src/agents/cli-execution-auth.test.ts src/system-agent/setup-inference.test.ts src/system-agent/agent-turn.test.ts — passed on exact head.
  • Exact-head live isolated run: seeded a retired profile, ran the patched local agent through the real Claude CLI, and received CLAUDE_RETIRED_PROFILE_FIXED from claude-cli/claude-opus-5.

@obviyus
obviyus requested a review from a team as a code owner August 26, 2026 16:28
@clawsweeper

clawsweeper Bot commented Aug 26, 2026

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

Pull request received. I will update this pull request when review starts.

@obviyus obviyus closed this Aug 26, 2026
@obviyus obviyus reopened this Aug 26, 2026
@openclaw-barnacle openclaw-barnacle Bot added agents Agent runtime and tooling size: S maintainer Maintainer-authored PR labels Aug 26, 2026
@clawsweeper clawsweeper Bot added merge-risk: 🚨 auth-provider 🚨 May break OAuth, tokens, provider routing, model choice, or credentials. merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. P1 High-priority user-facing bug, regression, or broken workflow. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. labels Aug 26, 2026
@clawsweeper

clawsweeper Bot commented Aug 26, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed August 26, 2026, 10:30 PM ET / August 27, 2026, 02:30 UTC.

ClawSweeper review

What this changes

This PR makes Claude CLI setup and agent execution ignore the retired anthropic:claude-cli profile so they use Claude’s current native login.

Regression provenance

Possible regression — suspected (reviewed change). No predecessor PR is attributed.

Merge readiness

⚠️ Ready for maintainer review - 2 items remain

Keep open: no blocking correctness finding surfaced, and current main still forwards the retired profile despite its native-login policy. The PR is a focused repair; exact-head CI and normal maintainer merge handling remain pending.

Priority: P1
Reviewed head: 7f751132fa38093a902464afb8cb3c6417cef61e

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A targeted policy-reuse fix with focused regression coverage; merge readiness awaits exact-head CI.
Proof confidence 🌊 off-meta tidepool Not applicable: The PR is maintainer-authored and therefore exempt from the external-contributor proof gate; its body additionally reports an isolated real Claude CLI upgrade-path run.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Not applicable Not applicable: The PR is maintainer-authored and therefore exempt from the external-contributor proof gate; its body additionally reports an isolated real Claude CLI upgrade-path run.
Evidence reviewed 6 items Current-main gap: Current main declares the retired Claude profile as native-owned, but its resolver still forwards both an explicitly selected and first-ordered retired profile.
Canonical policy reuse: The patch consults the existing bundled native-profile policy before selected and ordered profile forwarding, rather than adding a second Claude-specific policy.
Final execution owner: CLI preparation already removes the same native profile and credential before invoking Claude, so this repair aligns route projection with the final execution boundary.
Findings None None.
Security None None.

Live Verification

Command: pnpm openclaw --help

Result: PASS (completed)

$ node scripts/run-node.mjs --help
[openclaw] Building TypeScript (dist is stale: missing_build_stamp - build stamp missing).
[openclaw] Building bundled plugin assets.
[canvas] build: node scripts/bundle-a2ui.mjs
[log] ‹DIR›/a2ui.bundle.js  chunk │ size: 399.96 kB
[log] ‹DIR›/a2ui-v0.9.bundle.js  chunk │ size: 615.66 kB
[log]
[success] rolldown v1.2.0 Finished in 119.67 ms
[diffs] build: node --import tsx ../../scripts/build-diffs-viewer-runtime.mts curated
[diffs-language-pack] build: node --import tsx ../../scripts/build-diffs-viewer-runtime.mts full
[discord] build: node --import tsx ../../scripts/build-discord-activity-sdk.mts
[tsdown-build] invocation 1/2 finished in 0.7s
node_modules/playwright-core/lib/coreBundle.js (65821:28) [EVAL] Use of direct ˋevalˋ function is strongly discouraged as it poses security risks and may cause
issues with minification.
       ╭─[ node_modules/playwright-core/lib/coreBundle.js:65821:29 ]
       │
 65821 │               const value = eval(ˋ(${expr})ˋ);
       │                             ──┬─
       │                               ╰─── Use of direct ˋevalˋ here.
       │
       │ Help: Consider using indirect eval. For more information, check the documentation: https://rolldown.rs/guide/troubleshooting#avoiding-direct-eval
───────╯

node_modules/playwright-core/lib/coreBundle.js (65828:28) [EVAL] Use of direct ˋevalˋ function is strongly discouraged as it poses security risks and may cause
issues with minification.
       ╭─[ node_modules/playwright-core/lib/coreBundle.js:65828:29 ]
       │
 65828 │               const value = eval(ˋ(${expr})ˋ);
       │                             ──┬─
       │                               ╰─── Use of direct ˋevalˋ here.
       │
       │ Help: Consider using indirect eval. For more information, check the documentation: https://rolldown.rs/guide/troubleshooting#avoiding-direct-eval
───────╯

node_modules/web-tree-sitter/web-tree-sitter.js (2343:30) [EVAL] Use of direct ˋevalˋ function is strongly discouraged as it poses security risks and may cause
issues with minification.
      ╭─[ node_modules/web-tree-sitter/web-tree-sitter.js:2343:31 ]
      │
 2343 │           ASM_CONSTS[start] = eval(func);
      │                               ──┬─
      │                                 ╰─── Use of direct ˋevalˋ here.
      │
      │ Help: Consider using indirect eval. For more information, check the documentation: https://rolldown.rs/guide/troubleshooting#avoiding-direct-eval
──────╯

node_modules/web-tree-sitter/web-tree-sitter.js (2366:32) [EVAL] Use of direct ˋevalˋ function is strongly discouraged as it poses security risks and may cause
issues with minification.
      ╭─[ node_modules/web-tree-sitter/web-tree-sitter.js:2366:33 ]
      │
 2366 │           moduleExports[name] = eval(func);
      │                                 ──┬─
      │                                   ╰─── Use of direct ˋevalˋ here.
      │
      │ Help: Consider using indirect eval. For more information, check the documentation: https://rolldown.rs/guide/troubleshooting#avoiding-direct-eval
──────╯

[tsdown-build] invocation 2/2 finished in 14.7s
[plugin-control-plane-loads] verified 36 built modules with native require and checked doctor closures
runtime-postbuild: 11 phases completed in 4338ms (slowest: built plugin control-plane loads 3568ms)

OpenClaw 2026.8.1 (7f75113) — All your chats, one OpenClaw.

Usage: openclaw [options] [command]

Options:
  --container ‹name›   Run the CLI inside a running Podman/Docker container named ‹name› (default: env OPENCLAW_CONTAINER)
  --dev                Dev profile: isolate state under ~/.openclaw-dev, default gateway port 19001, and shift derived ports (browser/canvas)
  -h, --help           Display help for command
  --log-level ‹level›  Global log level override for file + console (silent|fatal|error|warn|info|debug|trace)
  --no-color           Disable ANSI colors
  --profile ‹name›     Use a named profile (iso
… output truncated …

Assertions:

  • PASS expect_output: Usage: openclaw

How this fits together

OpenClaw resolves an auth profile before starting CLI-backed agent runs and setup inference. That selection is passed to the Claude CLI runner, which verifies the active runtime owner before setup persists the route.

flowchart LR
A[Stored auth profile] --> B[CLI profile resolver]
B --> C{Retired native profile?}
C -->|yes| D[Claude CLI native login]
C -->|no| E[Forward compatible profile]
D --> F[Setup verification and agent run]
E --> F
Loading

Before merge

  • Resolve merge risk (P1) - An upgrade with an explicitly selected retired profile will now use whichever account is logged into the native Claude CLI; that intentional owner transition is compatibility-sensitive.
  • Complete next step (P2) - No discrete repair is indicated; wait for exact-head CI and ordinary maintainer merge review.
Agent review details

Security

None.

PR surface

Source +7, Tests +117. Total +124 across 4 files.

View PR surface stats
Area Files Added Removed Net
Source 1 8 1 +7
Tests 3 126 9 +117
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 4 134 10 +124

Review metrics

Metric Value Why it matters
Production versus test delta production +8/-1 (net +7); tests +126/-9 (net +117) The small production increase reuses the existing native-profile policy at the shared resolver, with coverage for resolver, setup, and agent-turn behavior.

Root-cause cluster

Relationship: canonical
Canonical: #130225
Summary: This PR is the focused remaining repair for route-owner projection after the earlier native-login migration.

Members:

Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything.

Merge-risk options

  • The current PR head has incomplete required checks, so merge readiness is not yet established for the exact head.

Maintainer options:

  1. Accept the native-account migration (recommended)
    Confirm that the retired stored profile must no longer select an account and merge once exact-head CI is green.
  2. Pause if legacy selection remains contractual
    Pause this PR if an explicit retired-profile selection must continue to identify a distinct account rather than the native Claude CLI login.

Technical review

Best possible solution:

Land the shared resolver repair once exact-head checks pass and maintainers accept the documented transition from the retired stored profile to the native Claude CLI account.

Do we have a high-confidence way to reproduce the issue?

Yes—seed anthropic:claude-cli as the selected or ordered CLI profile; current main’s resolver returns it even though the native policy marks it retired.

Is this the best way to solve the issue?

Yes—the shared resolver is the correct upstream owner because both setup inference and ordinary CLI execution consume its result, while final preparation already suppresses the same retired profile.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning high; reviewed against c75616186224.

Labels

Label changes:

  • remove proof: sufficient: Current real behavior proof status is not_applicable, not sufficient.

Label justifications:

  • P1: A stale profile can block an upgraded user’s Claude CLI setup and agent workflow.
  • merge-risk: 🚨 compatibility: Existing stored profile selection changes from a retired OpenClaw identity to the native CLI account.
  • merge-risk: 🚨 auth-provider: The patch changes which authentication owner reaches Claude CLI setup and execution.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🌊 off-meta tidepool and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Not applicable: The PR is maintainer-authored and therefore exempt from the external-contributor proof gate; its body additionally reports an isolated real Claude CLI upgrade-path run.

Evidence

What I checked:

Likely related people:

  • Jason (Json): Auth-profile forwarding for Claude CLI appears in the resolver history from the selected-profile forwarding change. (role: introduced resolver forwarding; confidence: high; commits: 1a42e005fba8; files: src/agents/cli-execution-auth.ts)
  • obviyus: The same contributor authored the merged native Claude login work and this focused follow-up. (role: recent native-login implementation contributor; confidence: high; commits: 750a64e7cd4a, 7f751132fa38; files: src/agents/cli-runner/cli-backend-auth-policy.ts, src/agents/cli-execution-auth.ts)
  • Vincent Koc: The resolver’s surrounding agent structure includes the cited agent refactor history. (role: recent agent-area refactor contributor; confidence: medium; commits: e45f2f6ca670; files: src/agents/cli-execution-auth.ts)

Rank-up moves

Optional improvements that raise the rating; they are not merge blockers.

  • Let required checks complete successfully for commit 7f751132fa38093a902464afb8cb3c6417cef61e.

Rating scale

Score Internal tier Crab rank Meaning
6/6 S 🦀 challenger crab Exceptional readiness
5/6 A 🦞 diamond lobster Very strong readiness
4/6 B 🐚 platinum hermit Good normal PR; ordinary maintainer review
3/6 C 🦐 gold shrimp Useful, but confidence is limited
2/6 D 🦪 silver shellfish Proof or implementation needs work
1/6 F 🧂 unranked krab Not merge-ready
N/A NA 🌊 off-meta tidepool Rating does not apply

Overall follows the weaker of proof and patch quality.
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics.

Workflow

  • ClawSweeper keeps one durable marker-backed review comment per issue or PR.
  • Re-runs edit this comment so the latest verdict, findings, and automation markers stay together instead of adding duplicate bot comments.
  • A fresh review can be triggered by eligible @clawsweeper re-review comments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.
  • PR/issue authors and users with repository write access can comment @clawsweeper re-review or @clawsweeper re-run on an open PR or issue to request a fresh review only.
  • Maintainers can also comment @clawsweeper review to request a fresh review only.
  • Fresh-review commands do not start repair, autofix, rebase, CI repair, or automerge.
  • Maintainer-only repair and merge flows require explicit commands such as @clawsweeper autofix, @clawsweeper automerge, @clawsweeper fix ci, or @clawsweeper address review.
  • Maintainers can comment @clawsweeper explain to ask for more context, or @clawsweeper stop to stop active automation.

History

Review history (1 earlier review cycle)
  • reviewed 2026-08-26T17:13:59.582Z sha 411bd8f :: needs maintainer review before merge. :: none

@obviyus
obviyus force-pushed the openclaw/claude-cli-troubleshooting branch from 1816bbf to ba2886c Compare August 27, 2026 02:19
@obviyus

obviyus commented Aug 27, 2026

Copy link
Copy Markdown
Collaborator Author

@clawsweeper re-review

Fresh-main rank-up move addressed on exact head ba2886c427c:

  • Reconstructed onto current main base bdc0c924ce0.
  • Focused regression suites: 295/295 passed.
  • Full changed-file gate passed.
  • Repeated the isolated real Claude CLI upgrade-path proof with the retired profile present; result: CLAUDE_RETIRED_PROFILE_FIXED.

No Rank-up move was skipped.

@clawsweeper

clawsweeper Bot commented Aug 27, 2026 •

Copy link
Copy Markdown
Contributor

🦞🧹
ClawSweeper re-review requested.

I asked ClawSweeper to review this item again.
Action: item re-review queued (workflow sweep.yml, event exact_review_queue).
Result: when the review finishes, ClawSweeper will create the durable review comment if needed or update the existing comment in place.

@obviyus
obviyus force-pushed the openclaw/claude-cli-troubleshooting branch from ba2886c to 7f75113 Compare August 27, 2026 02:23
@clawsweeper clawsweeper Bot removed the proof: sufficient ClawSweeper judged the real behavior proof convincing. label Aug 27, 2026
@obviyus
obviyus merged commit adbb09d into main Aug 27, 2026
198 checks passed
@obviyus

obviyus commented Aug 27, 2026

Copy link
Copy Markdown
Collaborator Author

Merged via squash.

@obviyus
obviyus deleted the openclaw/claude-cli-troubleshooting branch August 27, 2026 02:47
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Aug 27, 2026
openclaw#130225)

* fix(anthropic): ignore retired Claude CLI auth profile

* test(system-agent): expect native Claude CLI ownership
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agents Agent runtime and tooling maintainer Maintainer-authored PR merge-risk: 🚨 auth-provider 🚨 May break OAuth, tokens, provider routing, model choice, or credentials. merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. P1 High-priority user-facing bug, regression, or broken workflow. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. size: S status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant