Repository navigation
openai_agents: keep RunConfig.model as a name so the run model's defaults apply - #458
Merged
campoy merged 1 commit intoNov 9, 2026
Conversation
…args The runner no longer turns a string RunConfig.model into a model stub. The plugin's model provider already turns the name into the model Activity, so the SDK now applies the run model's default settings, as it does natively, and a SandboxAgent's Compaction gets the run model's threshold. When the model Activity swaps an agent's implicit default settings for the defaults of the model its provider picks, it now keeps the extra_args that a SandboxAgent's capabilities add, such as the compaction threshold.
JasonSteving99
marked this pull request as ready for review
November 9, 2026 23:25
JasonSteving99
approved these changes
Nov 9, 2026
campoy
merged commit Nov 9, 2026
ec4ee7b
into
fix/openai-agents-run-agent-without-copy
37 checks passed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What was changed
Depends on #426. This PR targets #426's branch, so the diff shows only this change. Once #426 merges, I'll point it at
main.RunConfig.modelstays a name. The runner no longer wraps a stringRunConfig.modelin a_TemporalModelStub. Why was the stub there? To swap in Temporal's model. But the plugin's model provider already turns every model name into the model Activity, the same reason Breaking: openai_agents: run your agents, not copies, so permanent approvals carry over #426 dropped the agent copies. With the name in place, the SDK applies the run model's default settings, as it does without the plugin. A model that isn't a string still fails with the same error.extra_args. When an agent is left at its default model settings, the model Activity swaps them for the defaults of the model its provider picks. That swap droppedextra_args, so aSandboxAgent's compaction threshold got lost. Now it stays.Why?
#426 runs your agents, not copies, so the SDK finally sees each agent's model name. Its description lists two gaps it leaves "as before". This PR closes both.
What will you notice?
RunConfig(model="gpt-5.4-pro")and an agent at its default settings, the model call now gets the defaults forgpt-5.4-pro, likereasoning.effort="medium". That's upstream's rule. Before, it got none.SandboxAgentwith aCompactioncapability gets the run model's threshold whenRunConfig.modelis set. When neither the agent norRunConfignames a model, it keeps its compaction threshold instead of losing it.What about replay? Model calls keep the same Activity type. With
RunConfig.modelset, their summary is now the agent's name, as for other runs, where it was empty. Replay doesn't compare summaries, and a run recorded on #426 withRunConfig.modelset replays on this change. Replay doesn't compare Activity inputs, so a run that now sends different model settings replays and continues with them.Checklist
Closes: no issue.
How was this tested:
test_run_model_gets_its_own_default_settingsruns an agent with no model underRunConfig(model="gpt-5.4-pro")and checks that the model gets that model's default settings.test_alignment_keeps_extra_argschecks that a compactionextra_argsentry survives the swap to the provider model's defaults.make lintandmake testpass with openai-agents 0.24.0 (533 passed, 1 skipped).