Skip to content

Question: Does model: in agent frontmatter and task() calls control model selection? #2564

Closed

Description

@TheTrustedAdvisor

Question

Does the model: property in .agent.md frontmatter and the model parameter in task() calls actually control which model is used?

Observed Behavior

Testing with Copilot CLI v1.0.19:

Context model: specified Actual model
Agent frontmatter model: claude-haiku-4.5 haiku 4.5 Sonnet 4.6 (session default)
Agent frontmatter model: claude-opus-4.6 opus 4.6 Sonnet 4.6 (session default)
task() parameter model: "claude-haiku-4.5" haiku 4.5 Sonnet (per sub-agent self-report)

All agents and sub-agents appear to run on the session default model regardless of explicit model configuration.

Expected Behavior

Per the custom agents configuration docs, model is a supported property. We expected it to route the agent to the specified model.

Questions

  1. Is model: in frontmatter intended to be honored? Or is it overridden by auto-selection?
  2. Does model in task() calls route sub-agents to different models?
  3. What is the correct way for a plugin to request different model tiers for different agents (e.g., haiku for search, opus for architecture review)?
  4. Does the user need a specific Copilot plan tier for multi-model agent routing to work?

Context

Building a multi-agent orchestration plugin (28 agents) that assigns different model tiers based on task complexity. The model routing appears to have no effect.

Related: #2563 (tools: enforcement)

Activity

  1. TheTrustedAdvisor commented on Apr 7, 2026

    @TheTrustedAdvisor
    Author

    Additional evidence from JSONL metadata

    Testing with --output-format json to get objective model data (not self-report):

    Agent Frontmatter model: JSONL session.tools_updated model JSONL tool.execution_complete model
    omg:explore claude-haiku-4.5 claude-sonnet-4.6 —
    omg:architect claude-opus-4.6 claude-sonnet-4.6 claude-sonnet-4.6

    Both agents run on the session default (Sonnet 4.6) regardless of their model: frontmatter.

    Copilot CLI v1.0.19. Plugin installed via copilot plugin install ./plugin.

    The model: property in .agent.md frontmatter appears to have no effect on model selection.

  2. examon commented on Apr 7, 2026

    @examon

    Thanks for the detailed report and the JSONL evidence -- really helpful for tracking this down.

    The root cause was that the plugin agent loading path was missing propagation of the model field from frontmatter. When agents were loaded via copilot plugin install, the parsed model: value was silently dropped, so all plugin agents fell back to the session default model (Sonnet 4.6 in your case). Repo-level custom agents (those placed in .github/agents/) were unaffected because their loading path copied the model correctly.

    This has been fixed in main. The PluginAgent interface now includes the model field, and both parseAgentFile() and loadAgentsFromPlugins() propagate it through to model resolution. The fix will ship in the first release after v1.0.21.

    Regarding the task() model parameter: it is a supported feature. When you pass model: "claude-haiku-4.5" to a task() call, it flows through model validation and the cost-tier guard, then overrides the agent's definition model. The behavior you observed (task() showing Sonnet) was most likely because the underlying plugin agent's frontmatter model was being dropped (same bug), causing the definition model to resolve as undefined and falling back to session default. With the fix, both the frontmatter path and the task() model override should work as documented.

    One thing to note: model selection is subject to a cost multiplier guard. If your Copilot plan tier has a 0x (free) session model, specifying a higher-cost model in frontmatter or task() may be silently downgraded. This is by design to prevent unexpected cost escalation.

    Closing this as the underlying issue is resolved in main. Upgrade to the next release after v1.0.21 to pick up the fix.

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions