fix(cli): mark local models (Ollama) available in models list without auth#92228
fix(cli): mark local models (Ollama) available in models list without auth#92228liuhao1024 wants to merge 1 commit into
Conversation
… 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
|
Codex review: needs real behavior proof before merge. Reviewed June 11, 2026, 1:28 PM ET / 17:28 UTC. Summary 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 follows the weaker of proof and patch quality, so missing proof can cap an otherwise strong patch. Risk before merge
Maintainer options:
Next step before merge
Review detailsBest 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 changesLabel changes:
Label justifications:
Evidence reviewedPR surface: Source +2, Tests +32. Total +34 across 2 files. View PR surface stats
What I checked:
Likely related people:
What the crustacean ranks mean
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
|
|
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. |
What does this PR do?
Fixes
openclaw models listshowingavailable: falsefor 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
Changes Made
src/commands/models/list.model-row.ts: Local models (loopback baseUrl) are now always marked available regardless of auth profile status. The existingisLocalBaseUrl()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 fromavailableKeysset is still available.How to Test
openclaw models list --json"available": truefor ollama modelsUnit test alternative:
Real behavior proof
Behavior or issue addressed:
openclaw models list --jsonshows"available": falsefor local Ollama models that work fine in active sessions.Root cause:
toModelRow()derivesavailablefromhasConfiguredAuth()viaavailableKeys. Local providers (Ollama, LM Studio, etc.) don't require API keys, so auth checks always return false.Fix:
Use the already-computed
localflag (fromisLocalBaseUrl()) to bypass auth-based availability for local providers:const available = local || authFallbackAvailable.Real environment tested:
Exact steps or command run after the patch:
Evidence after fix:
Observed result after fix:
All 5 tests pass. The 2 new regression tests confirm that:
available: trueavailableKeysset →available: trueWhat 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 existingisLocalBaseUrl()helper is already tested for IPv4/IPv6 loopback addresses.Checklist