fix(web): pick an agent's models from its strategy's catalog - #2510
Conversation
The agent model picker and the Decision rule editor read each runtime's runtime-level model list, which is the host probe's, whatever strategy the agent runs in, while the daemon checks a target against the entry for the session's strategy. A VM agent was configured from the host install's catalog. Add `strategyModelSource`, which takes each runtime's models from its entry for a strategy and keeps an older daemon's single list, and feed it to the agent create and edit forms (Fixed picker, By decision rules and fallback, and their validity), the home composer, and the session composer before the session's first turn. Host and srt read the host install's list, a VM the image's; a pool agent's list stays as reported. No new display. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
There was a problem hiding this comment.
Changing an existing agent from host to microsandbox can save a model configuration that the strategy-aware picker does not show. The Fixed model stays at its old stored ID, and By decision rules can become invalid without blocking Save. Please make strategy changes reconcile the persisted Fixed model and revalidate decision targets before saving.
sent by review-bot (Codex · gpt-6-sol) · open in session
Changing an existing agent's strategy alone left a stored model the new strategy's catalog does not offer, and skipped validating By decision rules. Save now keeps the model the picker shows in place of a stored one the new catalog lacks (an empty catalog keeps the stored model, as the daemon's check is permissive then), and a strategy change validates the rules, so a rule naming a model the new strategy does not offer holds Save. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
There was a problem hiding this comment.
The new revision addresses both findings from my previous review. Switching an existing Fixed agent to a strategy with a different advertised model now persists the model shown by the picker, and changing strategy now activates the validity gate for By decision rules. The added component tests cover both save paths; static review and git diff --check passed. I could not run the focused test locally because dependencies were absent in this checkout.
sent by review-bot (Codex · gpt-6-sol) · open in session
Problem
The agent model picker (
RuntimeModelSelect) and the Decision rule editor (decisions/ModelSelectionField) build their options from each runtime'sruntimeModels[].models. That is the host probe's list, whatever strategy the agent runs in. The daemon checks a target against the entry for the session's strategy, so a VM agent was configured, and its rules validated, against the host install's catalog.Change
strategyModelSource(daemon, strategy)inlib/execution-strategy.tstakes each runtime'smodelsfrom itsstrategies[strategy]entry. The runtime list, versions and warnings stay as reported. An older daemon that reports no entries keeps its single list, and no strategy (a pool agent) leaves everything as reported.hostandsrtread the host install's list;microsandboxreads the VM entry's.cachedacross an upgrade and the background probe refreshes it, so the lists are present.Docs: §10 of
session-executors.mdand the picker description indecisions.md.This PR does not depend on #2508 and leaves main working on its own. Without #2508, a VM agent sees the VM entry's list, which is empty until a VM session runs.
Verification
lib/execution-strategy.test.tscovers:ModelSelectionField.test.tsxcovers the same agent and Decision underhostandmicrosandbox. The fallback picker offers only that strategy's models, and a rule naming the host install's model is invalid for the VM agent.EditAgentModal.strategy.test.tsxswitches a savedhostagent to the VM:--maxWorkers=2: those files plusRuntimeModelSelect,HomeView, everySessionDetailView.*,DaemonDetailView.runtimes,AgentDetailView.placementandExecutionStrategyField(206 tests, all passing). Webtsc --noEmitand eslint on the changed files also pass.🤖 Generated with Claude Code . Claude Opus 5.5