feat(delegate_task): add model overrides#30388
Draft
alphalphi101-cell wants to merge 2 commits into
Draft
Conversation
Adds a real `model` parameter to delegate_task (schema, handler, and function signature) so users can override the provider:model pair per call or per task in a batch. Precedence: per-task model > top-level model arg > delegation config > parent inherit. Either provider or model may be omitted in the override to fall back to config/parent. Changes: - DELEGATE_TASK_SCHEMA: top-level `model` + per-task `model` - handler lambda: passes `model` through - delegate_task(): accepts `model: Optional[Dict[str, str]]` - _resolve_delegation_credentials(): new `override` param - child construction loop: resolves credentials per-task with override
Collaborator
|
+1, using this locally. Cherry-picked both commits onto our internal hermes-pinned branch this morning (cherry-pick clean, 131 tests passed in tests/tools/test_delegate.py). Wired the per-task model override through our orchestrator's prompt-builder so each subagent runs on its configured optimal model instead of inheriting the parent. Deterministic negative test: injected a deliberately-dead base_url (http://127.0.0.1:9) into the override; _resolve_delegation_credentials surfaced a clean ValueError in 4ms with no silent fallback. The 'either provider or model may be omitted' semantics work as documented. Looking forward to seeing this merged. |
23 tasks
agt-user
pushed a commit
to agt-user/hermes-agent
that referenced
this pull request
Jun 9, 2026
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
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
delegate_tasktop-level and per-taskmodeloverride plumbing already present in the local branch.Verification
python - <<'PY' ...schema probe confirmed top-level and per-taskmodelschema entries.python -m pytest tests/tools/test_delegate.py::TestDelegateHeartbeat::test_heartbeat_does_not_trip_idle_stale_while_inside_tool -q -o 'addopts='python -m pytest tests/tools/test_delegate.py tests/tools/test_delegate_toolset_scope.py tests/tools/test_delegate_composite_toolsets.py tests/tools/test_delegate_subagent_timeout_diagnostic.py -q -o 'addopts='Notes
origin/main; rebase may be needed before final review.