Repository navigation
feat(subagents): read pi's model:level suffix for a run's thinking (#1188) - #1189
Merged
Merged
Conversation
…1188) A delegated run could pick its model but not its thinking level: the level came from the profile (or the parent), and `provider/model:high` failed with "Subagent model not found". pi's own `--model` reads that suffix as the model plus its level, and pi's subagent example passes a profile's model to `--model`, so the same reference already works there. - `parseSubagentModel` tries the whole reference first (an id such as `qwen3:8b` still matches), then a trailing valid thinking level; any other suffix is refused, as pi's strict `--model` parsing does. - A call's `model: "x:high"` sets that run's level over the profile's `thinking`; a call naming a model without a level keeps the profile's. Within a profile, `thinking:` beats a level on its own `model:`, like `--thinking` over `--model x:level`. No `thinking` parameter returns, so the guessing #1138 removed stays out. - The `Agent` description lists each profile's thinking beside its model, and the `model` parameter documents the suffix. - The Agents panel shows such a profile model as its base model with the reference as written, instead of "unavailable". Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Closes #1188.
Problem
A delegated run can pick its model (
Agent({ model })) but not its thinking level: the level comes from the profile, or from the parent when the profile sets none. Writingprovider/model:highfails withSubagent model not found.#1138 deliberately removed a per-call
thinkingparameter, because models filled it in by guesswork and silently overrode the profile. This PR does not bring that parameter back.Change
Model references now read the way pi's own
--modelreads them:provider/modelIdor a bare id, optionally followed by:<thinking level>. In pi this already works for a subagent profile'smodel:, since pi's subagent example passes it to--model.parseSubagentModel): the whole reference is tried first, so an id that contains a colon (qwen3:8b) still matches. Then a trailing valid level (off…max) is split off. Any other suffix is refused, as in pi's strict--modelparsing.model: "x:high"sets that run's level over the profile'sthinking. A call that names a model without a level keeps the profile'sthinking, as before. Within a profile,thinking:wins over a level on its ownmodel:, mirroring--thinkingover--model x:level. pi clamps the level to what the model supports.Thinking: <level>besideModel:, and themodelparameter documents the suffix. Resume still rejectsmodel, so a running child keeps its level.docs/agents/subagents.mdand the demo's capturedAgentschema are updated.Testing
AgentSessionwith the faux provider:thinking;tuned:high) matches whole;:turbois refused.Subagent model not found: faux/faux-model:high.profileModelBase(); the extension test pinsThinking:in the description.tsc --noEmit(root and demo), eslint, andnpm testall pass: 2624 pass, 1 skip, 0 fail.🤖 Generated with Claude Code