codex - 💡(How to fix) Fix Expose explicit rollback boundaries or cursors for app-server rewind

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…

Root Cause

Today, thread/rollback is difficult to use correctly from a non-TUI client because the public API exposes Thread.turns, while ThreadRollbackParams.num_turns is documented as the number of turns to drop from the end of the thread. That naturally suggests numTurns is measured in the returned app-server Thread.turns.

RAW_BUFFERClick to expand / collapse

What variant of Codex are you using?

0.130.0

What feature would you like to see?

I am building an internal client directly on top of the app-server API, and I would like to implement rewind/backtrack safely without relying on TUI-internal state.

Today, thread/rollback is difficult to use correctly from a non-TUI client because the public API exposes Thread.turns, while ThreadRollbackParams.num_turns is documented as the number of turns to drop from the end of the thread. That naturally suggests numTurns is measured in the returned app-server Thread.turns.

However, in fact app-server Turns are not always the same unit as core rollback boundaries. A raw Turn may contain multiple user messages, or no user/instruction rollback boundary at all. In those cases, a non-TUI client cannot safely infer the right rollback target from Thread.turns alone unless it also maintains a TUI-like transcript-cell / rollback-boundary model, as discussed in #23000

Feature request: please expose a non-breaking app-server API for safe rewind.

A possible direction would be:

  • thread/read includeTurns returns explicit rollback-boundary metadata or cursors;
  • rollback can target a boundary / item / cursor directly, instead of an overloaded numeric “turn” count;
  • the rollback response returns a transcript projection that is guaranteed to match the surviving core/model history.

The exact design is obviously up to the Codex team. The main ask is that non-TUI app-server clients should be able to implement rewind from the public API alone, without duplicating private TUI transcript-cell logic.

This would also help avoid current and future ambiguity around “turn” semantics.

For example, in multi-steer cases, the built-in TUI live rewind/model history can be correct, while app-server replay / thread/read includeTurns / resume / fork may render the surviving transcript as if more history had been dropped than the rewind actually removed. That is a transcript/replay correctness issue today, and it becomes harder for external app-server clients because they do not have the TUI’s internal cell model.

This may also matter more as Codex grows features such as goals or multi-agent-v2 flows, where raw app-server turns and rollback boundaries may diverge further.

I also noticed that the current Codex App appears to support editing only the last message. A more explicit rollback-boundary / cursor-based API could make richer rewind/edit behavior easier to support consistently across first-party and third-party clients.

Additional information

No response

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING