feat: add variant support for subagents (#7138) [alt of #7140] #7156
+51
−18
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
Complete implementation for #7138 (agent-level default variant support) with TUI and desktop support.
Adds
variantfield to agent config, allowing users to set a default variant per agent:Priority order: user
--variantselection > agent config > noneComparison with PR #7140
Both PRs implement the same core feature. This PR adds:
undefinedwhen agent default usedKey differences
1. Desktop support (this PR only)
packages/app/src/context/local.tsx: Addedeffective()methodpackages/app/src/components/prompt-input.tsx: Useseffective()for display and API calls, shows variant in agent selector2. prompt.ts change (this PR only)
Stores the resolved variant in message metadata:
Without this, inspecting message history shows
variant: undefinedwhen the agent's default variant was actually used.Changes
Backend
variantfield to agent config schema (config.ts,agent.ts)llm.ts:input.user.variant ?? input.agent.variantprompt.ts)task.ts)TUI
effective()method tolocal.tsxprompt/index.tsx)dialog-agent.tsx)Desktop
effective()method tolocal.tsxprompt-input.tsx)prompt-input.tsx)SDK
types.gen.tsandopenapi.jsonExamples
variant: "high"totriage.mdandduplicate-pr.mdCloses #7138