Skip to content

#92224: fix(models): report local models as available in CLI list output#92363

Closed
zhangqueping wants to merge 1 commit into
openclaw:mainfrom
zhangqueping:fix/issue-92224-ollama-local-available
Closed

#92224: fix(models): report local models as available in CLI list output#92363
zhangqueping wants to merge 1 commit into
openclaw:mainfrom
zhangqueping:fix/issue-92224-ollama-local-available

Conversation

@zhangqueping

@zhangqueping zhangqueping commented Jun 12, 2026

Copy link
Copy Markdown
Contributor

AI-assisted PR. Implemented and verified with Claude (Claude Code). I have reviewed and understand the change and own the final diff.

Summary

Fix openclaw models list --json showing available: false for local Ollama models that are running and working correctly.

Root Cause

toModelRow in list.model-row.ts determined availability via provider auth (API keys). Local providers like Ollama do not need API-key auth, so hasAuthForProvider("ollama") returns false, causing available: false even though the model is running.

Fix

When a model has a local baseUrl (localhost, 127.0.0.1, etc.), skip the auth-based availability checks and report available: true. The local flag was already correctly computed by isLocalBaseUrl() — it just wasn't wired into the available computation.

Fixes #92224

Real behavior proof

Behavior addressed:
Local models (Ollama, LM Studio, etc.) with local base URLs are reported as available: true in openclaw models list --json output, instead of available: false.

Real environment tested:
Linux 4.19.112-2.el8.x86_64, Node.js v24.13.1, pnpm, vitest 4.1.7

Exact steps or command run after this patch:

# 1. Run the model-row unit tests
node scripts/run-vitest.mjs src/commands/models/list.model-row.test.ts --reporter=verbose

# 2. Verify the fix logic via code inspection
git diff HEAD~1 -- src/commands/models/list.model-row.ts

After-fix evidence:

$ node scripts/run-vitest.mjs src/commands/models/list.model-row.test.ts --reporter=verbose

 RUN  v4.1.7 /home/0668001085/workspace/openclaw

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

 Test Files  1 passed (1)
      Tests  3 passed (3)
   Duration  3.22s

[test] passed 1 Vitest shard in 15.46s

The fix is a minimal, targeted change — the local flag was already correctly computed, it just needed to be wired into the available expression:

-  const available =
-    availableKeys !== undefined && !allowProviderAvailabilityFallback
+  const available = local
+    ? true
+    : availableKeys !== undefined && !allowProviderAvailabilityFallback

When local is true (determined by isLocalBaseUrl() checking for localhost/127.0.0.1/etc.), available is always true. Otherwise, the existing auth/registry-based logic is unchanged.

Observed result after the fix:
All 3 model-row tests pass. Models with local: true (localhost/loopback base URLs) are now unconditionally reported as available, reflecting that local models don't need remote API-key auth.

What was not tested:
End-to-end openclaw models list CLI invocation against a live Ollama instance with running models.

Risk / scope

  • User-visible behavior change: Yes — local models now show available: true instead of false
  • Config/API change: No
  • Breaking: No — only expands availability to models that are already working
  • Highest risk: A model with a local base URL but actually unreachable would show available: true. Mitigation: local already correctly identifies loopback/localhost; unreachable models were already a preexisting concern

AI-assisted: built with Claude Code

…nclaw#92224)

The 'openclaw models list' command showed available: false for
local Ollama models that were actually running and working. This
happened because the availability check relied on provider auth
(API keys) which local providers like Ollama don't use.

Skip the auth-based availability fallback for models with a local
baseUrl (localhost, 127.0.0.1, etc.) and report them as available
whenever they are configured.

Closes 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 12, 2026
@clawsweeper

clawsweeper Bot commented Jun 12, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs real behavior proof before merge. Reviewed June 18, 2026, 11:29 PM ET / 03:29 UTC.

Summary
The PR changes toModelRow so model-list rows with local base URLs report available: true before registry or provider-auth availability checks.

PR surface: Source +3. Total +3 across 1 file.

Reproducibility: yes. at source level: current main leaves local rows tied to availableKeys and provider-auth fallback, so a local row with an empty availability set can render available: false. I did not establish a live Ollama reproduction in this read-only review.

Review metrics: 1 noteworthy metric.

  • CLI JSON field semantics: 1 field broadened. The available field is emitted by models list --json, so maintainers should notice the public output semantics change before merge.

Root-cause cluster
Relationship: fixed_by_candidate
Canonical: #92224
Summary: The linked issue is the canonical bug report; this PR is an open candidate fix, while the earlier similar PR was closed unmerged for lack of live proof.

Members:

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

Merge readiness
Overall: 🧂 unranked krab
Proof: 🧂 unranked krab
Patch quality: 🐚 platinum hermit
Result: blocked until real behavior proof from a real setup is added.

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

Rank-up moves:

  • [P1] Add redacted terminal output from a live local provider showing the patched openclaw models list --json row after the fix.
  • [P1] Add focused regression coverage for a local row with empty or missing availableKeys.

Proof guidance:

  • [P1] Needs real behavior proof before merge: The PR body provides unit-test output and code inspection only, and says no live local-provider CLI run was tested; the contributor should add redacted terminal output or logs, update the PR body, and request re-review if it does not run automatically.

Risk before merge

  • [P1] The PR intentionally broadens public models list --json and table Auth/available semantics for existing local-baseUrl rows, so consumers may lose the old distinction between registry-discovered availability and configured-local availability.
  • [P1] Contributor proof is unit-test and code-inspection only; it does not show the patched CLI output against a live local Ollama or LM Studio provider after the fix.
  • [P1] The branch does not add focused regression coverage for local rows with empty or missing availableKeys, so the exact source-level bug can regress even if the one-line fix is correct.

Maintainer options:

  1. Add live CLI proof and regression coverage (recommended)
    Require redacted terminal output showing a reachable local provider plus the patched openclaw models list --json row, and add a focused test for a local row with empty or missing availableKeys.
  2. Accept configured-local semantics
    Maintainers can explicitly accept that local-baseUrl rows report configured-local availability rather than live per-model reachability, with the compatibility impact understood.
  3. Pause if proof stays unavailable
    If nobody can provide a live local-provider check, keep this PR paused or close it in favor of a later proof-backed fix.

Next step before merge

  • [P1] The remaining blocker is contributor live proof plus maintainer acceptance of the compatibility-sensitive CLI output semantics, which an automated repair lane cannot supply end to end.

Security
Cleared: The diff only changes in-repo TypeScript row availability logic and adds no dependency, workflow, credential, or code-execution surface.

Review details

Best possible solution:

Land the narrow row-level fix only after redacted live CLI proof and focused regression coverage confirm the intended configured-local availability semantics.

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

Yes at source level: current main leaves local rows tied to availableKeys and provider-auth fallback, so a local row with an empty availability set can render available: false. I did not establish a live Ollama reproduction in this read-only review.

Is this the best way to solve the issue?

Yes, the row-level direction is the narrowest maintainable fix because docs already define this value as provider-level auth/config metadata rather than a live execution probe. The PR still needs live CLI proof and focused regression coverage before merge.

AGENTS.md: found and applied where relevant.

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

Label changes

Label justifications:

  • P2: This is a normal-priority CLI display bug for local model users with a small affected command surface.
  • merge-risk: 🚨 compatibility: The diff changes public JSON/table availability semantics for existing local-baseUrl model rows.
  • rating: 🧂 unranked krab: Overall readiness is 🧂 unranked krab; proof is 🧂 unranked krab and patch quality is 🐚 platinum hermit.
  • status: 📣 needs proof: The PR needs real behavior proof before ClawSweeper can clear the contributor ask. Needs real behavior proof before merge: The PR body provides unit-test output and code inspection only, and says no live local-provider CLI run was tested; the contributor should add redacted terminal output or logs, update the PR body, and request re-review if it does not run automatically.
Evidence reviewed

PR surface:

Source +3. Total +3 across 1 file.

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

Acceptance criteria:

  • [P1] node scripts/run-vitest.mjs src/commands/models/list.model-row.test.ts --reporter=verbose.
  • [P1] Run a redacted live openclaw models list --json --provider ollama or equivalent against a reachable local provider.

What I checked:

  • Repository policy read: Root AGENTS.md was read fully; no scoped AGENTS.md applies under src/commands, and the only maintainer note found is Telegram-specific, so the root PR proof and compatibility rules govern this review. (AGENTS.md:6, b28fda9ef8e6)
  • Current main availability behavior: Current main computes local but derives available from availableKeys or provider-auth fallback, so local rows are not special-cased when registry availability is present and fallback is not allowed. (src/commands/models/list.model-row.ts:52, b28fda9ef8e6)
  • PR behavior change: The PR inserts local ? true : ..., so every row classified as local bypasses the existing registry/auth availability expression. (src/commands/models/list.model-row.ts:57, e70923cfe391)
  • Caller path: Model-list row sources pass registry availability, provider-auth fallback flags, and auth-index callbacks into toModelRow, so the helper change affects configured, catalog, and provider rows sharing this row contract. (src/commands/models/list.rows.ts:95, b28fda9ef8e6)
  • User-visible output contract: models list --json emits rows directly and table output labels row.available as Auth, so this is a public CLI output semantics change. (src/commands/models/list.table.ts:33, b28fda9ef8e6)
  • Documented availability semantics: Docs define the Auth column as provider-level metadata computed from auth/config/local markers and explicitly not a live per-model execution probe, which supports a configured-local availability interpretation. Public docs: docs/cli/models.md. (docs/cli/models.md:55, b28fda9ef8e6)

Likely related people:

  • vincentkoc: Current blame in this checkout attributes the model-list row builder, caller path, auth index, and docs lines to a recent broad model-list touch on current main. (role: recent area contributor; confidence: medium; commits: 9765f7333a8b, b28fda9ef8e6; files: src/commands/models/list.model-row.ts, src/commands/models/list.rows.ts, src/commands/models/list.auth-index.ts)
  • shakkernerd: Merged model-list read-only and provider-filtered performance PRs touched list.model-row.ts, list.rows.ts, and the provider-filtered source orchestration this PR changes. (role: feature-history contributor; confidence: high; commits: c42ae0afd874, 9d445f4d6835; files: src/commands/models/list.model-row.ts, src/commands/models/list.rows.ts, src/commands/models/list.list-command.ts)
  • steipete: Recent hosted-provider and Ollama documentation work plus older model config/auth-profile refactors touch the same provider-auth and local-provider contract. (role: adjacent provider/auth owner; confidence: medium; commits: 470fc879e804, b04c838c15e5; files: docs/providers/ollama.md, extensions/ollama/index.ts, src/agents/model-auth.ts)
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 rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. P2 Normal backlog priority with limited blast radius. merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. labels Jun 12, 2026
@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 12, 2026
@clawsweeper clawsweeper Bot added rating: 🌊 off-meta tidepool PR readiness rating does not apply to this item. 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. rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. and removed rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. rating: 🌊 off-meta tidepool PR readiness rating does not apply to this item. rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. labels Jun 12, 2026
@zhangqueping

Copy link
Copy Markdown
Contributor Author

Closed. The fix is correct in direction — local models with local base URLs should report 'available: true' — and ClawSweeper rated the patch quality as 🐚 platinum hermit (the highest of any PR in this portfolio). However, we are unable to provide live Ollama CLI proof (openclaw models list --json --provider ollama) as required. PR #92228 was previously closed for the same reason on the same issue. A maintainer with an Ollama instance can trivially re-apply the 3-line change and capture the terminal output for proof.

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

Labels

commands Command implementations merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. P2 Normal backlog priority with limited blast radius. proof: supplied External PR includes structured after-fix real behavior proof. rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. size: XS status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask.

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