feat(tools): add per-call model/provider/profile overrides to delegate_task - #64988
Closed
luluthehungrycat wants to merge 2 commits into
Closed
luluthehungrycat wants to merge 2 commits into
luluthehungrycat wants to merge 2 commits into
Conversation
…e_task Adds three new optional parameters to the delegate_task tool that let the model (or a human caller) override the model, provider, and profile used for subagents on a per-call basis. - model: specify which model the subagent should use - provider: specify which provider serves the model (required with model) - profile: specify which Hermes profile's credentials to resolve from When model is provided, _resolve_per_call_credentials() reads the specified profile's .env and config.yaml to resolve the API key, base URL, and API mode — bypassing the delegation config block entirely. When model is omitted, the existing delegation config path is used unchanged. The new fields are exposed in the tool schema so the model sees them, and threaded through the registry handler into the delegate_task() function signature.
…e_task Adds three new optional parameters (model, provider, profile) to the delegate_task tool that let the model override the model, provider, and profile used for subagents on a per-call basis. - model: specify which model the subagent should use - provider: optional — when omitted, child inherits parent's provider and credentials (model-only override) - profile: optional — when omitted, uses active profile's directories When model is provided, _resolve_per_call_credentials() reads the specified profile's .env and config.yaml to resolve the API key, base URL, and API mode, bypassing the delegation config block entirely. When model is omitted, the existing delegation config path is unchanged. Includes 6 unit tests covering: model-only override (no provider), model+provider resolution, credential dict shape compatibility, signature acceptance, and schema field exposure.
luluthehermeticcrabBot
force-pushed
the
feat/delegate-task-model-override-v2
branch
from
July 15, 2026 13:25
06d08cf to
ba11850
Compare
Author
|
Superseded by v3 branch — see new PR for updated implementation addressing OpenCode review feedback. |
5 tasks
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
model,provider,profile) to thedelegate_tasktool_resolve_per_call_credentials()function reads the specified profile's.envandconfig.yamlMotivation
delegate_taskpreviously inherited the parent agent's model and provider with no way to override per-call. This change makes model-aware routing a first-class capability of the delegation framework.Changes
delegate_task()signature: addedmodel,provider,profileoptional parametersmodelis set,_resolve_per_call_credentials()overrides the resolved credentials dict_resolve_per_call_credentials(model, provider=None, profile=None)— reads the target profile's.envandconfig.yaml. When provider is omitted, returns a model-only override (child inherits parent's provider/credentials). When profile is omitted, uses the active profile's directories.model,provider,profileas optional string properties inDELEGATE_TASK_SCHEMAdelegate_task()TestPerCallCredentialOverridecovering model-only, model+provider, nonexistent profile fallback, empty model string, credential dict shape, and schema exposureTest Plan
python -m pytest tests/tools/test_delegate.py::TestPerCallCredentialOverride -v— 8/8 passdelegate_task(goal="...", model="deepseek-v4-flash", provider="opencode-go", profile="coder")spawns subagent on the specified modelscripts/run_tests.shNotes for Reviewers
modelis omitted — existing delegation config path unchangedprofilefor SOUL.md persona loading — complementary