feat(delegate): per-task model/provider override in delegate_task tasks array#34773
Open
DJNing wants to merge 1 commit into
Open
feat(delegate): per-task model/provider override in delegate_task tasks array#34773DJNing wants to merge 1 commit into
DJNing wants to merge 1 commit into
Conversation
…ks array Add optional 'model' and 'provider' fields to each item in the delegate_task 'tasks' array. - 'model' alone: sends a different model name to the default delegation provider/endpoint - 'provider' alone: re-resolves the full credential bundle (base_url, api_key, api_mode) for that provider, using its default model - Both: re-resolves provider creds + overrides the model name Unknown providers raise a clean ValueError with available providers listed. Model validation is deferred to the API (consistent with the rest of Hermes — model names aren't validated at credential time). Closes NousResearch#34764
Collaborator
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 optional
modelandproviderfields to each item in thedelegate_tasktasksarray, allowing different subagents in a batch to run on different models or providers.Semantics
modelonlyprovideronlyImplementation
In
tools/delegate_tool.py:credstodefault_credsto prepare for per-task resolution.t["provider"]differs from the delegation default, calls_resolve_delegation_credentials()again with the overridden provider to get the full credential bundle. When onlyt["model"]is set, copies default creds and overrides the model name.modelandproviderfields to the task item JSON schema.No changes needed in
AIAgent.__init__or the agent loop —_build_child_agentalready resolveseffective_model = model or parent_agent.model.Testing
ValueErrorlisting available providersdelegate_tasktool confirmed correct model/provider on spawned subagents:glm-4.6vvia zai → reportedMODEL=glm-4.6v, PROVIDER=zaideepseek-chatvia deepseek → reportedMODEL=deepseek-chat, PROVIDER=deepseekExample usage
Closes #34764