Skip to content

feat(delegation): support per-call child model overrides - #50465

Closed
JiraiyaETH wants to merge 1 commit into
NousResearch:mainfrom
JiraiyaETH:alex/delegate-per-call-model-routing
Closed

feat(delegation): support per-call child model overrides#50465
JiraiyaETH wants to merge 1 commit into
NousResearch:mainfrom
JiraiyaETH:alex/delegate-per-call-model-routing

Conversation

@JiraiyaETH

Copy link
Copy Markdown

Summary

  • add per-call delegate_task model overrides via model={provider, model}
  • add top-level and per-task reasoning_effort overrides
  • resolve delegation credentials per task so batch delegation can fan out across configured providers/models
  • forward the new public schema fields through AIAgent._dispatch_delegate_task

Validation

  • python -m py_compile tools/delegate_tool.py run_agent.py tests/tools/test_delegate.py
  • python -m pytest tests/tools/test_delegate.py::TestDelegateRequirements::test_schema_valid tests/tools/test_delegate.py::TestDelegationProviderIntegration::test_per_call_model_override_reaches_child_agent tests/tools/test_delegate.py::TestDelegationProviderIntegration::test_per_call_model_only_override_reuses_delegation_provider tests/tools/test_delegate.py::TestDelegationProviderIntegration::test_per_call_model_only_override_can_inherit_parent_provider tests/tools/test_delegate.py::TestDelegationProviderIntegration::test_batch_mode_can_mix_per_task_models tests/tools/test_delegate.py::TestDelegationProviderIntegration::test_single_task_reasoning_effort_reaches_child_agent tests/tools/test_delegate.py::TestDelegationReasoningEffort::test_per_call_reasoning_effort_overrides_config tests/tools/test_delegate.py::TestDispatchDelegateTask::test_agent_dispatch_forwards_model_and_reasoning -o 'addopts=' -q → 8 passed
  • python -m pytest tests/tools/test_delegate.py -o 'addopts=' -q -k 'not heartbeat_does_not_trip_idle_stale_while_inside_tool' → 146 passed, 1 deselected
  • python -m pytest tests/cli/test_cli_interrupt_subagent.py tests/run_agent/test_tool_executor_contextvar_propagation.py -o 'addopts=' -q → 6 passed
  • direct provider smoke: openai-codex/gpt-5.4-miniGPT54_MINI_DIRECT_OK
  • e2e delegation smoke: DeepSeek child override → DEEPSEEK_PARENT_OVERRIDE_OK
  • e2e mixed batch smoke produced both task completion markers: BATCH_SYNC_DEEPSEEK_OK, BATCH_SYNC_GPT54_OK

Known unrelated test failure

tests/tools/test_delegate.py::TestDelegateHeartbeat::test_heartbeat_does_not_trip_idle_stale_while_inside_tool is currently failing on origin/main as well as this branch. Verified in a separate disposable verifier worktree reset to origin/main:

HEAD is now at 87ab37338 test(url-safety): cover IPv6 scope-ID strip + fail-closed in URL guards
FAILED tests/tools/test_delegate.py::TestDelegateHeartbeat::test_heartbeat_does_not_trip_idle_stale_while_inside_tool

This PR leaves that heartbeat test untouched.

@JiraiyaETH
JiraiyaETH force-pushed the alex/delegate-per-call-model-routing branch from 663feca to b3545de Compare June 21, 2026 23:37
@alt-glitch alt-glitch added type/feature New feature or request comp/agent Core agent runtime: loop, agent_init, prompt builder, context-compression, responses endpoint tool/delegate Subagent delegation P3 Low — cosmetic, nice to have labels Jun 21, 2026
@alt-glitch

Copy link
Copy Markdown
Collaborator

Related: #47295, #32711 (feature requests for per-call model routing in delegate_task), and the open competing PRs #48867, #50015, #17756, #12715 (and others) that implement the basic per-call/per-task model override.

This PR is a superset — it adds reasoning_effort overrides and per-task credential resolution for batch fan-out across configured providers on top of the model override. Linking the cluster so reviewers can consolidate on one approach.

@teknium1

teknium1 commented Jul 5, 2026

Copy link
Copy Markdown
Contributor

We do not want this

@davidrobertson

davidrobertson commented Jul 26, 2026

Copy link
Copy Markdown
Contributor

We do not want this

@teknium1 Many users do, and I'd love to have a discussion around this. At the very least, we could gate the allowed behavior behind an opt-in config option, maybe something like `delegation.dynamic_subagents: true' (defaults to false).

There are benefits to allowing this, such as having higher model/reasoning effort planning/review subagents for projects with larger sets of dependencies or security implications.

Thoughts?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

comp/agent Core agent runtime: loop, agent_init, prompt builder, context-compression, responses endpoint 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.

4 participants