Skip to content

Feature: per-call model/provider override in delegate_task #17732

@tilarso

Description

@tilarso

Summary

delegate_task currently inherits the parent session's model/provider for all subagents. A global override exists via delegation.model and delegation.provider in config.yaml, but there is no way to specify a different model on a per-call basis.

Motivation

Different subagent roles benefit from different models. For example:

  • Heavy reasoning tasks (architecture, security, code review) → a large reasoning model (e.g. claude-opus-4-5)
  • Code generation tasks (backend, frontend, devops) → a strong coding model (e.g. gpt-4-1)
  • Long-context planning tasks (PM, docs) → a long-context model (e.g. gemini-2-5-pro)

Without per-call model routing, all subagents are forced onto the same model as the parent session, regardless of what's optimal for the task.

What already exists

The internal _build_child_agent() function in tools/delegate_tool.py already accepts a model parameter, and the delegation config block supports model + provider overrides globally. The plumbing is there — it just isn't exposed in the delegate_task tool schema.

Proposed change

Add optional model and provider parameters to the delegate_task tool schema, mirroring the existing delegation.model/provider config keys but scoped to a single call:

{
  "model": {
    "type": "object",
    "properties": {
      "model": { "type": "string", "description": "Model name (e.g. 'claude-opus-4-5')" },
      "provider": { "type": "string", "description": "Provider name (e.g. 'anthropic'). Omit to pin current provider." }
    },
    "required": ["model"]
  }
}

This should also apply to per-task entries in batch mode (tasks[].model).

Workaround today

acp_command + acp_args can route to a specific model if an ACP-capable CLI (e.g. Claude Code) is installed, but this requires an external binary and adds overhead for simple use cases.

Use case example

Skills that define specialized agent personas (e.g. a "crew" of architects, security engineers, PMs) need to route each persona to the model best suited for their domain — without requiring the user to switch their global session model or install a second agent binary.

Metadata

Metadata

Assignees

No one assigned

    Labels

    P3Low — cosmetic, nice to havecomp/agentCore agent loop, run_agent.py, prompt buildertool/delegateSubagent delegationtype/featureNew feature or request

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions