feat(delegate_task): add per-task model/provider override#39282
Open
agt-user wants to merge 1 commit into
Open
feat(delegate_task): add per-task model/provider override#39282agt-user wants to merge 1 commit into
agt-user wants to merge 1 commit into
Conversation
Allow individual tasks in the array to specify their own and/or , overriding the global delegation config for that task only. When a per-task override is present, is called with a task-scoped config so that base_url, api_key, and api_mode are derived correctly from the per-task provider — not the global delegation config. Tasks without overrides fall back to the pre-resolved dict as before (no regression for existing usage). Changes: - : add and fields to the per-task object inside array - loop: resolve per-task credentials when override is present; otherwise reuse global (zero overhead) Closes NousResearch#35437 Related: NousResearch#34489, NousResearch#31537, NousResearch#36790, NousResearch#30388, NousResearch#37966
6669309 to
e7c78c9
Compare
Author
|
Hi — just rebased this onto latest I noticed the |
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
Add per-task
modelandproviderfields to thetasksarray indelegate_task, enabling different tasks in the same batch call to run on different models and providers.Problem
Currently all tasks in a
delegate_taskcall share the same model (resolved once fromdelegation.*config or inherited from parent). There's no way to route a lightweight task tohaikuwhile a reasoning-heavy task usesopusin the same batch.Tracked in #35437 (consolidating #5012, #10995, #17685, #23467, #32711). This implementation takes the minimal approach.
Solution
Two targeted changes, zero regressions:
1. Schema
Added
modelandprovideras optional fields to each task object in thetasksarray.2. Loop logic
When a task specifies
modelorprovider,_resolve_delegation_credentialsis called with a task-scoped config sobase_url,api_key, andapi_modeare derived correctly from the per-task provider. Tasks without overrides reuse the pre-resolvedcredsdict (no overhead for existing callers).Why re-resolve via
_resolve_delegation_credentials?Passing only
modelwithout re-resolving credentials would silently break cross-provider overrides — e.g.provider: "nvidia"needs the NVIDIA base_url and API key, not just a model name swap. Re-resolving per-task ensures the full credential bundle is correct.Usage example
Testing
modelandproviderappear in task propertiestask_creds = credspath (no change)Closes #35437