Skip to content

feat(platform): pin automation agent node models to a provider - #3056

Merged
larryro merged 1 commit into
mainfrom
feat/automation-agent-model-pin
Aug 24, 2026
Merged

larryro merged 1 commit into
mainfrom
feat/automation-agent-model-pin

Conversation

@larryro

@larryro larryro commented Aug 24, 2026

Copy link
Copy Markdown
Contributor

Problem

An automation agent node stores only a bare model string, and resolveWorkflowAgentServing walks connectors direct-pass-first. An org holding an Anthropic subscription credential plus an OpenRouter BYO key therefore had claude-fable-5 served — and billed — by OpenRouter (modelIdsEquivalent matches anthropic/claude-fable-5 to the bare id, and a subscription default is invisible to the direct pass). Seen live on demo: the triage-glitchtip run failed with OpenRouter 402 while the Anthropic subscription sat unused. The task lane closed this exact hole in #2959 with a provider pin; the automation lane had no pin and no picker — the Model field was a free-text input.

What ships

Editor. The agent node's Model field becomes the project-agent (provider, model) SearchableSelect: one option per pair with the provider named under each entry (… · Subscription for subscription-served copies), search, and index-keyed values. The pick stores model + modelProvider on the node. Subscription entries are offered only for the node's effective harness (host default claude-code when unset), a harness switch that invalidates the pick clears it, and a saved model no listing offers is called out under the picker (editor.agent.modelUnlisted, en/de/fr). The option-mapping and selected-match helpers moved to app/features/projects/lib/model-options.ts, shared with the project-agent dialog.

Grammar. agent nodes gain optional modelProvider (engine slots.ts/types.ts, builder docs + catalog). Legacy nodes without it validate and run unchanged.

Serving. The pinned split is extracted from task_serving.ts into the shared resolvePinnedAgentServing (lib/providers/agent_serving.ts): the pinned provider's default credential shape decides the lane, and a pin that cannot serve throws — never a silent fallback to another provider. resolveWorkflowAgentServing delegates to it when the node carries a pin; unpinned nodes keep the two-pass walk byte-for-byte. resolveTaskServing now delegates its pinned arm to the same implementation (its suite is green unchanged except the one test that asserted the old llm_call delegation seam), and llm_call.resolveServingTarget returns to an unpinned, direct-only door. Kick, answered-ask resume, and the in-node auto-retry all carry the pin.

Verification

  • agent_serving.test.ts: new pinned suite — pinned subscription wins over a live direct connector, pinned direct serves in catalog spelling, refused pin throws instead of falling back, unconfigured/inactive/catalog-miss errors name the pin.
  • stepper.test.ts: a published pinned node carries modelProvider into the kick request through the real save→load→step path.
  • Suites: tasks+automations 768, providers/engine/i18n 637, @tale/ui i18n 1173 — all green; tsc green; oxlint 1.79 clean.
  • Live on the dev stack: the triage-glitchtip agent node shows anthropic/claude-fable-5 — OpenRouter and claude-fable-5 — Anthropic · Subscription side by side; picking the subscription copy saved v3 through server-side validation; switching harness to Codex cleared the invalidated pick; Discard restored it from the stored version.

The agent node's Model field becomes the project-agent (provider, model)
picker: the pick stores the pair, subscription-served entries gate on the
node's effective harness, and a harness switch clears an invalidated pick.
A saved model no listing offers is called out under the picker.

resolveWorkflowAgentServing honors the pin fail-closed through the shared
resolvePinnedAgentServing, extracted from the task lane's split so the two
lanes cannot drift; llm_call returns to an unpinned direct-only door. A
pinned Anthropic subscription model can no longer be stolen by another
connector's direct key in the walk's first pass. Unpinned nodes keep the
two-pass walk byte-for-byte, and kick, answered-ask resume, and in-node
retry all carry the pin.
@larryro
larryro merged commit e3278ed into main Aug 24, 2026
51 checks passed
@larryro
larryro deleted the feat/automation-agent-model-pin branch August 24, 2026 11:27
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