Skip to content

fix(cli): mark local models (Ollama) available in models list without auth#92228

Closed
liuhao1024 wants to merge 1 commit into
openclaw:mainfrom
liuhao1024:fix/models-list-local-available
Closed

fix(cli): mark local models (Ollama) available in models list without auth#92228
liuhao1024 wants to merge 1 commit into
openclaw:mainfrom
liuhao1024:fix/models-list-local-available

Conversation

@liuhao1024

@liuhao1024 liuhao1024 commented Jun 11, 2026

Copy link
Copy Markdown
Contributor

What does this PR do?

Fixes openclaw models list showing available: false for local Ollama models that are running and working. Local providers serve on loopback addresses without API keys, so auth-based availability checks should not gate them.

Related Issue

Fixes #92224

Type of Change

  • Bug fix (non-breaking)

Changes Made

  • src/commands/models/list.model-row.ts: Local models (loopback baseUrl) are now always marked available regardless of auth profile status. The existing isLocalBaseUrl() check was already computed (local) but not used in the availability logic.
  • src/commands/models/list.model-row.test.ts: Added 2 regression tests — (1) local model without auth keys is available, (2) local model excluded from availableKeys set is still available.

How to Test

  1. Have Ollama running with a model loaded
  2. Run openclaw models list --json
  3. Verify "available": true for ollama models

Unit test alternative:

npx vitest run src/commands/models/list.model-row.test.ts --reporter=verbose

Real behavior proof

Behavior or issue addressed:
openclaw models list --json shows "available": false for local Ollama models that work fine in active sessions.

Root cause:
toModelRow() derives available from hasConfiguredAuth() via availableKeys. Local providers (Ollama, LM Studio, etc.) don't require API keys, so auth checks always return false.

Fix:
Use the already-computed local flag (from isLocalBaseUrl()) to bypass auth-based availability for local providers: const available = local || authFallbackAvailable.

Real environment tested:

  • macOS 26.4.1 (Darwin arm64)
  • Node v25.8.2
  • vitest 4.1.5

Exact steps or command run after the patch:

cd openclaw && npx vitest run src/commands/models/list.model-row.test.ts --reporter=verbose

Evidence after fix:

RUN  v4.1.5 /Users/liuhao/.hermes/workdir/openclaw

 ✓  unit-fast  src/commands/models/list.model-row.test.ts > toModelRow > keeps native context metadata and effective runtime context tokens distinct 1ms
 ✓  unit-fast  src/commands/models/list.model-row.test.ts > toModelRow > marks models available from auth profiles without loading model discovery 0ms
 ✓  unit-fast  src/commands/models/list.model-row.test.ts > toModelRow > marks bracketed IPv6 loopback base URLs as local 0ms
 ✓  unit-fast  src/commands/models/list.model-row.test.ts > toModelRow > marks local models available even without auth 0ms
 ✓  unit-fast  src/commands/models/list.model-row.test.ts > toModelRow > marks local models available even when availableKeys excludes them 0ms

 Test Files  1 passed (1)
      Tests  5 passed (5)
   Start at  01:39:51
   Duration  426ms (transform 150ms, setup 0ms, import 356ms, tests 2ms, environment 0ms)

Observed result after fix:
All 5 tests pass. The 2 new regression tests confirm that:

  1. Local models (127.0.0.1 loopback) with no auth keys → available: true
  2. Local models (localhost) with empty availableKeys set → available: true

What was not tested:
Manual end-to-end testing with a live Ollama instance (no Ollama daemon on this machine). The fix is a one-line boolean change (local || authFallbackAvailable) and the existing isLocalBaseUrl() helper is already tested for IPv4/IPv6 loopback addresses.

Checklist

  • Read Contributing Guide
  • Conventional Commits
  • Searched for duplicates
  • Only related changes
  • Tests pass
  • Added tests
  • Tested on macOS

… auth

Local providers like Ollama serve on loopback addresses without API keys.
The models list command was showing available: false for these models because
hasConfiguredAuth() returns false when no auth profile exists. Since local
providers don't need authentication, always mark them as available.

Fixes openclaw#92224
@openclaw-barnacle openclaw-barnacle Bot added commands Command implementations size: XS triage: needs-real-behavior-proof Candidate: external PR needs after-fix proof from a real setup. labels Jun 11, 2026
@clawsweeper

clawsweeper Bot commented Jun 11, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs real behavior proof before merge. Reviewed June 11, 2026, 1:28 PM ET / 17:28 UTC.

Summary
Review failed before ClawSweeper could summarize the requested change.

PR surface: Source +2, Tests +32. Total +34 across 2 files.

Reproducibility: unclear. The review failed before ClawSweeper could establish a reproduction path.

Review metrics: none identified.

Merge readiness
Overall: 🌊 off-meta tidepool
Proof: 🌊 off-meta tidepool
Patch quality: 🌊 off-meta tidepool
Result: rating does not apply to this item.

Overall follows the weaker of proof and patch quality, so missing proof can cap an otherwise strong patch.

Risk before merge

  • [P1] No close action taken because the review did not complete.

Maintainer options:

  1. Decide the mitigation before merge
    Retry the Codex review after fixing the execution failure.
  2. Pause or close
    Do not merge this PR until maintainers decide whether the risk is worth taking.

Next step before merge

  • [P1] Review did not complete, so no work-lane recommendation was made.
Review details

Best possible solution:

Retry the Codex review after fixing the execution failure.

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

Unclear. The review failed before ClawSweeper could establish a reproduction path.

Is this the best way to solve the issue?

Unclear. Retry the review first so ClawSweeper can evaluate the actual issue and fix direction.

AGENTS.md: unclear because the file could not be read completely.

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

Label changes

Label changes:

  • add rating: 🌊 off-meta tidepool: Overall readiness is 🌊 off-meta tidepool; proof is 🌊 off-meta tidepool and patch quality is 🌊 off-meta tidepool.

Label justifications:

  • rating: 🌊 off-meta tidepool: Overall readiness is 🌊 off-meta tidepool; proof is 🌊 off-meta tidepool and patch quality is 🌊 off-meta tidepool.
Evidence reviewed

PR surface:

Source +2, Tests +32. Total +34 across 2 files.

View PR surface stats
Area Files Added Removed Net
Source 1 3 1 +2
Tests 1 32 0 +32
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 2 35 1 +34

What I checked:

  • failure reason: retryable codex transport failure.
  • codex failure detail: Codex review failed for this PR with exit 1.
  • codex stderr: ] fix ci.

Likely related people:

  • unknown: Codex failed before it could trace repository history. (role: review did not complete; confidence: low)
What the crustacean ranks mean
  • 🦀 challenger crab: rare, exceptional readiness with strong proof, clean implementation, and convincing validation.
  • 🦞 diamond lobster: very strong readiness with only minor maintainer review expected.
  • 🐚 platinum hermit: good normal PR, likely mergeable with ordinary maintainer review.
  • 🦐 gold shrimp: useful signal, but proof or patch confidence is still limited.
  • 🦪 silver shellfish: thin signal; proof, validation, or implementation needs work.
  • 🧂 unranked krab: not merge-ready because proof is missing/unusable or there are serious correctness or safety concerns.
  • 🌊 off-meta tidepool: rating does not apply to this item.

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.

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

@clawsweeper clawsweeper Bot added the rating: 🌊 off-meta tidepool PR readiness rating does not apply to this item. label Jun 11, 2026
@liuhao1024

Copy link
Copy Markdown
Contributor Author

Closing — cannot provide real behavior proof without a live Ollama instance. The CI Real behavior proof check requires evidence from an actual OpenClaw setup. Will not re-submit without proper testing environment.

@liuhao1024 liuhao1024 closed this Jun 11, 2026
@liuhao1024
liuhao1024 deleted the fix/models-list-local-available branch June 11, 2026 17:38
@openclaw-barnacle openclaw-barnacle Bot added proof: supplied External PR includes structured after-fix real behavior proof. and removed triage: needs-real-behavior-proof Candidate: external PR needs after-fix proof from a real setup. labels Jun 11, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

commands Command implementations proof: supplied External PR includes structured after-fix real behavior proof. rating: 🌊 off-meta tidepool PR readiness rating does not apply to this item. size: XS

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Bug: CLI shows available: false for local Ollama models that are running and working

1 participant