Skip to content

feat(task-tool): Add model parameter for subagent LLM routing#25881

Closed
ziuus wants to merge 1 commit intoanomalyco:devfrom
ziuus:feature/task-model-parameter
Closed

feat(task-tool): Add model parameter for subagent LLM routing#25881
ziuus wants to merge 1 commit intoanomalyco:devfrom
ziuus:feature/task-model-parameter

Conversation

@ziuus
Copy link
Copy Markdown

@ziuus ziuus commented May 5, 2026

Summary

  • Add optional model parameter to Task tool for specifying which LLM subagents should use
  • Support both modelID and providerID/modelID formats
  • Model parameter overrides agent default and parent message model
  • Enables routing tasks to specialized LLMs (vision models, research-optimized models, etc.)

Changes

  • task.ts: Added model to Parameters schema, implemented model selection logic (params.model > agent.default > parent message)
  • task.txt: Updated documentation with new parameter and usage examples
  • task.test.ts: Added 3 test cases for model parameter handling

Use Cases

// Vision model for image analysis
Task(description="Analyze screenshot", prompt="...", subagent_type="general", model="gpt-4-vision-preview")

// Research-optimized model
Task(description="Research topic", prompt="...", subagent_type="general", model="openai/gpt-4-turbo")

// Cost-efficient model for simple tasks
Task(description="Batch process", prompt="...", subagent_type="general", model="llama-3.1-8b")

Testing

  • Added tests for model parameter parsing (with and without provider prefix)
  • Test for fallback behavior when model not specified
  • All existing tests continue to pass

Breaking Changes

None - model parameter is optional and backward compatible.

Closes #ZZZ (feature request for subagent model routing)

- Add optional 'model' parameter to Task tool parameters
- Support both 'modelID' and 'providerID/modelID' formats
- Model parameter overrides agent default and parent message model
- Update task.txt documentation with new parameter
- Add tests for model parameter handling
- Enables routing subagent tasks to specialized LLMs (vision, research, etc.)

Closes feature request for subagent model selection
@github-actions github-actions Bot added the needs:compliance This means the issue will auto-close after 2 hours. label May 5, 2026
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 5, 2026

This PR doesn't fully meet our contributing guidelines and PR template.

What needs to be fixed:

  • PR description is missing required template sections. Please use the PR template.

Please edit this PR description to address the above within 2 hours, or it will be automatically closed.

If you believe this was flagged incorrectly, please let a maintainer know.

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 5, 2026

The following comment was made by an LLM, it may be inaccurate:

Potential Duplicate PRs Found

Based on the search results, there are several related PRs that address similar functionality:

  1. PR feat(task): add model override for subagents #18528 - feat(task): add model override for subagents

    • Directly related: This PR already implements model override functionality for subagents, which is very similar to the current PR's goal.
  2. PR feat: add assign-model feature for subagent model selection #17570 - feat: add assign-model feature for subagent model selection

    • Related: Implements subagent model selection, which overlaps with the model parameter routing feature.
  3. PR feat(agent): implement model tier selection with variant support for subagents #11377 - feat(agent): implement model tier selection with variant support for subagents

    • Related: Addresses model tier selection for subagents, similar conceptual approach.
  4. PR feat(task): pass variant to subagent so it inherits parent's thinking level #12567 - feat(task): pass variant to subagent so it inherits parent's thinking level

    • Related: Involves passing model-related parameters through the task tool to subagents.

Recommendation: Check PR #18528 in particular, as it appears to be the most directly related existing implementation of model override for subagents.

@ziuus
Copy link
Copy Markdown
Author

ziuus commented May 5, 2026

Closing in favor of #18528 which has a more complete implementation with permission gating (model_override). Will contribute to that PR instead.

@ziuus ziuus closed this May 5, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

needs:compliance This means the issue will auto-close after 2 hours.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant