Skip to content

fix(models): stop resolving sim-auto to ollama outside the model router - #10332

Merged
waleedlatif1 merged 2 commits into
stagingfrom
fix/sim-auto-provider-lookups
Nov 23, 2026
Merged

waleedlatif1 merged 2 commits into
stagingfrom
fix/sim-auto-provider-lookups

Conversation

@waleedlatif1

Copy link
Copy Markdown
Collaborator

Summary

  • sim-auto is a hosted-only pseudo-model that the model router resolves at execution time. Before that it has no provider, but getProviderFromModel answered ollama for it. So:
    • translate and guardrails, which offered Auto but never resolve it, sent sim-auto to Ollama;
    • the provider-allowlist permission check refused it;
    • editor components and the billing breakdown labelled it Ollama.
  • getProviderFromModel (providers/utils) now throws an explicit error for sim-auto instead of guessing
  • Display and serialization callers share resolveModelProviderId, which treats an unset, reference or sim-auto model as the default block model. It replaces the agent block's own copy and fixes the file-upload, tool-usage-control and API-key-reset paths in the editor
  • Auto is offered only by the agent, router and evaluator. getModelOptions (translate, guardrails, Pi, model fallbacks) no longer includes it; router and evaluator use getModelOptionsWithAuto
  • Editing validation looks a model field's options up in MODEL_OPTION_SOURCES. It accepts sim-auto only where that source offers Auto (hosted), and passes references and {{ENV}} values through, which router and evaluator used to reject. The agent's model field stays unvalidated, as before
  • assertModelAllowed skips the provider allowlist for sim-auto but still applies deniedModels. The router re-checks every concrete candidate it picks
  • Billing usage breakdown: sim-auto usage gets its own "Auto" row and icon in both the model and BYOK dimensions; every other model resolves its provider as before
  • One DEFAULT_BLOCK_MODEL constant now backs the executor defaults, the block default values and the sim-auto fallback, which were separate literals
  • The guardrails Vertex credential check skips the provider lookup for sim-auto

Type of Change

  • Bug fix

Testing

  • New validation-models.test.ts runs the real agent, router, evaluator, translate and guardrails blocks through the real validator. It checks that agent values (<start.model>, {{MODEL_ID}}, bare Ollama names, fine-tune ids, sim-auto) pass through unchanged, that references are accepted on router and evaluator, and that sim-auto is accepted only where Auto is offered
  • New tests cover the explicit throw, the option split, the permission check, the billing breakdown, translate/guardrails failing loudly instead of calling a provider, and the guardrails Vertex check. Each was checked against the code without its guard
  • tsc --noEmit and bun run lint clean; vitest across blocks, providers, executor, workflows editing/application, guardrails, billing, access control and the editor sub-blocks pass; bun run generate produced no drift; check:audits passes
  • Reviewed with /simplify plus a separate regression review of the validation and option-list changes

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)

@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 11:56am 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.

All reported issues were addressed across 29 files

This PR changes authentication, authorization, or input validation. Ultrareviews find 2.4x more serious bugs than standard reviews. Comment @cubic-dev-ai ultrareview to run one.

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 remain.

Summary

This PR stops treating sim-auto as an Ollama model.

  • Provider lookup stops treating Auto as an Ollama model.
  • Model menus show Auto only on blocks that can route it.
  • Editor controls use a shared default when Auto has no provider.
  • Usage breakdowns show Auto separately from Ollama.

No new actionable issues were found. Tests were inspected, not run.

Diagram

%%{init: {'theme': 'neutral'}}%%
flowchart LR
  A[Configured model] --> B{Auto?}
  B -->|Yes| C[Model router]
  B -->|No| D[Concrete model]
  C --> D
  D --> E[Check model permissions]
  E --> F[Look up provider]
  F --> G[Call provider]
Loading

Reviews (2) · Last reviewed commit: "fix(models): keep the configured provide..." · Reviewed by Greptile

sim-auto is a pseudo-model that only the agent, router and evaluator
handlers resolve, through the model router, at execution time. Every
other provider lookup fell through to getProviderFromModel's unknown-model
default and treated it as an Ollama model:

- translate and guardrails offered Auto but never resolve it, so a run sent
  model sim-auto to provider ollama (or a provider allowlist refused it as
  ollama); editing validation accepted it there and the catalog advertised it
- assertModelAllowed refused sim-auto as provider ollama under
  allowedModelProviders, while the client gate allowed it
- the usage breakdown gave sim-auto rows the Ollama mark and merged BYOK
  sim-auto usage into the Ollama row
- the editor's API-key reset, tool-usage control and attachment cap looked
  up ollama for it (hiding the tool-usage control for Auto), and the first
  two threw uncaught on a blacklisted model
- getPiModelOptions and the router/evaluator serialization looked it up on
  every call, logging a provider warning each time

Now:

- getProviderFromModel throws an explicit error for sim-auto instead of
  answering ollama; the guardrails Vertex-credential check skips sim-auto
  so it cannot reach that throw
- DEFAULT_BLOCK_MODEL (providers/default-model.ts, dependency-free) is the
  one source for the agent/router/evaluator default and the executor's
  DEFAULT_MODELs, which are what sim-auto falls back to
- getSerializedModelProviderId becomes resolveModelProviderId: an unset,
  reference or sim-auto model answers as DEFAULT_BLOCK_MODEL, and it still
  never throws. The agent block (dropping its own special case) and the
  three editor call sites use it, so they no longer throw
- getModelOptions no longer includes Auto; getModelOptionsWithAuto (router,
  evaluator) and getAgentModelOptions do. Editing validation reads one
  declarative MODEL_OPTION_SOURCES map instead of comparing option
  functions: only getModelOptions and getModelOptionsWithAuto fields are
  checked against the catalog, sim-auto is accepted only where the source
  offers Auto on hosted Sim, and a reference or {{ENV_VAR}} value is passed
  through (router and evaluator used to reject them). The agent's model
  field stays unvalidated, as before
- assertModelAllowed skips the provider allowlist for sim-auto (the router
  gates each pool candidate) but still applies deniedModels
- the usage breakdown attributes sim-auto to its own key, labelled Auto, in
  the model and BYOK dimensions; every other model is attributed as before
…odel

The API-key reset and the attachment cap now read the provider a model value
names as written. The serialization helper substitutes the default model for
a reference or sim-auto, which dropped a reference's explicit namespace (so
switching between models of that provider cleared the key) and gave sim-auto
the default model's larger attachment cap, although Auto can route images to
an inline-only provider. sim-auto and blacklisted models name no provider, so
the key comparison treats them as their own value and the cap stays at the
field's own size.
@waleedlatif1
waleedlatif1 force-pushed the fix/sim-auto-provider-lookups branch from 1ae4726 to c38023b Compare November 23, 2026 11:56
@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 29 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 5860704 into staging Nov 23, 2026
84 checks passed
@waleedlatif1
waleedlatif1 deleted the fix/sim-auto-provider-lookups branch November 23, 2026 12:08

This branch was previously deployed

1 inactive deployment
Preview — c38023bc 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