Skip to content

feat: per-call model/provider override on delegate_task#3750

Closed
HenkDz wants to merge 3 commits into
NousResearch:mainfrom
HenkDz:feat/delegate-model-provider
Closed

feat: per-call model/provider override on delegate_task#3750
HenkDz wants to merge 3 commits into
NousResearch:mainfrom
HenkDz:feat/delegate-model-provider

Conversation

@HenkDz

@HenkDz HenkDz commented Mar 29, 2026

Copy link
Copy Markdown
Contributor

Summary

Add model and provider parameters to the delegate_task tool, allowing per-delegation model routing. The LLM can now specify which model/provider to use for each delegation call, overriding the static delegation.model/delegation.provider config.

Changes

  1. Schema: Added model and provider string fields to DELEGATE_TASK_SCHEMA
  2. Handler: Wired new params through registry handler to delegate_task()
  3. Signature: Added model and provider optional params to function
  4. Config override: Per-call values override delegation config section
  5. Credential fix: When delegation.base_url is set but no api_key found AND a provider is configured, fall through to provider resolution instead of erroring

Use case

delegate_task(
  goal="Write a Python function...",
  toolsets=["terminal", "file"],
  model="glm-5.1",
  provider="zai"
)

Routes this specific subagent to glm-5.1 on provider zai, while the parent runs on a different model.

HenkDz added 2 commits March 29, 2026 17:49
Add model and provider parameters to delegate_task tool schema and
handler, allowing the LLM to specify which model/provider to use for
each delegation call (overriding delegation config).

Also fix credential resolution: when delegation.base_url is set but no
api_key is found AND a provider is configured, fall through to provider
resolution instead of raising an error. This handles the common case
where base_url is redundant but provider can resolve creds from env.
…l selection

Map task categories (coding, research, reasoning, etc.) to specific models
via delegation.task_models in config. The agent passes task_type when
delegating, and the model is resolved automatically.

Resolution order: per-call model > per-task model > task_models[type] >
delegation.model > parent model. task_models only selects the model name;
provider is always delegation.provider (or per-call provider, or parent).

Also adds per-task model override in batch mode, task_type param in schema
with documentation hints, and user-facing docs with examples.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant