feat(delegation): add model override to delegate_task (fixes #44900) - #44906
Closed
Morad37 wants to merge 2 commits into
Closed
feat(delegation): add model override to delegate_task (fixes #44900)#44906Morad37 wants to merge 2 commits into
Morad37 wants to merge 2 commits into
Conversation
Collaborator
tonydwb
approved these changes
Jun 13, 2026
tonydwb
left a comment
There was a problem hiding this comment.
Code Review Summary
Verdict: Approved
Clean feature addition. The model parameter on delegate_task allows callers to override the model used by subagents, with proper per-task precedence (per-task overrides beat top-level, which beat delegation config).
Looks Good
- Implementation mirrors
cronjob_tools._resolve_model_overridefor consistency - When only
modelis specified withoutprovider, pins the current default provider so the override doesn't drift on config change - Schema properly documents the object structure with
additionalProperties: False - Top-level parameter and per-task
modelfield are both exposed in the schema - Clean error handling in
_resolve_model_override_for_delegatewith try/except
Reviewed by Hermes Agent
Contributor
Author
|
Agreed. #12715 covers this properly with the broader approach. Closing in favour of that. Thanks for the heads up @alt-glitch. |
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.
Add an optional
modelparameter todelegate_taskso subagents can run on a different model than the parent. Works like the existingmodeloverride incronjob.What changed
Function signature -
delegate_task()now acceptsmodel: Optional[Dict[str, str]] = None. Pass{provider: ..., model: ...}to override the model for all subagents.Per-task override - Each task in the
tasksarray can also have its ownmodelfield, which beats the top-level override for that task only.Resolution logic - Mirrors
cronjob_tools._resolve_model_override. When you setmodelwithoutprovider, the current default provider is pinned at resolution time. This keeps the override stable even if you switch your default later.Schema - Both the top-level and per-task
modelparameters are documented in the JSON schema as{type: object}withproviderandmodelstring properties.Implementation details
_resolve_model_override_for_delegate()helper, mirrors the cronjob versionmodelis resolved after_resolve_delegation_credentials()and overrides the creds for all tasksmodelis resolved per child in the build loop and passed asmodel+override_providerto_build_child_agent()_build_child_agent()already acceptedmodelandoverride_providerparameters, so no changes needed there