Skip to content

fix(delegate): wire model/provider params through to _build_child_agent - #31284

Closed
Altairpaca wants to merge 1 commit into
NousResearch:mainfrom
Altairpaca:fix/delegate-task-model-provider
Closed

fix(delegate): wire model/provider params through to _build_child_agent#31284
Altairpaca wants to merge 1 commit into
NousResearch:mainfrom
Altairpaca:fix/delegate-task-model-provider

Conversation

@Altairpaca

Copy link
Copy Markdown

The delegate_task() function already declared model and provider parameters in its signature (lines 1924-1925) and documented them in the docstring, but they were never actually passed through to _build_child_agent().

Three missing links added:

  1. Single-task dict now includes model/provider so they reach the batch loop
  2. Per-call model/provider override creds after credential resolution from config
  3. Per-task model/provider resolution in the batch iteration loop

This lets callers do:
delegate_task(goal="...", model="deepseek-v4-pro")
to run a subagent on a specific model, with per-task overrides in batch mode. When unset, children inherit from parent (existing behaviour preserved).

What does this PR do?

Related Issue

Fixes #

Type of Change

  • 🐛 Bug fix (non-breaking change that fixes an issue)
  • ✨ New feature (non-breaking change that adds functionality)
  • 🔒 Security fix
  • 📝 Documentation update
  • ✅ Tests (adding or improving test coverage)
  • ♻️ Refactor (no behavior change)
  • 🎯 New skill (bundled or hub)

Changes Made

How to Test

Checklist

Code

  • I've read the Contributing Guide
  • My commit messages follow Conventional Commits (fix(scope):, feat(scope):, etc.)
  • I searched for existing PRs to make sure this isn't a duplicate
  • My PR contains only changes related to this fix/feature (no unrelated commits)
  • I've run pytest tests/ -q and all tests pass
  • I've added tests for my changes (required for bug fixes, strongly encouraged for features)
  • I've tested on my platform:

Documentation & Housekeeping

  • I've updated relevant documentation (README, docs/, docstrings) — or N/A
  • I've updated cli-config.yaml.example if I added/changed config keys — or N/A
  • I've updated CONTRIBUTING.md or AGENTS.md if I changed architecture or workflows — or N/A
  • I've considered cross-platform impact (Windows, macOS) per the compatibility guide — or N/A
  • I've updated tool descriptions/schemas if I changed tool behavior — or N/A

For New Skills

  • This skill is broadly useful to most users (if bundled) — see Contributing Guide
  • SKILL.md follows the standard format (frontmatter, trigger conditions, steps, pitfalls)
  • No external dependencies that aren't already available (prefer stdlib, curl, existing Hermes tools)
  • I've tested the skill end-to-end: hermes --toolsets skills -q "Use the X skill to do Y"

Screenshots / Logs

The delegate_task() function already declared model and provider parameters
in its signature (lines 1924-1925) and documented them in the docstring,
but they were never actually passed through to _build_child_agent().

Three missing links added:
1. Single-task dict now includes model/provider so they reach the batch loop
2. Per-call model/provider override creds after credential resolution from config
3. Per-task model/provider resolution in the batch iteration loop

This lets callers do:
  delegate_task(goal="...", model="deepseek-v4-pro")
to run a subagent on a specific model, with per-task overrides in batch mode.
When unset, children inherit from parent (existing behaviour preserved).
@alt-glitch alt-glitch added type/bug Something isn't working P2 Medium — degraded but workaround exists tool/delegate Subagent delegation comp/tools Tool registry, model_tools, toolsets labels May 24, 2026
@alt-glitch

Copy link
Copy Markdown
Collaborator

Duplicate of #3172 (earliest open PR in the delegate_task model/provider override cluster). Multiple open PRs implement the same feature: #6771, #12715, #12794, #16163, #17581, #17718, #17756, #19719, #23266, #30388. Please coordinate with those PRs before proceeding.

@alt-glitch alt-glitch added the duplicate This issue or pull request already exists label May 24, 2026
@Altairpaca

Copy link
Copy Markdown
Author

Thanks for the pointer! #3172 by @ReqX is indeed the earliest in this cluster. Our commit is against the current
codebase (post-dispatch-refactor) and was a minimal wiring exercise. Since yours covers more ground (dispatch path fix, full test suite, skill template), I'm closing this in favour of #3172. Happy to rebase or contribute tests if that helps move things forward 🙏

@Altairpaca Altairpaca closed this May 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

comp/tools Tool registry, model_tools, toolsets duplicate This issue or pull request already exists P2 Medium — degraded but workaround exists tool/delegate Subagent delegation type/bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants