Skip to content

feat(delegate_task): add model overrides#30388

Draft
alphalphi101-cell wants to merge 2 commits into
NousResearch:mainfrom
alphalphi101-cell:fix/delegate-heartbeat-test-flake
Draft

feat(delegate_task): add model overrides#30388
alphalphi101-cell wants to merge 2 commits into
NousResearch:mainfrom
alphalphi101-cell:fix/delegate-heartbeat-test-flake

Conversation

@alphalphi101-cell

Copy link
Copy Markdown

Summary

  • Adds delegate_task top-level and per-task model override plumbing already present in the local branch.
  • Stabilizes the in-tool heartbeat regression test by patching the stale-cycle thresholds instead of relying on precise wall-clock tick counts.

Verification

  • python - <<'PY' ... schema probe confirmed top-level and per-task model schema 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

  • Draft PR for review only.
  • Branch was created from the current local Hermes checkout, which is ahead of and behind origin/main; rebase may be needed before final review.

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
@alt-glitch alt-glitch added type/feature New feature or request P3 Low — cosmetic, nice to have tool/delegate Subagent delegation duplicate This issue or pull request already exists labels May 22, 2026
@alt-glitch

Copy link
Copy Markdown
Collaborator

Saturated feature cluster — delegate_task model overrides have 30+ open PRs including #12715, #16163, #17581, #17756, #3172, #6771. Duplicate of #12715 (earliest open PR with the same feature). Please coordinate with existing efforts before submitting new PRs for this feature.

@LexClaw

LexClaw commented May 22, 2026

Copy link
Copy Markdown

+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.

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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

duplicate This issue or pull request already exists P3 Low — cosmetic, nice to have tool/delegate Subagent delegation type/feature New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants