Skip to content

feat(delegate): optional per-task model/provider/reasoning_effort in batch mode - #53531

Closed
desland01 wants to merge 1 commit into
NousResearch:mainfrom
desland01:feat/delegate-per-task-model
Closed

feat(delegate): optional per-task model/provider/reasoning_effort in batch mode#53531
desland01 wants to merge 1 commit into
NousResearch:mainfrom
desland01:feat/delegate-per-task-model

Conversation

@desland01

Copy link
Copy Markdown

What

Adds three optional per-task keys — model, provider, reasoning_effort — to delegate_task batch task items, so a single batch can fan work across models (e.g. a Fable 5 reasoning child alongside free OpenRouter workers) instead of every child inheriting one global delegation config.

Why (concrete consumer)

A multi-model COO/CTO fleet routes bulk subtasks to free OpenRouter workers while keeping judgment/verification children on the brain model — in one delegate_task batch. Today that requires one config for all children. This is a real, in-use case, not a speculative hook.

Footprint / core-schema discipline

This touches the model tool schema, so it's deliberately minimal:

  • Three optional keys, nothing else. required stays ["goal"]. No new top-level tool params.
  • Absent keys = byte-identical behavior. Resolution is per-task → delegation.* → parent, exactly today's chain when omitted. _resolve_task_credentials() returns the existing call-level creds object unchanged when there's no override (identity-preserving) — prompt-cache safe, no mid-conversation cache break.
  • Graceful, non-fatal degradation. Invalid reasoning_effort falls through to the existing default chain (existing warning text preserved); an unresolvable provider logs a warning and falls back to global delegation creds rather than erroring.
  • No new HERMES_* env var, no plugin-in-core, no telemetry.

Tests

tests/tools/test_delegate_per_task_overrides.py — 6 behavior-contract tests: schema keys present; model+effort override applied to the child; provider override; defaults unchanged when keys absent; empty/invalid values ignored; unresolvable provider falls back. The 140 pre-existing test_delegate.py tests are unmodified and still pass (146/146 green via scripts/run_tests.sh).

Provenance

Built and run locally as commit 9164f676. Cherry-pickable to preserve authorship.

…rrides in batch mode

Each task object in delegate_task batch mode may now optionally carry
'model', 'provider', and 'reasoning_effort' strings that win over the
global delegation config for that child only. Defaults (keys absent,
empty, or invalid) are byte-identical to prior behavior; unresolvable
per-task providers warn and fall back to call-level credentials. The
effective per-task model rides on progress callbacks as before and an
info log line surfaces applied overrides.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@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 Jun 27, 2026
@alt-glitch

Copy link
Copy Markdown
Collaborator

This was generated by AI during triage.

Duplicate of #50465 — the earliest, most comprehensive open PR in the per-task delegate-override cluster (it adds per-call/per-task model + reasoning_effort plus per-task credential resolution). This PR is the narrower batch-only model/provider/reasoning_effort subset of the same feature (#52693 was already marked a duplicate of #50465 for the same reason).

@tonydwb tonydwb left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review Summary

Verdict: Approved

Adds optional per-task model/provider/reasoning_effort overrides in delegate_task batch mode. Each batch task can now pin its own model, provider, and reasoning level without affecting siblings.

Looks Good

  • _resolve_task_credentials returns creds unchanged when no override — byte-identical default path
  • Graceful degradation: empty/invalid overrides fall back to defaults with warnings
  • Unresolvable providers warn and fall back to call-level credentials
  • Schema properly exposes the new keys as optional strings
  • Comprehensive test suite: 5 test classes covering overrides, defaults, invalid values, and provider resolution failures
  • _build_child_agent correctly threads override_reasoning_effort through the reasoning config resolution chain

No security or correctness concerns.


Reviewed by Hermes Agent

@teknium1

Copy link
Copy Markdown
Contributor

Thanks for the focused implementation and behavior-oriented tests.

This is an automated hermes-sweeper review. This change falls under the standing delegation-model-routing policy: child model/provider/reasoning selection is not model-callable or per-task; children inherit the parent unless users pin the fleet through delegation.provider / delegation.model in config.yaml.

  • Current main states this explicitly in tools/delegate_tool.py:3296.
  • The current batch path resolves one configuration credential bundle at tools/delegate_tool.py:2453 and applies it to children at tools/delegate_tool.py:2522-2529.
  • The related canonical PR feat(delegation): support per-call child model overrides #50465 received the maintainer direction, “We do not want this.”

A supported alternative is configuring the delegation provider/model globally in config.yaml; no per-task routing surface should be added to delegate_task.


Closed as not-planned per standing maintainer policy (delegation-model-routing). This is a design-direction decision, not a code-quality judgment — see the Contribution Rubric in AGENTS.md for what the project is looking for. If you believe this policy was misapplied to your change, comment here and a maintainer will take a look.

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 sweeper:not-planned Sweeper: closed per standing maintainer policy (design direction) tool/delegate Subagent delegation type/feature New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants