Add a clear way to set the model for each task call
Description
Give the user a safe way to set the model for one task call. The user must be able to do this with the task tool and with the agent() function in eval scripts. Do not let a model set for one call replace the model in the agent file in error. Do not use the word "default" to mean "use the model of the parent session". Show the model that the system used for each task in the task result text. Send a warning if a setting in task.agentModelOverrides will replace the model that the user set for one call.
Use Case
A manager agent must send different parts of a job to different subagents. Some parts of the job are simple. The manager agent must send these simple parts to a cheap model. Other parts of the job need a check from a different model. The manager agent must send these parts to a subagent that uses a different model family. For example, an Anthropic model can send a task to a subagent that uses a GPT model. This gives a check from a different model family. Today, the user must make one agent file for each model. The manager agent cannot pick the model when the system runs. Issue #5325, issue #7544, and issue #6438 show this problem.
Area
Session management
Proposed Solution
Add a new field, model, to the task item. This field must have the highest priority in the model order shown in docs/task-agent-discovery.md. The order today is: task.agentModelOverrides[agentName], then the model in the agent file, then the model of the parent session. The new field must come before all three. The user can set model to a real model name, for example openai/gpt-5.4:high. The user can also set model to a role name, for example @review. The system must not accept the word "default" as a value for model. If the user wants the model of the parent session, the user must set model to a new, clear value, for example @parent. Add the same model field to the agent() function in eval scripts. Update docs/tools/eval.md. This doc says today that a per‑call model is not possible. Show the resolved model in the task result text at all times. Do not hide this behind the task.showResolvedModelBadge setting. Send a warning message when task.agentModelOverrides will replace the model that the user set for one call.
Alternatives Considered
- Make one agent file for each model. This works today. But the user must make a new file for each model. The manager agent cannot pick the model when the system runs.
- Set task.agentModelOverrides in the settings file. This sets the model for all calls to one agent type. It does not set the model for one call only. Issue #7544 shows that this can replace a model role change with no warning.
- Use the built‑in sonic agent for a cheap model. This gives only one fixed cheap model. It does not let the user pick a different model family for a review task.
- Use the old model: "default" field from version 17.0.9. Issue #6438 shows that this field was not clear. It could replace the model in the agent file in error.
Source: can1357/oh-my-pi