Description
According to the documentation (and the types), it should be possible to provide default values for model
etc. using a custom Runner
instance. The values can be set (type safe), but the Agents do not respect them and fall back to their own default values (e.g. for the model it is gpt-4.1-2025-04-14
).
Furthermore, the documentation says Force a specific model for all agents in the run.
which is likely not what we want here. I would assume to set defaults via the Runner
and have the option to overwrite the values via Agent
.
Also the workflowName
is not propagated to the tracing (tracing always shows Agent workflow
).
Debug information
- Agents SDK version: (e.g.
v0.0.8
) - Runtime environment (e.g.
Bun 1.2.16
)
Repro steps
import { Agent, Runner } from "@openai/agents";
async function main() {
// Create an Agent without model defined
const agent = new Agent({
name: "TestAgent",
instructions: "You are a test agent. Respond with the model name.'",
// model is intentionally not defined
});
// Run the agent - model should be configured by the runner
const runner = new Runner({
workflowName: "Bug Report",
model: "gpt-4.1-nano",
});
const result = await runner.run(agent, "What model are you using?");
console.log("Response:", result.finalOutput);
}
main().catch(console.error);
Expected behavior
Given the example, I would expect the TestAgent
to use the model gpt-4.1-nano-2025-04-14
(confirmed by setting it directly on the Agent), but according to the tracing it uses gpt-4.1-2025-04-14
. Furthermore, I would expect the tracing to show Bug Report
as workflow name of the trace, but it shows Agent workflow
.
The documentation should better explain that the Runner
provides the defaults (up for discussion).