Repository navigation
fix(models): stop resolving sim-auto to ollama outside the model router - #10332
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
There was a problem hiding this comment.
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
[Medium impact] The PR appears safe to merge; no new actionable issues remain. SummaryThis PR stops treating
No new actionable issues were found. Tests were inspected, not run.
|
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.
1ae4726 to
c38023b
Compare
|
@cubic-dev-ai review this PR |
@waleedlatif1 I have started the AI code review. It will take a few minutes to complete. |
Summary
sim-autois a hosted-only pseudo-model that the model router resolves at execution time. Before that it has no provider, butgetProviderFromModelansweredollamafor it. So:sim-autoto Ollama;getProviderFromModel(providers/utils) now throws an explicit error forsim-autoinstead of guessingresolveModelProviderId, which treats an unset, reference orsim-automodel 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 editorgetModelOptions(translate, guardrails, Pi, model fallbacks) no longer includes it; router and evaluator usegetModelOptionsWithAutoMODEL_OPTION_SOURCES. It acceptssim-autoonly 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 beforeassertModelAllowedskips the provider allowlist forsim-autobut still appliesdeniedModels. The router re-checks every concrete candidate it pickssim-autousage gets its own "Auto" row and icon in both the model and BYOK dimensions; every other model resolves its provider as beforeDEFAULT_BLOCK_MODELconstant now backs the executor defaults, the block default values and thesim-autofallback, which were separate literalssim-autoType of Change
Testing
validation-models.test.tsruns 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 thatsim-autois accepted only where Auto is offeredtsc --noEmitandbun run lintclean; vitest across blocks, providers, executor, workflows editing/application, guardrails, billing, access control and the editor sub-blocks pass;bun run generateproduced no drift;check:auditspasses/simplifyplus a separate regression review of the validation and option-list changesChecklist