Skip to content

feat(platform): give automations a model the organization serves - #4761

Merged
yannickmonney merged 7 commits into
mainfrom
feat/automation-pack-models
Oct 10, 2026
Merged

yannickmonney merged 7 commits into
mainfrom
feat/automation-pack-models

Conversation

@yannickmonney

Copy link
Copy Markdown
Contributor

Every shipped automation pack names anthropic/claude-haiku-4-5 in its llm steps. An organization whose providers don't serve it got packs whose model steps failed on their first live run. This adds two remedies.

1. Packs are given a model the organization serves

When provisioning adds a pack, each llm step whose model no direct provider of the organization serves gets the model the chat's Auto picks for that model's band. Haiku is draft. The pick comes from the models the organization serves directly (an API key or the deployment's environment, as a run serves an llm step) and lets every member use. Version 1's message says what happened, e.g. "Shipped default pack. Model anthropic/claude-haiku-4-5 isn't served here; using gpt-5-mini."

  • A model is replaced only when the run's own serving walk (walkLlmServing, now shared as walkLlmServingForOrganization) says nobody serves it.
  • An unreadable catalog, a slow walk (5 s budget) or any failure keeps the declared model.
  • Agent steps and templated models are left alone.
  • An organization's existing packs are never changed (PROVN-R8).

Where it applies: provider credentials only exist once an admin connects one. A new organization's packs are therefore always added before any provider, and keep Haiku. The replacement applies to packs a later release adds, and to templates (the gallery slice will call the same pure picker, lib/automations/model-defaults.ts). For new organizations, the existing LLM_MODEL_UNAVAILABLE warning plus the new Change model action is the fix. The docs say so.

2. Change model in the editor

A Change model action in the editor header, shown to authors when an llm step names a model, opens one dialog:

  • the model to replace, each with its count of steps;
  • the model to use instead, from the ones the organization's providers serve;
  • the steps that change.

Applying it is a draft edit like any other, so Save and Discard keep it reviewable. The llm Model field's option list moved into useLlmModelOptions, which the dialog shares.

Diverges from the design (p9-design §7)

  • Bands: the code's chat bands are draft | standard | frontier, not light/standard/deep.
  • No modelBand field yet: nothing ships one. The pure picker takes an optional band, so templates can add the field where they need it.
  • model only: llm nodes have no modelProvider field; the run resolves the provider itself.
  • Governance: the audience is the organization's members as a whole (no person exists at provisioning). New: getAccessibleModelsForMembers, and listOrganizationChatModels for the composer walk without a person.
  • English message: the version message is English, like the existing "Shipped default pack"; version messages have no i18n layer.

Verified

  • Unit/UI tests:
    • picker: 12;
    • resolver: 6 (served, unserved, unreachable, failing walk, budget, nothing direct);
    • provisioning seed: 12;
    • governance: 7;
    • dialog: 3;
    • editor: 94, including the swap through Save and the button's absence.
  • Live, against the capture stack's real mock catalog:
    • resolveModelReplacements kept anthropic/claude-haiku-4-5 and anthropic/claude-sonnet-4.6, which the catalog serves (Haiku is listed as claude-haiku-4.5);
    • it replaced the unserved gpt-4.1-mini with anthropic/claude-haiku-4.5, in the provider's spelling;
    • run outside the checkout, every lookup failed and every model was kept, with a warning.
  • In a real browser:
    • Change model opens from the keyboard;
    • Escape returns focus to the button;
    • applying moved both Gmail triage steps to Claude Sonnet 4.6 (canvas, draft dot, Save/Discard armed, no problems);
    • Discard disarmed Save.
  • Docs: built-in packages and editor pages (en/de/fr), plus a screenshot of the dialog.
  • Manual: box AUTO-F134 for the dialog; the seeding behaviour is listed as unit-owned in the manual reference.

The validator's model check walked an llm step's serving through a
shim built inline in dispatch-store, under a private budget helper.
walkLlmServingForOrganization and withinBudget now live in their own
modules, so a second asker (the model a shipped pack is given) asks the
same question under the same budget. No behaviour change.
Every shipped pack's llm steps name anthropic/claude-haiku-4-5, so an
organization whose providers do not serve it got packs whose model steps
failed on their first live run. Seeding now gives such a step the model
the chat's Auto picks for its band (haiku is draft) among the models the
organization serves directly and lets every member use, and the first
version says so: "Model anthropic/claude-haiku-4-5 isn't served here;
using gpt-5-mini."

- A model is replaced only when the run's own serving walk says nobody
  serves it; an unreadable catalog, a slow walk or any failure keeps it.
- Only literal llm models; agent steps and templated models are left.
- An organization's existing packs are never changed (PROVN-R8).
- Pure picker in lib/automations/model-defaults.ts (an optional band
  for templates later); getAccessibleModelsForMembers for the members'
  audience; listOrganizationChatModels for the composer walk with no
  person.
A "Change model" action in the editor's header (for authors, when an llm
step names a model) opens one dialog: the model to replace (each with its
count of steps), the model to use instead from the ones the
organization's providers serve, and the steps that change. Applying it
is a draft edit like any other, so Save and Discard keep it reviewable.

The llm Model field's option list moves into useLlmModelOptions, which
the dialog shares. Agent steps and templated models are left alone.
The built-in packages page says what Tale does when no provider serves
a package's model, and that Change model swaps one in every step; the
editor page describes the Change model action beside the Model picker.
en/de/fr.
AUTO-F134: an organization created with only a provider that does not
serve Haiku gets packs on a served model, and version 1 says which.
AUTO-F135: the Change model dialog lists the steps, swaps the model as a
draft, and Discard brings it back.
Provider credentials only exist once an admin connects one, so a new
organization's packs are always added before any provider: the seeding
case cannot be set up by hand. The behaviour is unit-owned (listed in
the reference map); the Change model dialog keeps its box, now
AUTO-F134. The built-in packages page says a new organization's
packages are that case.
A shot of the Use another model in all steps dialog on the Gmail inbox
triage (its two language model steps on Claude Haiku, Claude Sonnet 4.6
picked), framed beside the Model picker in the editor docs, en/de/fr.
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