feat: per-call model/provider override on delegate_task - #3734
Closed
HenkDz wants to merge 2 commits into
Closed
Conversation
…#3719) Add model and provider parameters to delegate_task tool schema (both top-level and per-task in batch mode) so the parent agent can dynamically route subagents to different models based on task type. Resolution priority: per-call -> config delegation.* -> parent inherit. Changes: - Add model/provider to DELEGATE_TASK_SCHEMA (top-level + batch items) - Add _resolve_call_credentials() helper that merges per-call overrides with config-level credentials - Refactor delegate_task() to resolve credentials per-task instead of once globally - Wire model/provider through handler lambda Backward compatible: omitting model/provider preserves existing behavior.
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 #3719
Summary
Add
modelandproviderparameters todelegate_task(top-level and per-task in batch mode) so the parent agent can dynamically route subagents to different models based on task type.Motivation
Currently subagent model selection is static via
delegation.model/delegation.providerin config.yaml — all subagents use the same model. Different tasks benefit from different models (code → fast model, research → strong reasoning model).Changes
tools/delegate_tool.py(136 insertions, 34 deletions)modelandprovideras top-level params + inside batch task items_resolve_call_credentials(): New helper that merges per-call overrides with config-level credentials viaresolve_runtime_provider()delegate_task(): Refactored to resolve credentials per-task instead of once globally. Top-levelmodel/providerflow into single-task mode; batch mode uses each task's own overridesmodel/providerthrough the lambdaResolution Priority
Fully backward compatible — omitting
model/providerpreserves existing behavior.Example Usage
Single task:
Batch with per-task routing: