Add model parameter to delegate tool for per-call provider overrides#34681
Open
barryreynolds1 wants to merge 1 commit into
Open
Add model parameter to delegate tool for per-call provider overrides#34681barryreynolds1 wants to merge 1 commit into
barryreynolds1 wants to merge 1 commit into
Conversation
This change allows dynamic provider:model selection for delegates at runtime, removing the previous limitation where all delegates were forced through the default provider specified in the delegation config. Key changes: - Added model parameter to delegate_task() function signature - Added _resolve_per_call_model() helper to resolve provider credentials - Added per-call model override logic that merges with config-based creds - Added per-task model override support in the task loop - Updated DELEGATE_TASK_SCHEMA to include model property at both top-level and per-task level - Updated registry handler to pass model parameter - Changed creds references to task_creds to support per-task overrides This enables more flexible delegation strategies where different subtasks can be routed to different providers based on their requirements.
Collaborator
|
This is part of a saturated feature cluster for per-call model/provider overrides on |
13 tasks
This was referenced May 29, 2026
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
This PR adds a
modelparameter to thedelegate_tasktool, enabling per-call provider:model overrides for delegates. Previously, all delegates were forced to use the provider specified in the delegation config section with no way to override it dynamically.Problem
The existing delegation system only allowed configuring a single provider for all delegate agents via the
delegationconfig section. This was limiting for scenarios where different subtasks might benefit from different models or providers based on their requirements.Solution
This change introduces a
modelparameter that accepts a dictionary withproviderandmodelkeys, allowing dynamic routing of delegates to any configured provider at runtime.Key Changes
Added
_resolve_per_call_model()helper function (~line 2203){provider, model}dict and resolves full credentials viaresolve_runtime_provider()_resolve_delegation_credentials()Added
modelparameter todelegate_task()function (~line 1802)Dict[str, str]with provider/model keysAdded per-call model override logic (~lines 1882-1893)
modelis provided, resolves credentials and merges on top of config-based credsAdded per-task model override support (~lines 1943-1952)
tasksarray can specify its own{provider, model}Updated
DELEGATE_TASK_SCHEMAmodelproperty at top-level (~lines 2535-2557)modelproperty at per-task level (~lines 2479-2493)Updated registry handler (~line 2581)
model=args.get("model")to the functionFixed credential references (~lines 1948-1968)
credsreferences totask_credsto support per-task overridesExample Usage
Testing
The changes maintain backward compatibility - existing code without the
modelparameter continues to work as before, using the delegation config settings.Impact
This enhancement enables more sophisticated delegation strategies where different subtasks can be dynamically routed to the most appropriate provider/model combination based on task requirements, cost considerations, or performance needs.