feat(delegate): optional per-task model/provider/reasoning_effort in batch mode - #53531
feat(delegate): optional per-task model/provider/reasoning_effort in batch mode#53531desland01 wants to merge 1 commit into
Conversation
…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>
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
left a comment
There was a problem hiding this comment.
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_credentialsreturnscredsunchanged 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_agentcorrectly threadsoverride_reasoning_effortthrough the reasoning config resolution chain
No security or correctness concerns.
Reviewed by Hermes Agent
|
Thanks for the focused implementation and behavior-oriented tests. This is an automated hermes-sweeper review. This change falls under the standing
A supported alternative is configuring the delegation provider/model globally in Closed as not-planned per standing maintainer policy ( |
What
Adds three optional per-task keys —
model,provider,reasoning_effort— todelegate_taskbatch 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_taskbatch. 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:
requiredstays["goal"]. No new top-level tool params.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.reasoning_effortfalls through to the existing default chain (existing warning text preserved); an unresolvableproviderlogs a warning and falls back to global delegation creds rather than erroring.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-existingtest_delegate.pytests are unmodified and still pass (146/146 green viascripts/run_tests.sh).Provenance
Built and run locally as commit
9164f676. Cherry-pickable to preserve authorship.