feat(agent): select Subagent models per Task - #25
Open
jiangnan-ten wants to merge 1 commit into
Open
Conversation
Expose canonical BYOK model IDs to Task calls and fail closed when a requested model cannot run. Preserve complete tool lifecycles so rejected or failed Subagents do not corrupt resumes or cancel successful siblings.
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.
Why
Cursor++ currently ignores the
modelvalue from Task and Subagent calls. A child agent therefore inherits the parent model or an Explore Settings override, even when the parent selected another provider.This change exposes the configured canonical BYOK model IDs to Task calls and validates the selected ID before Cursor starts the child agent. Invalid selections fail visibly instead of running a different model.
Scope
ProviderModel.idvalues to the Anthropic, OpenAI, Gemini, and cursor-namespace Task schemas.explicit > Settings > parentprecedence.supportsAgent=falsemodels.providers.jsonthinking defaults. Task does not expose per-call thinking parameters.fastandattachmentsTask schema options.Ordinary resume calls reject an explicit model because the current client path does not prove that an existing composer switches models.
resume=selfremains a new fork and accepts a model.Tradeoffs
The Task schema exposes internal canonical model IDs instead of accepting display names or API model names. The IDs are less readable, but exact IDs avoid ambiguous aliases and prevent silent routing to the wrong provider.
When no eligible model exists, Cursor++ removes Task from the run instead of publishing an empty model enum.
Blast Radius
The change affects Agent Task and Subagent dispatch, model metadata on
ProviderRuntime, and Task result persistence. Other Agent tools and normal Composer model selection keep their existing behavior.The main risk is Cursor client compatibility with the generated Task schema. A local VSIX built from this commit was installed and validated in Cursor before opening this PR.
Verification
pnpm run check-types: passed.pnpm run lint: passed.pnpm run test:server: 39 test files and 378 tests passed.git diff --check: passed.dist/extension.jsfiles had the same SHA-256 hash.