feat(todo): add model and provider fields for per-task model override#18880
Closed
zhuzeyu22 wants to merge 7 commits into
Closed
feat(todo): add model and provider fields for per-task model override#18880zhuzeyu22 wants to merge 7 commits into
zhuzeyu22 wants to merge 7 commits into
Conversation
- Add optional 'model' and 'provider' fields to todo items - Allow per-task model override when delegating to subagents - Resolve credentials per-task instead of globally - Add tests for new model/provider fields
Collaborator
Collaborator
|
Likely duplicate of #7586 — same per-task model/provider override for delegate_task. |
This was referenced May 2, 2026
Author
|
I need to select providers and models more precisely in subtasks, so as to accommodate different types of tasks and facilitate cross-examination among models It is important |
- Add model/provider/base_url parameters to delegate_task function - Support per-task model/provider/base_url in batch mode - Auto-match custom provider by model (custom_providers first priority) - Security: never accept api_key from task parameters - Update todo_tool.py to support model/provider/base_url too
- Prioritize api_key (config) before key_env (env var) - Follow the same priority as runtime_provider.py - Use has_usable_secret from runtime_provider for consistency
…in get_named_custom_provider
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.
Summary
modelandproviderfields to todo itemsChanges
tools/todo_tool.pyTodoStoreto support optionalmodelandproviderfieldstools/delegate_tool.py_resolve_task_model()function to resolve per-task model credentials_resolve_delegation_credentials()to accept task-level overridesDELEGATE_TASK_SCHEMAwith model/provider propertiestests/tools/test_todo_tool.pyUse Case
When delegating tasks to subagents, you can now specify a different model/provider per task:
{ "id": "1", "content": "Use GPT-4 for this task", "status": "pending", "model": "gpt-4o", "provider": "openai" }This enables mixed-model workflows where different tasks use different models based on their requirements.