Skip to content

fix(models): verify native CLI auth in detailed lists - #130749

Merged
obviyus merged 8 commits into
openclaw:mainfrom
Marvinthebored:fix/standalone-claude-cli-availability
Aug 30, 2026
Merged

obviyus merged 8 commits into
openclaw:mainfrom
Marvinthebored:fix/standalone-claude-cli-availability

Conversation

@Marvinthebored

@Marvinthebored Marvinthebored commented Aug 27, 2026 •

Copy link
Copy Markdown
Contributor

Related: #130673

AI-assisted with OpenAI Codex. I understand the change and reviewed the final diff. Session log.

What Problem This Solves

A configured Anthropic model can run through the native Claude CLI without an Anthropic API key. Detailed standalone model listings did not read the provider-owned native login result, so a working Claude login appeared as Auth - / available: null.

The default list must stay lazy. Only models list --all and provider-filtered views may run the native authentication probe.

Root cause

The standalone detailed-list path discarded prepared native-runtime authentication modes before it built the shared availability index.

The first repair also exposed a second owner bug: ambient Anthropic API credentials could populate the aliased claude-cli credential slot before provider-owned synthetic authentication ran. The shared evaluator could then accept the provider result without an authoritative Claude CLI result.

Fix

  • Detailed lists collect only configured CLI runtime IDs and prepare their provider-owned, read-only native authentication facts.
  • Prepared credential discovery treats CLI backend synthetic authentication as authoritative and removes aliased provider credentials from those runtime IDs.
  • The shared standalone and Gateway evaluator reads the exact prepared runtime fact and respects disabled runtime plugins.
  • The default list remains outside native authentication preparation and does not spawn Claude.

This changes status reporting only. It does not change model routing or execution.

Evidence

The proof used the real installed Claude CLI, isolated OpenClaw state, and an exact-head build.

current-main red: c0587fd0db789140d2cd3fa5b8d2a6be77d2c477
main native login: true
main provider-filtered row: available=null

head: 20534b20eed2bd197bcf2ce75daab0a3480fee01
head native login: true
head provider-filtered row: available=true
head --all row: available=true
head default row: available=null

isolated Claude config native login: false
ANTHROPIC_API_KEY present
head provider-filtered row: available=null
head --all row: available=null

native probe calls: provider=1, all=1, default=0, logged-out-provider=1, logged-out-all=1
elapsed seconds: provider=8.91, all=3.36, default=1.39, logged-out-provider=10.39, logged-out-all=3.36

Later main commits through 27c9bbe5ec5098d96f091b2edbac81441df0b07a did not touch the repaired owner files before the final push.

Validation

  • Exact-head pnpm check:changed passed against the pinned merge base.
  • Exact-head pnpm build passed.
  • Focused command, Gateway, auth resolver, prepared runtime, worker, and credential-discovery suites passed.
  • The new API-key-plus-logged-out regressions failed before the owner repair and passed after it.
  • Formatting, documentation indexing, type-aware lint, dead-export checks, import-cycle checks, and repository guards passed.

Change shape

The diff removes the Gateway-local CLI-runtime fallback and uses one shared availability projection. It also removes a duplicate auth-index test and a broad partial module mock.

Production is net +181 lines. Tests are net +332 lines. The production growth adds the approved explicit-view capability and the owner boundary that prevents ambient provider credentials from becoming native CLI authentication facts.

@clawsweeper

clawsweeper Bot commented Aug 27, 2026

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

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

@openclaw-barnacle openclaw-barnacle Bot added gateway Gateway runtime commands Command implementations agents Agent runtime and tooling size: L labels Aug 27, 2026
@Marvinthebored
Marvinthebored marked this pull request as ready for review August 27, 2026 06:14
@Marvinthebored
Marvinthebored requested a review from a team as a code owner August 27, 2026 06:14
@clawsweeper clawsweeper Bot added merge-risk: 🚨 availability 🚨 May cause crashes, hangs, restart loops, stalls, or process outages. P2 Normal backlog priority with limited blast radius. 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 27, 2026
@clawsweeper

clawsweeper Bot commented Aug 27, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed August 29, 2026, 7:25 AM ET / 11:25 UTC.

ClawSweeper review

What this changes

The PR lets full and provider-filtered model lists report configured native CLI authentication while leaving the default list non-blocking and unknown for that status.

Regression provenance

Possible regression — probable (reproduction; reviewed change). No predecessor PR is attributed.

Merge readiness

⚠️ Ready for maintainer review - 1 item remains

Keep open. The PR has a coherent shared-boundary fix, preserves the default list’s lazy behavior, and includes exact-head native CLI proof; it remains necessary because current main retains the earlier standalone path.

Priority: P2
Reviewed head: 51801f4b310383b3a78844a98d75f359bef81d80

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A focused, shared-boundary repair with direct exact-head terminal proof and targeted regression coverage.
Proof confidence 🦞 diamond lobster (5/6) Sufficient (terminal): The changed owner is the detailed CLI listing path that prepares scoped runtime auth before projecting rows; the supplied exact-head terminal trace exercises an existing logged-in Claude CLI against isolated OpenClaw state and observes the detailed row become available while the default row remains unknown.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Verified Sufficient (terminal): The changed owner is the detailed CLI listing path that prepares scoped runtime auth before projecting rows; the supplied exact-head terminal trace exercises an existing logged-in Claude CLI against isolated OpenClaw state and observes the detailed row become available while the default row remains unknown.
Evidence reviewed 8 items Introduced standalone behavior: Detailed lists gather only configured CLI runtime IDs, obtain scoped prepared auth modes, then pass them to the shared auth index; the default list does not enter that preparation branch.
Shared owner boundary: The new helper resolves the runtime provider, rejects a disabled owning plugin, and otherwise delegates the remaining native-auth decision to the existing resolver.
Gateway sibling alignment: Gateway catalog rows now use the same shared CLI-runtime availability helper, replacing its local duplicate implementation.
Findings None None.
Security None None.

How this fits together

Model listings combine configured model routes, prepared registry data, and read-only authentication facts into availability rows. The same shared evaluator feeds both standalone CLI output and Gateway model catalog projections.

flowchart LR
  Config[Model configuration] --> Registry[Prepared model registry]
  Metadata[Plugin metadata] --> Auth[Native CLI auth evaluation]
  Registry --> Detail[Detailed model listings]
  Auth --> Detail
  Detail --> Output[CLI and Gateway availability output]
Loading

Before merge

  • Resolve merge risk (P2) - Detailed and provider-filtered lists now synchronously invoke configured native CLI status probes; each probe is bounded by the provider’s 3-second timeout, but multiple configured native runtimes can still add visible latency to those explicit detailed views.
Agent review details

Security

None.

PR surface

Source +154, Tests +294, Docs 0. Total +448 across 13 files.

View PR surface stats
Area Files Added Removed Net
Source 7 238 84 +154
Tests 5 302 8 +294
Docs 1 1 1 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 13 541 93 +448

Review metrics

Metric Value Why it matters
Production versus test delta production +154, tests +294, docs 0 net The bug fix grows the auth-preparation path but removes the Gateway-local duplicate and adds focused boundary coverage.

Stored data model

Persistent data-model change detected: vector/embedding metadata: src/agents/prepared-model-runtime.scoped-catalog.ts. Confirm migration or upgrade compatibility proof before merge.

Merge-risk options

Maintainer options:

  1. Accept the explicit detailed-list latency (recommended)
    Merge with the documented 3-second-per-native-runtime bound because default listings remain outside the probe path.

Technical review

Best possible solution:

Retain the shared evaluator and detailed-only probe boundary, with the bounded native-status behavior documented and validated before merge.

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

Yes. The PR body supplies an exact-head isolated native Claude CLI run showing a logged-in status, a detailed row changing to available true, and the default row remaining unknown.

Is this the best way to solve the issue?

Yes. The patch carries a scoped prepared fact into the existing shared auth evaluator and reuses it for Gateway projection, rather than duplicating provider-specific logic in the CLI command.

AGENTS.md: found and applied where relevant.

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

Labels

Label changes:

  • add proof: sufficient: Contributor real behavior proof is sufficient. The changed owner is the detailed CLI listing path that prepares scoped runtime auth before projecting rows; the supplied exact-head terminal trace exercises an existing logged-in Claude CLI against isolated OpenClaw state and observes the detailed row become available while the default row remains unknown.
  • add rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🦞 diamond lobster and patch quality is 🐚 platinum hermit.
  • add status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Sufficient (terminal): The changed owner is the detailed CLI listing path that prepares scoped runtime auth before projecting rows; the supplied exact-head terminal trace exercises an existing logged-in Claude CLI against isolated OpenClaw state and observes the detailed row become available while the default row remains unknown.
  • remove rating: 🦪 silver shellfish: Current PR rating is rating: 🐚 platinum hermit, so this older rating label is no longer current.
  • remove status: 📣 needs proof: Current PR status label is status: 👀 ready for maintainer look.

Label justifications:

  • P2: This fixes incorrect authentication availability reporting for configured native CLI model routes without changing routing or execution.
  • merge-risk: 🚨 availability: Explicit detailed lists can synchronously wait on bounded local native CLI auth-status probes.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🦞 diamond lobster and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Sufficient (terminal): The changed owner is the detailed CLI listing path that prepares scoped runtime auth before projecting rows; the supplied exact-head terminal trace exercises an existing logged-in Claude CLI against isolated OpenClaw state and observes the detailed row become available while the default row remains unknown.
  • proof: sufficient: Contributor real behavior proof is sufficient. The changed owner is the detailed CLI listing path that prepares scoped runtime auth before projecting rows; the supplied exact-head terminal trace exercises an existing logged-in Claude CLI against isolated OpenClaw state and observes the detailed row become available while the default row remains unknown.

Evidence

What I checked:

Likely related people:

  • Peter Steinberger: Blame attributes the existing shared model-auth and Gateway CLI-runtime resolver behavior to the current-main boundary commit. (role: recent area contributor; confidence: high; commits: 48f43ac39dac; files: src/agents/model-auth-availability.ts, src/gateway/server-methods/models-list-auth-resolver.ts)

Rank-up moves

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

  • Wait for exact-head CI to complete, then retain the documented bounded latency of detailed native-auth checks.

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 (7 earlier review cycles)
  • reviewed 2026-08-27T06:52:41.094Z sha 930d61494c353e17816486a6d85e4b3dc4a1e99e :: needs maintainer review before merge. :: none
  • reviewed 2026-08-27T07:24:26.222Z sha 99a7c80559efc6b798d572dfbc597027079881f0 :: needs maintainer review before merge. :: none
  • reviewed 2026-08-27T07:34:10.151Z sha 99a7c80559efc6b798d572dfbc597027079881f0 :: needs maintainer review before merge. :: none
  • reviewed 2026-08-28T15:02:05.269Z sha 5f3c81a3c2c4db30f132c638b5bf3684e03088bd :: needs changes before merge. :: [P1] Keep the default list off the synchronous CLI probe
  • reviewed 2026-08-28T15:11:20.897Z sha 5f3c81a3c2c4db30f132c638b5bf3684e03088bd :: needs changes before merge. :: [P1] Keep the default list off the synchronous CLI probe
  • reviewed 2026-08-28T22:08:01.545Z sha 5f3c81a3c2c4db30f132c638b5bf3684e03088bd :: needs changes before merge. :: [P1] Keep the default list off the synchronous CLI probe
  • reviewed 2026-08-29T09:39:18.387Z sha 0be5439875ca30b74ee4a0b0bbf3a76ea7be238e :: needs real behavior proof before merge. :: none

@Marvinthebored
Marvinthebored force-pushed the fix/standalone-claude-cli-availability branch from 930d614 to 99a7c80 Compare August 27, 2026 07:11
@Marvinthebored

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

@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.

@Marvinthebored
Marvinthebored force-pushed the fix/standalone-claude-cli-availability branch from 99a7c80 to 5f3c81a Compare August 28, 2026 14:46
@openclaw-barnacle openclaw-barnacle Bot added the docs Improvements or additions to documentation label Aug 28, 2026
@Marvinthebored

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Aug 28, 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.

Re-review progress:

@clawsweeper clawsweeper Bot added rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. P1 High-priority user-facing bug, regression, or broken workflow. rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. and removed 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. P2 Normal backlog priority with limited blast radius. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. labels Aug 28, 2026
@clawsweeper clawsweeper Bot removed proof: sufficient ClawSweeper judged the real behavior proof convincing. P1 High-priority user-facing bug, regression, or broken workflow. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. labels Aug 29, 2026
@Marvinthebored
Marvinthebored force-pushed the fix/standalone-claude-cli-availability branch from 0be5439 to 51801f4 Compare August 29, 2026 11:20
@Marvinthebored

Copy link
Copy Markdown
Contributor Author

Added the requested real after-fix proof to the PR body and rebased onto current main.

On exact head 51801f4b310, the existing Claude login reports loggedIn: true; models list --provider anthropic --json reports anthropic/claude-opus-5 as available: true. The default list reports the same native route as unknown and remains outside the native-auth preparation path. The proof used an isolated temporary OpenClaw state; prod config and Gateway were untouched.

Exact-head focused tests: 58/58. Exact-head CLI build: passed.

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Aug 29, 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.

Re-review progress:

@clawsweeper clawsweeper Bot added 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. and removed rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. labels Aug 29, 2026
@obviyus
obviyus force-pushed the fix/standalone-claude-cli-availability branch from 51801f4 to 20534b2 Compare August 30, 2026 03:14
@openclaw-barnacle openclaw-barnacle Bot added triage: needs-pr-context Candidate: external PR body lacks required problem context or evidence. and removed triage: needs-pr-context Candidate: external PR body lacks required problem context or evidence. labels Aug 30, 2026
@obviyus

obviyus commented Aug 30, 2026

Copy link
Copy Markdown
Collaborator

Thanks @Marvinthebored!

Proof: With a real logged-in Claude CLI, both provider-filtered and --all model lists report the configured CLI-routed Anthropic model as available. With an isolated logged-out Claude config and an Anthropic API key present, both detailed views keep that route unknown. The default list remains lazy and starts no Claude authentication probe.

  • Bug: Detailed model lists could miss a valid Claude login, while an Anthropic API key could incorrectly make a logged-out CLI route look available.
  • Fix: Prepared runtime discovery now keeps native CLI authentication separate from provider credentials and projects the provider-owned result through one shared evaluator.

Example

Before After
Logged-in CLI could show available: null; API key could make a logged-out CLI route true Logged-in detailed views show true; logged-out CLI routes stay unknown; default view makes zero native probes

@obviyus
obviyus merged commit 7cac905 into openclaw:main Aug 30, 2026
269 of 271 checks passed
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Aug 30, 2026
Detailed model listings now use the provider-owned native CLI authentication result for configured CLI routes.

Anthropic API credentials no longer satisfy a separate Claude CLI route. The default model list remains lazy and starts no native authentication probe.

Co-authored-by: Marvinthebored <[email protected]>
Co-authored-by: Ayaan Zaidi <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agents Agent runtime and tooling commands Command implementations docs Improvements or additions to documentation gateway Gateway runtime merge-risk: 🚨 availability 🚨 May cause crashes, hangs, restart loops, stalls, or process outages. P2 Normal backlog priority with limited blast radius. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. size: L 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.

3 participants