Skip to content

fix(models): mark local Ollama rows available#97491

Merged
vincentkoc merged 2 commits into
openclaw:mainfrom
qingminglong:codex/92224-ollama-local-available
Jun 28, 2026
Merged

fix(models): mark local Ollama rows available#97491
vincentkoc merged 2 commits into
openclaw:mainfrom
qingminglong:codex/92224-ollama-local-available

Conversation

@qingminglong

@qingminglong qingminglong commented Jun 28, 2026

Copy link
Copy Markdown
Contributor

Closes #92224

What Problem This Solves

Fixes an issue where users running openclaw models list --json could see a reachable local Ollama model reported with local: true but available: false when registry model-level availability did not include that exact model key.

Why This Change Was Made

Local model rows already classify loopback/local baseUrl values, and the models CLI documents availability/auth as provider-level metadata from local-provider markers rather than a live per-model execution probe. This change treats local provider rows as available from that local marker while preserving registry model-key availability and provider-auth fallback for non-local rows.

User Impact

Users with local Ollama models now get model-list output that matches the local-provider auth semantics: configured local Ollama rows no longer look unavailable solely because registry discovery omitted the exact model key.

Evidence

  • Claim proved: a reachable local Ollama model is listed with local: true and available: true on the patched branch.
  • Commands / artifacts:
    • docker run -d --rm --name openclaw-ollama-proof -p 11434:11434 alpine/ollama:latest -> started a real Ollama daemon reachable at http://127.0.0.1:11434.
    • docker exec openclaw-ollama-proof ollama pull smollm2:135m -> pulled a local model into that daemon.
    • curl.exe -sS http://127.0.0.1:11434/api/tags -> returned smollm2:135m from the daemon.
    • node --import tsx src/entry.ts models list --json --provider ollama at commit b5390f5c15, with isolated OPENCLAW_HOME, isolated OPENCLAW_CONFIG_PATH, and OLLAMA_API_KEY=ollama-local -> passed.
    • node scripts/run-vitest.mjs src/commands/models/list.model-row.test.ts --reporter=verbose -> passed, 4 tests.
    • node scripts/run-vitest.mjs src/commands/models/list.rows.test.ts --reporter=verbose -> passed, 4 tests.
    • git diff --check -> passed.
    • python .agents\skills\autoreview\scripts\autoreview --mode local -> clean, no accepted/actionable findings.
  • Observed result: the new regression test fails before the fix with expected false to be true, then passes after local base URL rows are included in row availability.
  • Real Ollama CLI proof output:
COMMAND: node --import tsx src/entry.ts models list --json --provider ollama
COMMIT: b5390f5c15
OLLAMA_DAEMON: Docker Desktop container openclaw-ollama-proof, alpine/ollama:latest, reachable at http://127.0.0.1:11434
OPENCLAW_HOME: isolated temp dir
OPENCLAW_CONFIG_PATH: isolated temp openclaw.json
OLLAMA_API_KEY: ollama-local
OLLAMA_TAGS_BEFORE: {"models":[{"name":"smollm2:135m","model":"smollm2:135m","modified_at":"2026-06-28T13:57:38.596605328Z","size":270898672,"digest":"9077fe9d2ae1a4a41a868836b56b8163731a8fe16621397028c2c76f838c6907","details":{"format":"gguf","family":"llama","families":["llama"],"parameter_size":"134.52M","quantization_level":"F16","context_length":8192,"embedding_length":576},"capabilities":["completion"]}]}
EXIT: 0
{
  "count": 1,
  "models": [
    {
      "key": "ollama/smollm2:135m",
      "name": "smollm2:135m",
      "input": "text",
      "contextWindow": 8192,
      "local": true,
      "available": true,
      "tags": [],
      "missing": false
    }
  ]
}
  • Supporting loopback proof: before the Dockerized daemon was available, the same OpenClaw CLI entrypoint was also run against a local Ollama-compatible endpoint and returned available: true for ollama/qwen3.6:35b-a3b.
  • Not tested / proof gaps: I did not install native Windows Ollama or run against the user's normal local model store. The live proof above uses a real Ollama daemon running in Docker Desktop with a pulled local model and exercises OpenClaw's real CLI entrypoint, config loading, provider discovery HTTP calls, and JSON output.

@openclaw-barnacle openclaw-barnacle Bot added commands Command implementations size: XS labels Jun 28, 2026
@clawsweeper

clawsweeper Bot commented Jun 28, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed June 28, 2026, 1:50 PM ET / 17:50 UTC.

Summary
The branch changes model-list row availability so local provider rows are available from the local base URL marker, adds a regression test, and currently also carries main-equivalent marketplace, provider catalog, SDK, and response-limit refresh changes from its second commit.

PR surface: Source +1376, Tests +2117, Docs +17, Generated 0, Other 0. Total +3510 across 50 files.

Reproducibility: yes. at source level: current main can render a loopback Ollama row as local while leaving available false when availableKeys omits that key. The PR body also supplies after-fix live CLI output against a Dockerized Ollama daemon.

Review metrics: 2 noteworthy metrics.

  • Unique Config Surface: 0 added, 0 changed, 0 removed relative to current main. The marketplace config/default files shown in the stale PR diff match current main and are not part of the unique Ollama fix.
  • Public Availability Rule: 1 boolean row-availability rule changed. The user-visible CLI JSON/table output for local provider rows changes, so maintainers should review the compatibility semantics before merge.

Stored data model
Persistent data-model change detected: database schema: src/cli/plugins-cli.marketplace-refresh.test.ts, database schema: src/plugins/official-external-plugin-catalog.test.ts, serialized state: extensions/minimax/video-generation-provider.test.ts, serialized state: src/config/zod-schema.marketplaces.test.ts, serialized state: src/plugin-sdk/provider-catalog-live-runtime.test.ts, serialized state: src/plugins/official-external-plugin-catalog.test.ts, and 7 more. Confirm migration or upgrade compatibility proof before merge.

Root-cause cluster
Relationship: fixed_by_candidate
Canonical: #92224
Summary: This PR is the active candidate fix for the open local Ollama model-list availability bug; two earlier closed PRs attempted the same root cause but did not land.

Members:

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

Merge readiness
Overall: 🐚 platinum hermit
Proof: 🦞 diamond lobster
Patch quality: 🐚 platinum hermit
Result: ready for maintainer review.

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

Rank-up moves:

  • [P2] Rebase onto current main so the final diff clearly shows only the intended model-list fix before merge.

Risk before merge

  • [P1] Merging intentionally changes public models list --json and table Auth/availability semantics for local-baseUrl rows from exact registry-key availability to local-marker availability; maintainers should accept that this is provider-level metadata, not live per-model readiness.
  • [P1] The head is behind current main and the displayed PR diff includes main-equivalent marketplace/provider/SDK/network files; rebase or merge-result review should confirm the final surface collapses to the intended model-list fix.

Maintainer options:

  1. Rebase and land the narrow model fix (recommended)
    Rebase onto current main so the review surface shows the two model-list files, then merge after required CI and maintainer acceptance of the output semantics.
  2. Accept provider-level availability semantics
    Maintainers can intentionally accept that local rows use the local marker for availability even when the endpoint is not being live-probed per model.
  3. Pause for a live-probe design instead
    If available must mean exact live Ollama readiness, pause this PR and design a separate opt-in live probe rather than merging this display fix.

Next step before merge

  • [P2] The remaining action is maintainer acceptance of compatibility-sensitive CLI availability semantics plus stale-head refresh, not an automated code repair.

Security
Cleared: No concrete security or supply-chain issue was found in the unique model-list fix; the broader security-sensitive files visible in the stale diff match current-main refresh content.

Review details

Best possible solution:

Rebase onto current main, keep the focused model-row fix and regression/live Ollama proof, and have a maintainer explicitly accept the local-marker availability semantics before merge.

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

Yes at source level: current main can render a loopback Ollama row as local while leaving available false when availableKeys omits that key. The PR body also supplies after-fix live CLI output against a Dockerized Ollama daemon.

Is this the best way to solve the issue?

Yes, this is the narrowest maintainable fix if available follows the documented provider-level local-marker semantics. A live per-model reachability probe would be a different feature and should not be smuggled into this bug fix.

AGENTS.md: found and applied where relevant.

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

Label changes

Label justifications:

  • P2: This is a normal-priority CLI display bug for local Ollama users; active sessions still work, but model-list availability is misleading.
  • merge-risk: 🚨 compatibility: The PR changes public model-list availability output for existing local-provider configurations and could affect users or scripts interpreting available as exact live readiness.
  • 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 (live_output): The PR body includes after-fix live output from a real Dockerized Ollama daemon with a pulled local model and openclaw models list --json --provider ollama showing available: true.
  • proof: sufficient: Contributor real behavior proof is sufficient. The PR body includes after-fix live output from a real Dockerized Ollama daemon with a pulled local model and openclaw models list --json --provider ollama showing available: true.
Evidence reviewed

PR surface:

Source +1376, Tests +2117, Docs +17, Generated 0, Other 0. Total +3510 across 50 files.

View PR surface stats
Area Files Added Removed Net
Source 28 1487 111 +1376
Tests 17 2165 48 +2117
Docs 3 26 9 +17
Config 0 0 0 0
Generated 1 3 3 0
Other 1 4 4 0
Total 50 3685 175 +3510

What I checked:

  • Repository policy read: Root and scoped AGENTS.md files for docs, extensions, plugin SDK, agents, plugins, and scripts were read; the review applied the repo guidance that config/default surfaces, plugin SDK changes, provider routing, and public CLI behavior are compatibility-sensitive. (AGENTS.md:1, 2e5e5e5af905)
  • Current main still has the false-negative path: At current main, modelIsAvailable only checks availableKeys, so a local row with a missing registry key can still produce available: false when fallback is disabled. (src/commands/models/list.model-row.ts:53, 2e5e5e5af905)
  • PR fixes the implicated row decision: The PR makes modelIsAvailable true for local base URLs before falling back to registry/provider-auth availability, matching the reported Ollama local-row case. (src/commands/models/list.model-row.ts:53, 4dd1874b04f1)
  • Focused regression coverage: The added test covers an Ollama loopback row whose availableKeys set omits the exact model key and expects available: true. (src/commands/models/list.model-row.test.ts:60, 4dd1874b04f1)
  • Documented CLI semantics: The models CLI docs define Auth as provider-level read-only metadata from local markers and other auth/config markers, not an exact per-model execution probe. Public docs: docs/cli/models.md. (docs/cli/models.md:55, 2e5e5e5af905)
  • Ollama local-marker contract: The Ollama docs say local and LAN hosts use the ollama-local marker instead of a real bearer token, supporting the local-marker availability interpretation. Public docs: docs/providers/ollama.md. (docs/providers/ollama.md:27, 2e5e5e5af905)

Likely related people:

  • shakkernerd: Recent history shows model-list row and auth-index work in the central toModelRow and row-source path. (role: feature-history contributor; confidence: high; commits: b418c08a2297, 35171f4e4715, c7af4dcb312b; files: src/commands/models/list.model-row.ts, src/commands/models/list.rows.ts)
  • steipete: History shows adjacent model-list docs, auth catalog, and Ollama/provider-auth semantics work around the affected behavior. (role: adjacent provider/auth contributor; confidence: medium; commits: 73752f07f219, 9d7f83b17504, d5c094f1691a; files: docs/cli/models.md, docs/providers/ollama.md, src/commands/models/list.rows.ts)
  • vincentkoc: The PR is assigned to this user, and recent history shows broad current-main touches in model-list row/source files plus the current branch refresh commit. (role: recent area contributor and assigned reviewer; confidence: medium; commits: eea777c9fc9c, 4dd1874b04f1; files: src/commands/models/list.rows.ts, src/commands/models/list.model-row.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 28, 2026
@qingminglong

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

I updated the PR body with additional CLI evidence from commit b5390f5c15:

  • node --import tsx src/entry.ts models list --json --provider ollama
  • isolated OPENCLAW_HOME and OPENCLAW_CONFIG_PATH
  • loopback Ollama-compatible endpoint hit by real OpenClaw provider discovery: GET /api/tags, POST /api/show
  • output row: ollama/qwen3.6:35b-a3b, local: true, available: true

The body also keeps the remaining proof gap explicit: this Windows host does not currently have a real Ollama daemon, ollama CLI, or running Docker daemon, so this is loopback-compatible endpoint proof rather than full real-daemon Ollama proof.

@clawsweeper

clawsweeper Bot commented Jun 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 repository_dispatch).
Result: the existing ClawSweeper review comment will be edited in place when the review finishes.

@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: 🧂 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. labels Jun 28, 2026
@qingminglong

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

I updated the PR body with real Ollama daemon proof for commit b5390f5c15.

New evidence added:

  • real Ollama daemon running in Docker Desktop: openclaw-ollama-proof, alpine/ollama:latest, reachable at http://127.0.0.1:11434
  • pulled local model: smollm2:135m
  • curl.exe -sS http://127.0.0.1:11434/api/tags returned that model from the daemon
  • patched branch command: node --import tsx src/entry.ts models list --json --provider ollama
  • isolated OPENCLAW_HOME, isolated OPENCLAW_CONFIG_PATH, and OLLAMA_API_KEY=ollama-local
  • output row: ollama/smollm2:135m, local: true, available: true, EXIT: 0

Remaining gap is only that I did not install native Windows Ollama or use the user's normal model store; this is a real Dockerized Ollama daemon with a pulled local model, not the earlier loopback-compatible mock proof.

@vincentkoc vincentkoc self-assigned this Jun 28, 2026
@openclaw-barnacle openclaw-barnacle Bot added docs Improvements or additions to documentation channel: discord Channel integration: discord channel: mattermost Channel integration: mattermost channel: nextcloud-talk Channel integration: nextcloud-talk cli CLI command changes scripts Repository scripts agents Agent runtime and tooling extensions: minimax extensions: volcengine extensions: xiaomi plugin: file-transfer extensions: opencode labels Jun 28, 2026
@vincentkoc
vincentkoc merged commit a10add7 into openclaw:main Jun 28, 2026
182 of 189 checks passed
@vincentkoc

Copy link
Copy Markdown
Member

Merged via squash.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Jun 29, 2026
* fix(models): mark local Ollama rows available

* fix(models): mark local Ollama rows available

---------

Co-authored-by: Vincent Koc <[email protected]>
QiuYuang pushed a commit to QiuYuang/openclaw that referenced this pull request Jul 1, 2026
* fix(models): mark local Ollama rows available

* fix(models): mark local Ollama rows available

---------

Co-authored-by: Vincent Koc <[email protected]>
chenyangjun-xy pushed a commit to chenyangjun-xy/openclaw that referenced this pull request Jul 1, 2026
* fix(models): mark local Ollama rows available

* fix(models): mark local Ollama rows available

---------

Co-authored-by: Vincent Koc <[email protected]>
Rorqualx pushed a commit to Rorqualx/cortex that referenced this pull request Jul 2, 2026
* fix(models): mark local Ollama rows available

* fix(models): mark local Ollama rows available

---------

Co-authored-by: Vincent Koc <[email protected]>
(cherry picked from commit a10add7)
chenyangjun-xy pushed a commit to chenyangjun-xy/openclaw that referenced this pull request Jul 3, 2026
* fix(models): mark local Ollama rows available

* fix(models): mark local Ollama rows available

---------

Co-authored-by: Vincent Koc <[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 channel: discord Channel integration: discord channel: mattermost Channel integration: mattermost channel: nextcloud-talk Channel integration: nextcloud-talk cli CLI command changes commands Command implementations docs Improvements or additions to documentation extensions: minimax extensions: opencode extensions: volcengine extensions: xiaomi merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. P2 Normal backlog priority with limited blast radius. plugin: file-transfer proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. scripts Repository scripts size: XL 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.

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

2 participants