Skip to content

fix(models): accept models ollama can serve and refuse a denied sim-auto - #10341

Merged
waleedlatif1 merged 2 commits into
stagingfrom
fix/model-validation-gaps
Nov 23, 2026
Merged

waleedlatif1 merged 2 commits into
stagingfrom
fix/model-validation-gaps

Conversation

@waleedlatif1

Copy link
Copy Markdown
Collaborator

Summary

  • The editing validator rejected any model id outside the static catalog on the router, evaluator, translate and guardrails blocks. At runtime an id no provider claims runs on Ollama, so Copilot edits, the workflow-state API and workflow-as-code couldn't write a locally installed model (llama3.1:8b, user/model library names). Replacing a workflow that already used one failed outright
  • Where Ollama can serve a model (reachable: self-hosted, or OLLAMA_URL set; and not blacklisted), the validator now accepts an Ollama-shaped name that no provider claims, mirroring the runtime
  • Still rejected: ids a provider claims (incomplete namespaces like azure/, catalog-looking ids like claude-sonnet-4.6), free text, sim-auto where Auto isn't offered, and everything on hosted Sim without Ollama
  • Trade-off: the server can't list what an Ollama server has installed, so on self-hosted a mistyped Ollama-shaped name now fails at execution instead of at edit time. The agent block already works this way
  • One isOllamaReachable helper now answers "can this deployment reach Ollama" for the chat and embedding model lists, the embedding client and the access-request catalog, which each restated it. isOllamaAvailable adds the blacklist on top
  • resolveAutoModel now checks the configured sim-auto against the workspace's permission group before routing. A group that denied sim-auto still ran it as whichever pool or default model it allowed. The editor already hid Auto for such a group; execution now refuses it like any other denied model

Type of Change

  • Bug fix

Testing

  • validation-models.test.ts runs the real blocks through the real validator. It covers installed and namespaced Ollama names accepted where Ollama is reachable, and rejected on hosted without Ollama, when blacklisted, for provider-claimed ids and for free text. sim-auto stays rejected on self-hosted
  • resolve.test.ts: a denied sim-auto is refused on hosted and self-hosted without calling the router; a pool denied model by model still falls back
  • urls.test.ts covers isOllamaAvailable across self-hosted, hosted with and without OLLAMA_URL, and blacklisted
  • Each new test fails on the previous code
  • tsc --noEmit and bun run lint clean; vitest across workflows, core, model router, embeddings, API routes, ee, knowledge, blocks, providers and executor pass
  • Reviewed with an independent correctness and simplification pass

Checklist

  • Code follows project style guidelines
  • Self-reviewed my changes
  • Tests added/updated and passing
  • No new warnings introduced
  • I confirm that I have read and agree to the terms outlined in the Contributor License Agreement (CLA)

The editing validator rejected any model id outside the static catalog on the
router, evaluator, translate and guardrails blocks. At runtime an id that no
provider claims runs on Ollama, so a locally installed model (llama3.1:8b,
user/model library names) could not be written by an edit, the workflow-state
API or workflow-as-code, and replacing a workflow that already used one
failed outright. Where Ollama can serve a model (reachable and not
blacklisted), the validator now accepts an Ollama-shaped name that no
provider claims, mirroring the runtime. Ids a provider claims, free text,
and sim-auto are still rejected.

Whether this deployment can reach Ollama is now one helper,
isOllamaReachable, used by the chat and embedding model lists, the embedding
client and the access-request catalog, which each restated it.

resolveAutoModel now checks the configured sim-auto against the workspace's
permission group before routing. A group that denied sim-auto still ran it as
whichever pool or default model it allowed; the editor already hid Auto for
such a group, and execution now refuses it the same way it refuses any other
denied model.
@vercel

vercel Bot commented Nov 23, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Actions Updated
docs Skipped Skipped Nov 23, 2026 6:50pm UTC

Request Review

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No issues found across 12 files

Confidence score: 5/5

  • Automated review surfaced no issues in the provided summaries.
  • No files require special attention.

Turn on auto-fix | Re-trigger cubic

@greptile-apps

greptile-apps Bot commented Nov 23, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerView in GreptileConfidence Score: 5/5

[Medium impact] The PR appears safe to merge; no new actionable issues were found.

Summary

The PR accepts Ollama-shaped model names where Ollama is available and checks access to sim-auto before routing.

  • Workflow blocks accept local Ollama model names when Ollama is available.
  • Ollama model lists and embedding paths use shared availability checks.
  • Auto routing stops when a workspace denies sim-auto.

Reviews (2) · Last reviewed commit: "fix(models): keep the ollama url check p..." · Reviewed by Greptile

Comment thread apps/sim/lib/core/utils/urls.test.ts Resolved
@waleedlatif1

Copy link
Copy Markdown
Collaborator Author

@greptile

@waleedlatif1

Copy link
Copy Markdown
Collaborator Author

@cubic-dev-ai review this PR

@cubic-dev-ai

cubic-dev-ai Bot commented Nov 23, 2026

Copy link
Copy Markdown
Contributor

@cubic-dev-ai review this PR

@waleedlatif1 I have started the AI code review. It will take a few minutes to complete.

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No issues found across 14 files

Confidence score: 5/5

  • Automated review surfaced no issues in the provided summaries.
  • No files require special attention.

Turn on auto-fix | Re-trigger cubic

@waleedlatif1
waleedlatif1 merged commit 4c7ad8c into staging Nov 23, 2026
84 checks passed
@waleedlatif1
waleedlatif1 deleted the fix/model-validation-gaps branch November 23, 2026 19:03

This branch was previously deployed

1 inactive deployment
Preview — b05cf77d Deployed Nov 23, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant