Skip to content

feat(todo): add model and provider fields for per-task model override#18880

Closed
zhuzeyu22 wants to merge 7 commits into
NousResearch:mainfrom
zhuzeyu22:main
Closed

feat(todo): add model and provider fields for per-task model override#18880
zhuzeyu22 wants to merge 7 commits into
NousResearch:mainfrom
zhuzeyu22:main

Conversation

@zhuzeyu22

Copy link
Copy Markdown

Summary

  • 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

Changes

tools/todo_tool.py

  • Extended TodoStore to support optional model and provider fields
  • Updated schema to include new fields with descriptions
  • Validation handles the new optional fields

tools/delegate_tool.py

  • Added _resolve_task_model() function to resolve per-task model credentials
  • Modified _resolve_delegation_credentials() to accept task-level overrides
  • Each task now resolves its own credentials independently
  • Updated DELEGATE_TASK_SCHEMA with model/provider properties

tests/tools/test_todo_tool.py

  • Added tests for model and provider field handling
  • Tests cover write, merge, and validation scenarios

Use 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.

- 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
@alt-glitch alt-glitch added type/feature New feature or request tool/delegate Subagent delegation comp/tools Tool registry, model_tools, toolsets P3 Low — cosmetic, nice to have labels May 2, 2026
@alt-glitch

Copy link
Copy Markdown
Collaborator

Likely duplicate of #7586 — same per-task model/provider override for delegate_task. Also supersedes closed #18865.

@alt-glitch

Copy link
Copy Markdown
Collaborator

Likely duplicate of #7586 — same per-task model/provider override for delegate_task.

@zhuzeyu22

Copy link
Copy Markdown
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

@alt-glitch

zhuzeyu22 added 6 commits May 3, 2026 02:54
- 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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

comp/tools Tool registry, model_tools, toolsets P3 Low — cosmetic, nice to have tool/delegate Subagent delegation type/feature New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants