Skip to content

[Bug]: /model anthropic/* reports "Sign-in needed" / "A runtime is not available" with a valid Claude CLI login (claude-cli binding resolved without config) #196694

Description

@blademaster12

Version: OpenClaw 2026.11.2, Node 26.12.1, Linux x64.

Symptoms

  • /model provider list: anthropic: Sign-in needed. If Claude Code is signed out, run claude auth login…, Models (anthropic) — 0 of 4 available.
  • /model anthropic/claude-opus-5-5 → ❌ A runtime is not available for anthropic/claude-opus-5-5. Same with --runtime claude-cli.
  • But claude auth status is valid and real agent turns routed to anthropic/* via claude-cli succeed (resolvedProvider: anthropic, modelApplied: true).

Root cause
In dist/model-auth-availability-*.mjs (evaluateRuntimeModelAuth), the CLI backend binding is resolved without config:

const binding = resolveCliRuntimeModelBackendBinding({ provider, runtime: runtimeProvider });

resolveCliRuntimeModelBackendBinding only consults the plugin setup registry when params.config is defined (params.config === void 0 ? void 0 : resolvePluginSetupCliBackend(...)), so binding is undefined. Then:

if (ref.runtimeId && runtimeProvider !== normalizeProviderId(provider) && !binding)
  return { availability: false, unavailableReason: "missing-auth" };

runtimeProvider = claude-cli, normalizeProviderId(provider) = anthropic → missing-auth before the auth policy is even evaluated. model-runtime-choice then aborts with "runtime not available".

Secondary: when the profile selector returns nothing and the CLI backend policy declares nativeAuthProfileIds (["anthropic:claude-cli"]), the native credential is never accepted, because selectCliExecutionAuthProfile explicitly excludes native profile ids from its loop.

Fix (verified locally)

 const binding = resolveCliRuntimeModelBackendBinding({
   provider,
-  runtime: runtimeProvider
+  runtime: runtimeProvider,
+  config: params.cfg,
+  env: params.env,
+  metadataSnapshot: params.metadataSnapshot
 });

plus, after the profile-selection miss, accept the native credential when authPolicy.nativeAuthProfileIds?.length (evidence native, mode oauth).

Result after patch + gateway restart

  • evaluateRuntimeModelAuth("anthropic", …): missing-auth → availability: true, evidence: "native".
  • prepareModelChoice("anthropic/claude-sonnet-5-5") with override/manual-override, with and without runtimeId: "claude-cli": unavailable → resolved (4/4).
  • /model anthropic 1 → 4 available; /model anthropic/claude-opus-5-5 succeeds; real turn runs on claude-cli/claude-opus-5-5.

Happy to provide more detail.

Activity

  1. added
    clawsweeper:intake:bug
    P2
    clawsweeper:fix-shape-clear
    clawsweeper:queueable-fix
    clawsweeper:source-repro
    impact:auth-provider
    impact:ux-friction
    issue-rating: 🦞 diamond lobster
    no-stale
    and removed
    clawsweeper:intake:bug
    on Nov 10, 2026
  2. clawsweeper commented on Nov 10, 2026

    @clawsweeper
    Contributor

    Codex review: this still needs some work.

    Summary
    Keep open: current main still resolves the CLI binding without configuration and can reject a valid Claude CLI route before checking prepared native authentication.

    Reproducibility: Source establishes a deterministic failure with a metadata-declared Claude backend, no ambient backend registration, and prepared native login: the missing binding triggers rejection before readiness is consulted; no live reproduction or tests were run.

    Next step
    Fix the omitted binding context after establishing a failing metadata-only Claude selection regression, preserving signed-out rejection and explicit account constraints.

    Review details

    Best possible solution:

    Resolve CLI bindings from the prepared configuration and metadata, then retain the existing native-login and explicit-account readiness checks.

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

    Source establishes a deterministic failure with a metadata-declared Claude backend, no ambient backend registration, and prepared native login: the missing binding triggers rejection before readiness is consulted; no live reproduction or tests were run.

    Is this the best way to solve the issue?

    Passing the prepared binding context addresses the demonstrated defect; the suggested unconditional native fallback is unnecessary because a profile-selection miss already reaches prepared native readiness.

    AGENTS.md: found and applied where relevant.

    Remaining risk / open question:

    • The reported slash-command flow was not executed; current source establishes the metadata-only binding failure, while its occurrence in the reporter's Gateway remains user-reported.
    • The proposed secondary fallback would accept a native profile declaration without login evidence and should not be adopted without a separate demonstrated defect.

    Codex review notes: model internal, reasoning medium; reviewed against c321c038b59c.

    Label changes

    Label changes:

    • add P2: The report establishes a bounded model-selection failure while inference through the configured CLI still works.
    • add impact:auth-provider: Runtime binding resolution can incorrectly classify usable native authentication as missing.
    • add impact:ux-friction: The model command directs an already authenticated operator toward unnecessary sign-in.
    • add issue-rating: 🦞 diamond lobster: Current issue advisory state selects this label.
    • add clawsweeper:source-repro: Current issue advisory state selects this label.
    • add clawsweeper:queueable-fix: Current issue advisory state selects this label.
    • add clawsweeper:fix-shape-clear: Current issue advisory state selects this label.

    Label justifications:

    • P2: The report establishes a bounded model-selection failure while inference through the configured CLI still works.
    • impact:auth-provider: Runtime binding resolution can incorrectly classify usable native authentication as missing.
    • impact:ux-friction: The model command directs an already authenticated operator toward unnecessary sign-in.
    Evidence reviewed

    Acceptance criteria:

    • Establish a red-on-base, green-on-fix regression for metadata-only CLI binding resolution with prepared native login.
    • pnpm test src/agents/model-auth-availability.runtime-policy.test.ts src/agents/model-runtime-choice.native.test.ts src/agents/cli-backends.test.ts
    • pnpm tsgo:core
    • pnpm check:changed
    • git diff --check

    What I checked:

    How this review workflow works
    • 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; those execution lanes are retired.
    • Maintainers can comment @clawsweeper explain to ask for more context, or @clawsweeper stop to stop active automation.

    Reviewed November 10, 2026, 9:08 AM ET / 14:08 UTC.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2clawsweeper:fix-shape-clearclawsweeper:queueable-fixclawsweeper:source-reproimpact:auth-providerimpact:ux-frictionissue-rating: 🦞 diamond lobsterno-stale

    Type

    No type

    Fields

    Priority

    None yet

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions