feat(models): Ollama capabilities catalog + chat Thinking chip - #1152
Open
Sdaswani wants to merge 7 commits into
Open
feat(models): Ollama capabilities catalog + chat Thinking chip#1152Sdaswani wants to merge 7 commits into
Sdaswani wants to merge 7 commits into
Conversation
Co-authored-by: Cursor <cursoragent@cursor.com>
Zod-validate /api/tags at the network boundary, replace the startWithReasoning cast with withThinkingDisabledForSend, drop redundant TooltipProvider nesting, and document the Ollama URL probe heuristic trade-off. Co-authored-by: Cursor <cursoragent@cursor.com>
Cover /api/tags soft-fail → /v1/models, expose Thinking/tools/context on edit, and lock Thinking chip + reasoningEffort provider options in unit tests. Co-authored-by: Cursor <cursoragent@cursor.com>
…se, DRY schema Inline reasoning-off flag, wire ollamaTagsResponseSchema into the fetch path, remove unused model_info helper, drop as-never test casts, and spread ResolvedPiModel consistently in withThinkingSessionOverride. Co-authored-by: Cursor <cursoragent@cursor.com>
Sdaswani
temporarily deployed
to
fork-preview-approval
July 29, 2026 02:36 — with
GitHub Actions
Inactive
Co-authored-by: Cursor <cursoragent@cursor.com>
|
Preview environment deployed 🚀
Stack: Auto-destroys on PR close/merge. Login via the bundled Keycloak realm — |
Sdaswani
temporarily deployed
to
fork-preview-approval
July 29, 2026 02:42 — with
GitHub Actions
Inactive
- model.startWithReasoning means show/enable thinking; middleware startWithReasoning means treat content as reasoning until </think> - Ollama thinking models emit a native reasoning field and plain answer content with no closing tag, so wiring the chip flag through left the spinner stuck with the reply in the muted Thinking pane - show a Thinking label while streaming with no active tool Co-authored-by: Cursor <cursoragent@cursor.com>
Sdaswani
temporarily deployed
to
fork-preview-approval
July 29, 2026 04:52 — with
GitHub Actions
Inactive
5 tasks
Sdaswani
temporarily deployed
to
fork-preview-approval
July 30, 2026 01:34 — with
GitHub Actions
Inactive
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
11434or hostname containsollama), prefer nativeGET /api/tagsso tools / thinking / vision / context window prefills are richer than sparse/v1/models./v1/modelsso non-Ollama custom endpoints keep working.toolUsage,startWithReasoning,contextWindow) on create and edit, show them on model detail, and add a per-conversation Thinking chip in the composer for models withstartWithReasoning === 1.startWithReasoningview +reasoningEffort: 'none'for OpenAI-compat / Ollama, and PithinkingLevel: 'off'in the built-in adapter).Durable contract is the model row + session override — not “we are permanently bound to Ollama.” Autodetection is opportunistic.
Heuristic / failover notes
isLikelyOllamaBaseUrl— intentional incomplete match so llama.cpp / corporate OpenAI-compat URLs are not hit with an extra failed/api/tags.ollamain the host still works via/v1/models(no rich caps)./api/tagsbody is zod-validated (ollamaTagsResponseSchemaenvelope + per-tagollamaTagModelSchema); malformed tags are skipped; empty/invalid → soft-fail.Test plan
ollama-catalogorigin/heuristic/mapping/schemafetchModelsForProviderprefers/api/tags; fails over on throw and non-Ollama bodythinking-sessionhelpers +openaiCompatThinkingProviderOptionswithThinkingSessionOverride(ACP / Pi path)ThinkingChipa11y pressed/togglehttp://localhost:11434/v1→ catalog shows tools/thinking/context; create model; chip appears in chat/api/tagsprobe failure in UX;/v1/modelspath worksthinkingEnableddoes not leak (reset on model switch)Reviewer notes
Addressed prior review:
REASONING_OFF(inlined0)contextLengthFromModelInfo; wiredollamaTagsResponseSchemainto the fetch path (envelope staysunknown[]for per-tag skip)as nevercasts onstubJsonResponsemocksResolvedPiModelconsistently in bothwithThinkingSessionOverridebranchesMade with Cursor