Repository navigation
[openai-agents-python] breaking: remove the gates that kept 1.x runs replaying - #566
Merged
Merged
Conversation
campoy
force-pushed
the
breaking/openai-agents-remove-pre-2-gates
branch
from
November 16, 2026 18:15
92352bd to
6f3f121
Compare
Replay is promised only within a major, so 2.0 doesn't need the three patches that only kept runs from before their fixes replaying: openai_agents.refuse-run-model-provider (#204), openai-agents-stateful-mcp-session-watch (#373) and openai_agents.run-caller-agents (#426). Every run now takes the new path: RunConfig.model_provider is refused, stateful MCP operations without a timeout watch their session, and runs use your agents, not copies. _convert_agent and the tests that only covered the agent copies go too. The three 2.x histories that had patch markers are recorded again without them, since a marker with no matching patched() call fails replay.
campoy
force-pushed
the
breaking/openai-agents-remove-pre-2-gates
branch
from
November 16, 2026 18:23
6f3f121 to
4910e31
Compare
campoy
marked this pull request as ready for review
November 16, 2026 18:48
xumaple
approved these changes
Nov 16, 2026
campoy
added a commit
that referenced
this pull request
Nov 16, 2026
…watch gate before 2.0 (#587) ## What was changed The next OpenAI Agents TypeScript release is 2.0.0, so its current major is 2, and replay is promised only within a major. The `openai-agents-stateful-mcp-session-watch` patch from #373 only keeps 1.x runs scheduling operations without a schedule-to-start timeout the old way, so let's remove it before 2.0. Such operations always watch their session now. #566 removes the same gate from the Python plugin. The `2.x/` caller-cancel history had the patch marker, so I recorded it again without it as `stateful-mcp-caller-cancel.json`. Why? A history with a marker and no matching `patched()` call fails replay with `[TMPRL1100] Non-deprecated patch marker encountered`. The README drops the marker note and says which 1.x runs don't replay. ## What will you notice? (Breaking) Some 1.x runs with stateful MCP operations that had `scheduleToStartTimeout: 0` don't replay on 2.0. For example, a run whose caller cancelled operations on two servers, one of them with `scheduleToStartTimeout: 0`, fails with `[TMPRL1100]` because its follow-up Activities come in another order. Let such runs finish on 1.x Workers before you upgrade, or keep them there with Worker Versioning. A run on a `main` build since #373 that scheduled such an operation recorded the marker, so it doesn't replay either. No release wrote that marker. ## Why? We decided that replay is promised only within a major, and that a gate that only protects an older major's runs is removed before the next major ships. OpenAI Agents TypeScript's next release is 2.0.0, so this gate goes before it. ## Checklist 1. No issue. 2. How was this tested: - `make lint` and `make test` for `typescript/openai-agents`, in Docker with Node 24: 335 tests passed. Lint shows the same 8 warnings as on #565, in files this PR doesn't touch. - Replay, across builds. I recorded the caller-cancel run on #565 and on this PR with #373's recorder, which keeps both sessions open and cancels the caller while both calls are queued. Then I replayed both, the four committed 1.x histories, the committed `2.x/` marker history and a history with a renamed Activity on both builds. - On this PR, only these fail, each with `[TMPRL1100]`: the run from #565 and the committed marker history (`Non-deprecated patch marker encountered`), the 1.x caller-cancel history, and the renamed Activity. The other three 1.x histories replay (a gather with and without `scheduleToStartTimeout: 0`, and a cancel with it), and so does this PR's run. - Rollback to #565: this PR's caller-cancel run fails with `[TMPRL1100]`, because the old path resumes the follow-ups in the other order. 3. Any docs updates needed? The README changes are here.
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
Three patches on
mainexist only to keep runs from before their fixes replaying. No release wrote their markers: PyPI has 1.0.0 and 1.1.0, and both shipped before these fixes. With replay promised only within a major (#565), 2.0.0 doesn't need them. So let's remove them before it ships:openai_agents.refuse-run-model-provider(Breaking: refuse RunConfig.model_provider in OpenAI Agents workflows #204):Runner.runalways refusesRunConfig.model_provider.openai-agents-stateful-mcp-session-watch(Breaking: fail a retried OpenAI Agents stateful MCP session instead of opening an empty one #373): a stateful MCP operation with neither a schedule-to-start nor a schedule-to-close timeout always watches its session.openai_agents.run-caller-agents(Breaking: openai_agents: run your agents, not copies, so permanent approvals carry over #426): runs always use your agents, not copies._convert_agentgoes, and so dotest_model_conversion_loopsand the four run-state tests that called it directly.The three 2.x histories that had markers are recorded again without them, as
caller-agent-workflow-history.json,stateful-mcp-cancel-wait-workflow-history.jsonandstateful-mcp-gather-wait-workflow-history.json. Why? A history with a marker and no matchingpatched()call fails replay with[TMPRL1100] Non-deprecated patch marker encountered.The Python README drops the marker notes and says which 1.x runs don't replay. The TypeScript README keeps its note on
openai-agents-stateful-mcp-session-watch: TypeScript has its own copy of that gate, and this PR doesn't touch it.This also takes
workflow.patched()out of everyRunner.run. That call is what exposed the sdk-core bug where a run whose first Update was rejected fails its own replay.What will you notice? (Breaking)
These 1.x runs don't replay on 2.0. Let them finish on 1.x Workers before you upgrade, or keep them there with Worker Versioning. For the release notes:
RunConfig.model_provider(Breaking: refuse RunConfig.model_provider in OpenAI Agents workflows #204). On 1.x it ran on the Worker's provider. On 2.0 its replay fails with theValueErrorthat refuses the provider.cancellation_type=WAIT_CANCELLATION_COMPLETEDand neither timeout finished in the same Workflow Task as another Activity (Breaking: fail a retried OpenAI Agents stateful MCP session instead of opening an empty one #373). On 2.0 the operation resolves one step later, so the run schedules its next Activities in another order ([TMPRL1100]).[TMPRL1100]).A run on a
mainbuild that reached one of these gates recorded its marker, and it doesn't replay either. No release wrote those markers.Rolling back to 1.x isn't promised either: histories of 2.0 runs that hit the last two cases fail on 1.1.0 with
[TMPRL1100].Why?
We decided that replay is promised only within a major, and that a gate that only protects an older major's runs is removed before the next major ships. These three only protect runs from before their fixes, so they go before 2.0.0.
Checklist
No issue.
How was this tested:
make format,make lintandmake testforpython/openai_agentson Python 3.12: 618 passed, 2 skipped.Replay, across builds. I recorded finished runs on Workers with no Workflow cache (a hello agent,
CallerAgentWorkflow, and the four stateful MCP replay shapes, with and withoutWAIT_CANCELLATION_COMPLETED), plus aCallerAgentWorkflowrun still waiting on its model Activity. I recorded them onmain, on this PR, and the stateful MCP ones on 1.1.0 too. Then I replayed each of them, and the committed histories, on every build.On this PR, only these fail:
caller-agent([TMPRL1100]),run-model-provider(the plugin'sValueError) andstateful-mcp-gather-wait([TMPRL1100]) histories, and theWAIT_CANCELLATION_COMPLETEDgather recorded on 1.1.0 ([TMPRL1100]);mainand all seven recorded onmain(everymainagent run recordsopenai_agents.run-caller-agents), each with[TMPRL1100] Non-deprecated patch marker encountered.The other nine committed 1.x histories replay, and so do the 1.1.0 cancel runs, with and without
WAIT_CANCELLATION_COMPLETED, and the 1.1.0 gather run without it. Everything recorded on this PR replays on it.Rollback: this PR's histories on
mainand on 1.1.0. The caller-agent andWAIT_CANCELLATION_COMPLETEDgather histories fail with[TMPRL1100]; the rest replay, including the waiting run. I didn't carry a live run from one build to another.Control: a history with a renamed Activity fails with
[TMPRL1100]on every build.Any docs updates needed? The README changes are here. The 2.0.0 release notes should list the replay cases above.