feat(delegate_task): add model overrides - #30388
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
|
+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. |
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
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
|
Thanks for the implementation and for making the heartbeat assertion less timing-sensitive. Automated hermes-sweeper review: this change falls under the standing
Closing as not planned under the established policy. Closed as not-planned per standing maintainer policy ( |
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.