Skip to content

[openai-agents-python] breaking: remove the gates that kept 1.x runs replaying - #566

Merged
campoy merged 1 commit into
mainfrom
breaking/openai-agents-remove-pre-2-gates
Nov 16, 2026
Merged

campoy merged 1 commit into
mainfrom
breaking/openai-agents-remove-pre-2-gates

Conversation

@campoy

@campoy campoy commented Nov 16, 2026 •

Copy link
Copy Markdown
Contributor

What was changed

Three patches on main exist 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:

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.json and stateful-mcp-gather-wait-workflow-history.json. Why? A history with a marker and no matching patched() 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 every Runner.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:

A run on a main build 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

  1. No issue.

  2. How was this tested:

    • make format, make lint and make test for python/openai_agents on 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 without WAIT_CANCELLATION_COMPLETED), plus a CallerAgentWorkflow run still waiting on its model Activity. I recorded them on main, 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:

      • the three 1.x cases above: the committed 1.x caller-agent ([TMPRL1100]), run-model-provider (the plugin's ValueError) and stateful-mcp-gather-wait ([TMPRL1100]) histories, and the WAIT_CANCELLATION_COMPLETED gather recorded on 1.1.0 ([TMPRL1100]);
      • every history with a marker: the three committed on main and all seven recorded on main (every main agent run records openai_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 main and on 1.1.0. The caller-agent and WAIT_CANCELLATION_COMPLETED gather 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.

  3. Any docs updates needed? The README changes are here. The 2.0.0 release notes should list the replay cases above.

@campoy
campoy added this pull request to stack #567 November 16, 2026 02:10
@campoy campoy changed the title Breaking: openai_agents: remove the gates that kept 1.x runs replaying [openai-agents-python] breaking: remove the gates that kept 1.x runs replaying Nov 16, 2026
Base automatically changed from replay/major-scoped-histories to main November 16, 2026 18:15
@campoy
campoy force-pushed the breaking/openai-agents-remove-pre-2-gates branch from 92352bd to 6f3f121 Compare November 16, 2026 18:15
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
campoy force-pushed the breaking/openai-agents-remove-pre-2-gates branch from 6f3f121 to 4910e31 Compare November 16, 2026 18:23
@campoy
campoy marked this pull request as ready for review November 16, 2026 18:48
@campoy
campoy requested a review from a team as a code owner November 16, 2026 18:48
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.
@campoy
campoy merged commit 47a8992 into main Nov 16, 2026
29 checks passed
@campoy
campoy deleted the breaking/openai-agents-remove-pre-2-gates branch November 16, 2026 22:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants