Skip to content

[codex] Add rollback context duplication snapshot#15562

Merged
charley-oai merged 2 commits intomainfrom
codex/rollback-context-duplication-snapshot
Mar 23, 2026
Merged

[codex] Add rollback context duplication snapshot#15562
charley-oai merged 2 commits intomainfrom
codex/rollback-context-duplication-snapshot

Conversation

@charley-oai
Copy link
Copy Markdown
Contributor

@charley-oai charley-oai commented Mar 23, 2026

What changed

  • adds a targeted snapshot test for rollback with contextual diffs in codex_tests.rs
  • snapshots the exact model-visible request input before the rolled-back turn and on the follow-up request after rollback
  • shows the duplicate developer and environment context pair appearing again before the follow-up user message

Why

Rollback currently rewinds the reference context baseline without rewinding the live session overrides. On the next turn, the same contextual diff is emitted again and duplicated in the request sent to the model.

Impact

  • makes the regression visible in a canonical snapshot test
  • keeps the snapshot on the shared context_snapshot path without adding new formatting helpers
  • gives a direct repro for future fixes to rollback/context reconstruction
Co-authored-by: Codex <noreply@openai.com>
@charley-oai charley-oai marked this pull request as ready for review March 23, 2026 21:28
03:message/assistant:turn 1 assistant
04:message/developer:<collaboration_mode>ROLLED_BACK_DEV_INSTRUCTIONS</collaboration_mode>
05:message/user:<ENVIRONMENT_CONTEXT:cwd=PRETURN_CONTEXT_DIFF_CWD>
06:message/developer:<collaboration_mode>ROLLED_BACK_DEV_INSTRUCTIONS</collaboration_mode>
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is the duplicate context bug 😢

@charley-oai
Copy link
Copy Markdown
Contributor Author

@codex review

@chatgpt-codex-connector
Copy link
Copy Markdown
Contributor

Codex Review: Didn't find any major issues. Swish!

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Co-authored-by: Codex <noreply@openai.com>
@charley-oai
Copy link
Copy Markdown
Contributor Author

@codex review

@chatgpt-codex-connector
Copy link
Copy Markdown
Contributor

Codex Review: Didn't find any major issues. More of your lovely PRs please.

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@charley-oai charley-oai merged commit 0f34b14 into main Mar 23, 2026
32 of 35 checks passed
@charley-oai charley-oai deleted the codex/rollback-context-duplication-snapshot branch March 23, 2026 22:36
@github-actions github-actions bot locked and limited conversation to collaborators Mar 23, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

2 participants