Repository navigation
fix(ollama): models advertise tools when /api/show fails - #109971
Conversation
Failed show responses left capabilities undefined, which buildOllamaModelDefinition treats as optimistic supportsTools. Match setup inspect: return empty capabilities instead.
Unit paths for HTTP error/throw plus real 127.0.0.1 server proving buildOllamaProvider keeps supportsTools false when /api/show 500s.
|
@clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
|
Codex review: needs maintainer review before merge. Reviewed July 31, 2026, 5:17 AM ET / 09:17 UTC. ClawSweeper reviewWhat this changesThe branch distinguishes failed Ollama Merge readinessThis remains a bounded, necessary Ollama provider fix. The latest head removes the prior release-owned changelog blocker, retains the three-state inspection behavior across discovery, setup, and dynamic resolution, and has credible real HTTP proof; final maintainer review should wait for the current CI run rather than closing or replacing the PR. Priority: P2 Review scores
Verification
How this fits togetherThe Ollama extension reads local model tags, enriches each model through flowchart LR
A[Ollama /api/tags] --> B[Discovered local models]
B --> C[/api/show inspection]
C --> D{Inspection outcome}
D -->|Metadata available| E[Authoritative capabilities]
D -->|Request failed| F[Failed-inspection marker]
E --> G[Catalog and setup definitions]
F --> G
G --> H[Dynamic model resolution]
Before merge
Agent review detailsSecurityNone. PR surfaceSource +11, Tests +70. Total +81 across 6 files. View PR surface stats
Review metricsNone. Stored data modelPersistent data-model change detected: Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Land the three-state inspection contract after the current merge-result checks pass: preserve optimistic behavior only for genuinely uninspected models, retain authoritative empty capability handling, and keep failed inspection conservative and fail-closed for unknown dynamic model requests. Do we have a high-confidence way to reproduce the issue? Yes from the supplied focused path: a local Ollama-compatible HTTP server returns tags successfully and makes Is this the best way to solve the issue? Yes. A dedicated failed-inspection marker is narrower and safer than treating failure as either omitted metadata or authoritative empty capabilities, and the branch propagates that distinction through each known consumer while keeping unknown dynamic models fail-closed. AGENTS.md: unclear because the file could not be read completely. Codex review notes: model internal, reasoning high; reviewed against f03dc9785e48. LabelsLabel justifications:
EvidenceWhat I checked:
Likely related people:
Rank-up movesOptional improvements that raise the rating; they are not merge blockers.
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (7 earlier review cycles)
|
Distinguish failed inspection from authoritative empty capabilities so tools stay conservative without suppressing model-name reasoning.
Failed show keeps reasoning heuristics; authoritative [] disables both.
|
Addressed ClawSweeper P1/P2:
Head: @clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
Setup inspection failures now use the three-state marker instead of authoritative empty capabilities, keeping tools off and reasoning heuristics.
Cover interactive setup when /api/show returns 500 for deepseek-r1.
…olve /models add dynamic path now builds failed-show definitions with tools off while preserving reasoning name heuristics.
…avior Mock builder matches production tools/reasoning contract for inspection failure.
|
Addressed latest ClawSweeper P1/P2 on tip
@clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
… failure Failed /api/show is an existence probe for unresolved models; return undefined so typos/404s stay rejected. Tag-discovered and setup paths keep showInspectionFailed tools-off behavior.
|
@clawsweeper re-review Rank-up P1 addressed on tip
|
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
Merge latest main into PR openclaw#109971 while retaining the audited Ollama repair and release note. Co-authored-by: zw-xysk <[email protected]>
* preserve/pr-109971-ollama-show-inspection-20260731: (4302 commits) fix(agents): resume interrupted turns past progress commentary (openclaw#116725) fix(gateway): sign device proofs with challenge time (openclaw#116679) fix(testing): load relay smoke through UI Vite config test(testing): guard realtime relay smoke module path fix(testing): repair realtime relay live smoke import test: type session request parameters (openclaw#116713) fix: retain event invalidation for pagination docs: note queued session refresh fix fix: preserve queued session refresh options fix(exec): require approval for abbreviated inline eval flags [AI] (openclaw#116529) fix: keep owner-only tools out of non-owner skill commands [AI] (openclaw#116532) fix(ui): bound Talk relay microphone uplink fix(tui): require a fresh agent roster (openclaw#116715) fix(memory-wiki): preserve user edits when rolling back ChatGPT imports (openclaw#116517) fix(agents): cron failures preserve timeout and cancellation reasons (openclaw#116566) fix(release): unblock beta validation workflows (openclaw#116708) fix(ci): discover frozen target startup benchmark cases (openclaw#116711) fix(session): preserve reset message payloads (openclaw#116195) fix(qa): tolerate loaded-runner bus delivery stalls (openclaw#116448) improve(ci): rebalance embedded agent test configs (openclaw#116436) ...
* origin/main: fix(edit): restore UTF-16 difference offsets fix(openai): share GPT-Live browser broker ownership fix(voice-call): cancel consults on bridge replacement fix(voice-call): recheck consult owner after await fix(voice-call): cancel pending replacement consults fix(voice-call): isolate replacement consult handoff test(voice-call): cover late forced consult teardown fix(voice-call): cancel forced consults on teardown fix(edit): prefer-for-of loop in firstDifferenceIndex fix(openai): return undefined from cleanup on non-disable reasons fix(openai): restrict GPT-Live broker cleanup to plugin disable only
|
@clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
|
The release-owned CHANGELOG edit has been removed. The prepared exact head retains the reviewed six-file Ollama fix; 146 focused tests, real @clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
|
Merged via squash.
|
* origin/main: (1976 commits) fix(ollama): models advertise tools when /api/show fails (openclaw#109971) fix(ollama): use CJK-aware char estimate for usage fallback (openclaw#110073) fix(ollama): release failed setup response bodies before returning (openclaw#111802) feat(plugins): externalize Synthetic provider (openclaw#116720) fix(agents): unblock channel turns after restart recovery (openclaw#116728) fix(telegram): keep typing alive during active steered tasks (openclaw#116721) fix(gateway): admit standalone MCP app work (openclaw#116727) fix(googlechat): record canonical receipt thread (openclaw#116717) test(ui): cover the Talk relay start-stop race fix(ui): close superseded Talk allocations fix(agents): resume interrupted turns past progress commentary (openclaw#116725) fix(gateway): sign device proofs with challenge time (openclaw#116679) fix(testing): load relay smoke through UI Vite config test(testing): guard realtime relay smoke module path fix(testing): repair realtime relay live smoke import test: type session request parameters (openclaw#116713) fix: retain event invalidation for pagination docs: note queued session refresh fix fix: preserve queued session refresh options fix(exec): require approval for abbreviated inline eval flags [AI] (openclaw#116529) ...
* commit 'refs/frozen/talk-pcm-output-main': (21 commits) fix(agents): compact session status change text (#116742) fix(llama-cpp): recover plaintext tool calls (#116736) fix(telegram): validate native queue arguments before fallback (#116726) chore(skills): add autonomous issue sweep workflow docs(auto-qa): require clean root-cause refactors fix(ollama): models advertise tools when /api/show fails (#109971) fix(ollama): use CJK-aware char estimate for usage fallback (#110073) fix(ollama): release failed setup response bodies before returning (#111802) feat(plugins): externalize Synthetic provider (#116720) fix(agents): unblock channel turns after restart recovery (#116728) fix(telegram): keep typing alive during active steered tasks (#116721) fix(gateway): admit standalone MCP app work (#116727) test(ui): cover the Talk relay start-stop race fix(ui): close superseded Talk allocations test(google): cover expired CLI OAuth compatibility docs(google): document supported auth paths fix(ui): clarify blocked inference setup fix(google): guide broken CLI profiles to supported auth fix(onboarding): hide unsupported Google CLI setup routes fix(google): retire Gemini CLI OAuth setup ...
* origin/main: (38 commits) fix(agents): compact session status change text (#116742) fix(llama-cpp): recover plaintext tool calls (#116736) fix(telegram): validate native queue arguments before fallback (#116726) chore(skills): add autonomous issue sweep workflow docs(auto-qa): require clean root-cause refactors fix(ollama): models advertise tools when /api/show fails (#109971) fix(ollama): use CJK-aware char estimate for usage fallback (#110073) fix(ollama): release failed setup response bodies before returning (#111802) feat(plugins): externalize Synthetic provider (#116720) fix(agents): unblock channel turns after restart recovery (#116728) fix(telegram): keep typing alive during active steered tasks (#116721) fix(gateway): admit standalone MCP app work (#116727) fix(googlechat): record canonical receipt thread (#116717) test(ui): cover the Talk relay start-stop race fix(ui): close superseded Talk allocations fix(agents): resume interrupted turns past progress commentary (#116725) fix(gateway): sign device proofs with challenge time (#116679) test(google): cover expired CLI OAuth compatibility fix(testing): load relay smoke through UI Vite config test(testing): guard realtime relay smoke module path ...
…9971) * fix(ollama): do not advertise tools when /api/show fails Failed show responses left capabilities undefined, which buildOllamaModelDefinition treats as optimistic supportsTools. Match setup inspect: return empty capabilities instead. * test(ollama): cover show-fail tools gate including L3 live HTTP Unit paths for HTTP error/throw plus real 127.0.0.1 server proving buildOllamaProvider keeps supportsTools false when /api/show 500s. * fix(ollama): keep reasoning heuristics when /api/show fails Distinguish failed inspection from authoritative empty capabilities so tools stay conservative without suppressing model-name reasoning. * test(ollama): cover three capability states for tools and reasoning Failed show keeps reasoning heuristics; authoritative [] disables both. * fix(ollama): propagate showInspectionFailed through setup configs Setup inspection failures now use the three-state marker instead of authoritative empty capabilities, keeping tools off and reasoning heuristics. * test(ollama): setup show-fail keeps tools off and reasoning heuristics Cover interactive setup when /api/show returns 500 for deepseek-r1. * fix(ollama): propagate showInspectionFailed through dynamic model resolve /models add dynamic path now builds failed-show definitions with tools off while preserving reasoning name heuristics. * test(ollama): dynamic resolve covers failed /api/show three-state behavior Mock builder matches production tools/reasoning contract for inspection failure. * fix(ollama): keep catalog-missing dynamic resolve fail-closed on show failure Failed /api/show is an existence probe for unresolved models; return undefined so typos/404s stay rejected. Tag-discovered and setup paths keep showInspectionFailed tools-off behavior. * chore(changelog): remove release-owned entry --------- Co-authored-by: Vincent Koc <[email protected]>
* commit 'refs/frozen/talk-pcm-output-main': (21 commits) fix(agents): compact session status change text (openclaw#116742) fix(llama-cpp): recover plaintext tool calls (openclaw#116736) fix(telegram): validate native queue arguments before fallback (openclaw#116726) chore(skills): add autonomous issue sweep workflow docs(auto-qa): require clean root-cause refactors fix(ollama): models advertise tools when /api/show fails (openclaw#109971) fix(ollama): use CJK-aware char estimate for usage fallback (openclaw#110073) fix(ollama): release failed setup response bodies before returning (openclaw#111802) feat(plugins): externalize Synthetic provider (openclaw#116720) fix(agents): unblock channel turns after restart recovery (openclaw#116728) fix(telegram): keep typing alive during active steered tasks (openclaw#116721) fix(gateway): admit standalone MCP app work (openclaw#116727) test(ui): cover the Talk relay start-stop race fix(ui): close superseded Talk allocations test(google): cover expired CLI OAuth compatibility docs(google): document supported auth paths fix(ui): clarify blocked inference setup fix(google): guide broken CLI profiles to supported auth fix(onboarding): hide unsupported Google CLI setup routes fix(google): retire Gemini CLI OAuth setup ...
* origin/main: (38 commits) fix(agents): compact session status change text (openclaw#116742) fix(llama-cpp): recover plaintext tool calls (openclaw#116736) fix(telegram): validate native queue arguments before fallback (openclaw#116726) chore(skills): add autonomous issue sweep workflow docs(auto-qa): require clean root-cause refactors fix(ollama): models advertise tools when /api/show fails (openclaw#109971) fix(ollama): use CJK-aware char estimate for usage fallback (openclaw#110073) fix(ollama): release failed setup response bodies before returning (openclaw#111802) feat(plugins): externalize Synthetic provider (openclaw#116720) fix(agents): unblock channel turns after restart recovery (openclaw#116728) fix(telegram): keep typing alive during active steered tasks (openclaw#116721) fix(gateway): admit standalone MCP app work (openclaw#116727) fix(googlechat): record canonical receipt thread (openclaw#116717) test(ui): cover the Talk relay start-stop race fix(ui): close superseded Talk allocations fix(agents): resume interrupted turns past progress commentary (openclaw#116725) fix(gateway): sign device proofs with challenge time (openclaw#116679) test(google): cover expired CLI OAuth compatibility fix(testing): load relay smoke through UI Vite config test(testing): guard realtime relay smoke module path ...
What Problem This Solves
Fixes an issue where users discovering local Ollama models would still see tool support advertised when
/api/showfailed (HTTP error or network throw), so a broken or uninspectable model looked tool-capable in catalog/setup paths.Why This Change Was Made
buildOllamaModelDefinitiontreats missingcapabilitiesas optimisticsupportsTools: true. Failed/api/showpreviously returned{}, which left capabilities undefined. This change marks failed inspection withshowInspectionFailed, keeping three states:capabilitiesomitted (uninspected / successful show without field) → optimistic tools + name heuristicscapabilities: string[](including[]) → authoritative show resultshowInspectionFailed→ tools conservative, reasoning name heuristics preservedThe failure marker is propagated through provider discovery, interactive setup config building, and the dynamic
/models addresolve path (there is nosrc/auto-reply/reply/models-add.tson current main; that sibling lives inextensions/ollama/index.ts).User Impact
Local Ollama models whose
/api/showfails no longer advertise tools across discovery, setup, and dynamic model resolve, while reasoning-named models still keep the established name heuristic during transient inspection failures. A successful show that reports an empty capabilities list remains authoritatively non-tool and non-reasoning.Evidence
buildOllamaProvider, setup config build, dynamic resolve127.0.0.1HTTP (/api/tags200,/api/show500) + undicifetch| Rank-up P1 fail-closed dynamic resolve |
resolveRequestedDynamicOllamaModelreturnsundefinedonshowInspectionFailed(typo/404/throw stay rejected); tag/setup keep tools-off marker | tip9d8f849ad9be|| Gate |
pnpm exec oxfmt --check+oxlint+vitest runonindex/setup/provider-modelstests → 126 passed | local |Scrapable L3 line:
Local gates:
Head:
9d8f849ad9bea52f0ff7f433fa4d50afc638d4da