Skip to content

fix(ollama): keep local setup local and skip embedding chat defaults - #130459

Merged
steipete merged 1 commit into
mainfrom
codex/ollama-chat-eligibility
Aug 26, 2026
Merged

steipete merged 1 commit into
mainfrom
codex/ollama-chat-eligibility

Conversation

@steipete

Copy link
Copy Markdown
Contributor

Related: #130240

AI-assisted follow-up. Thanks to @Yigtwxx for the original remote-discovery work in #130240; this change builds on that merged fix without replaying it.

What Problem This Solves

Fixes an issue where Ollama setup could select a cloud model after the operator chose Local only, or choose an embedding model as the default chat model. A remote alias identified only by remote_model could also appear in the local node-inference inventory.

Embedding rows could gain inferred tool support when their remote inspection omitted capabilities. Separately, an embedding row advertising tools could stop setup from scanning a later chat model, and a failed model download could fall back to the first installed embedding model.

Why This Change Was Made

Keep remote identity and embedding-only classification in the Ollama plugin's metadata owner. Local node discovery/chat and Local-only setup now share remote classification; setup filters inventory before inspection limits, default selection, and config projection. Capability inference, catalog admission, setup selection, and failed-download fallback share the embedding-only rule while retaining truthful advertised metadata.

The fallback reuses inspected metadata and inspects an unscanned candidate before making it the default. If only embedding models are available, setup reports the failure and preserves the prior config. Existing unknown-capability and plain-chat fallback behavior is retained; no new tool/context requirement, public option, SDK surface, dependency, or schema is introduced.

Production LOC: +76/-34 (net +42). Tests: +204/-60 (net +144). Growth implements the shared identity/eligibility boundary and inspection-before-fallback ownership; duplicate remote predicates, raw-tools decisions, and the unchecked first-available fallback are removed. The failed-download regression table replaces the old standalone fallback test in the existing noninteractive suite.

User Impact

Local-only operators keep local models throughout discovery, selection, and saved configuration. Embedding models no longer become automatic chat defaults through inferred capabilities or failed-download fallback. Cloud + Local remains inclusive, mixed completion/embedding models remain eligible, and advertised tool metadata is not erased.

Evidence

Reviewed head: 7519d705926228e4f355e8f700a1b0181bc3b5c2.

  • Captured failing regressions before each production repair: remote-model-only node discovery/chat; Local-only inventory filtering; interactive and noninteractive embedding defaults; scan continuation beyond 200 embedding/tool rows; and failed-pull fallback with embedding-only or embedding-first inventory.
  • Final node scripts/run-vitest.mjs extensions/ollama: 28 files, 742 tests passed.
  • Eight-file formatting, lint, extension production/test types, and all changed-path guards passed in aggregate. The initial native changed-gate run stopped only at the setup test file's line limit; moving the regression matrix into the existing noninteractive suite fixed that without changing limits or suppressions. The actual failed lint, affected typecheck, and remaining planned guards then passed.
  • Fresh structured and separate independent Codex reviews of the complete final diff both returned no actionable P0/P1 findings within their selected review scope.
  • Real Ollama 0.32.15, isolated state/model storage, with public qwen3:0.6b, embeddinggemma, and a Mistral cloud manifest: unchanged main chose the cloud model under Local only; the repair chose qwen and excluded the cloud inventory. This before/after result did not use capability injection.
  • Real provider/setup/node paths also exercised explicitly labeled HTTP fault injection for incomplete/embedding/mixed/empty capabilities, remote aliases, long inventories, failed inspection, and failed downloads. These are fault-injection proofs, not claims that current official cloud manifests naturally omit capabilities.
  • Actual local inference through the OpenClaw node command returned Pong! (4 completion tokens). Final built-CLI noninteractive onboarding against the real daemon completed and saved the selected local model in isolated config.
  • Independent source-blind validation through the built public CLI passed all six scoped contract clauses: real classic onboarding and local inference; Local-only exclusion with 201 remote rows and remote aliases; explicit Cloud + Local inclusion; embedding/tool inventories and failed-download fallback; visible empty/unavailable/invalid-inventory errors; and separate labeling of real versus injected evidence. Successful cases saved configs that passed public config validation; no-chat cases exited 1 without creating config. The Cloud + Local UI control used explicitly injected dummy identity metadata, not real cloud authentication.

No authenticated cloud completion was performed. Current official cloud manifest metadata was complete. Real model names/digests stayed unchanged throughout independent validation, and the isolated daemon/proxy were stopped afterward. Separate follow-ups remain for signed-out Cloud + Local wording/inventory consistency and remote-alias provenance in local context capping; this PR does not claim to repair those paths. Initial noninteractive discovery can still attempt a suggested download before finding a usable chat model after more than 200 embedding rows; the safe failed-download fallback is tested, but avoiding that unnecessary download remains a source-only follow-up. An initial fixture streaming failure followed by the wizard's Continue anyway left model/provider unset; this is preserved as an unconfirmed generic-wizard follow-up, not an accepted finding against this repair.

Share remote identity across discovery, node inference, and Local-only setup.
Keep affirmative embedding-only models out of inferred chat capabilities,
guided selection, and failed-download fallback while preserving advertised
metadata and existing unknown-capability chat fallback behavior.

Follow up on #130240 with reproduced regressions, 742 Ollama tests, isolated
real-daemon before/after proof, and source-blind public CLI validation.

Co-authored-by: Yigtwxx <[email protected]>
@clawsweeper

clawsweeper Bot commented Aug 26, 2026

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

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

@steipete
steipete marked this pull request as ready for review August 26, 2026 22:23
@steipete
steipete merged commit c120d09 into main Aug 26, 2026
162 of 193 checks passed
@steipete
steipete deleted the codex/ollama-chat-eligibility branch August 26, 2026 22:43
@steipete

Copy link
Copy Markdown
Contributor Author

Merged via squash.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Aug 27, 2026
…penclaw#130459)

Share remote identity across discovery, node inference, and Local-only setup.
Keep affirmative embedding-only models out of inferred chat capabilities,
guided selection, and failed-download fallback while preserving advertised
metadata and existing unknown-capability chat fallback behavior.

Follow up on openclaw#130240 with reproduced regressions, 742 Ollama tests, isolated
real-daemon before/after proof, and source-blind public CLI validation.

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

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant