You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Description:
When reverting a task, the context does not properly clear the data from the previously reverted task, which leads to context pollution. This issue causes incorrect behavior or unexpected results due to lingering context data from previous tasks.
Steps to Reproduce:
Create and run a task using Codex.
Revert a previously executed task.
Observe that the context from the previous task is not cleared, leading to polluted context data.
The lingering context data affects the execution of the current task.
Expected Behavior:
When reverting a task, the context should be properly reset or cleared to avoid any contamination from previous tasks.
Actual Behavior:
The context is not cleared when reverting a task, causing context pollution and potentially impacting the task's execution.
Environment:
Codex version: [Include the version you are using]
Operating system: [Include your operating system details]
Python version: [Include the Python version used, if applicable]
Additional Information:
If possible, a potential fix could involve ensuring that the context is explicitly cleared when reverting a task or creating a new task. This would prevent any remnants from a previous task from interfering with subsequent ones.
When you say "revert a previously executed task", what do you mean? What actions are you taking to perform the revert? Are you asking the model to revert its work? Are you click on the "Undo" in the code diff summary?
When you say "revert a previously executed task", what do you mean? What actions are you taking to perform the revert? Are you asking the model to revert its work? Are you click on the "Undo" in the code diff summary?
Thank you for your reply! I'd like to clarify what I mean by “revert previously executed task”.
In my view, the revert behavior of a task should follow the Cursor processing logic:
✅ Expected behavior
When a task is confirmed reverted, the system should:
Simultaneously remove all information generated by this task in the context (including the model's internal task context, reasoning chain, implicit state, etc.);
Not only revert the code diff, but also revert any implicit context effect brought by the task.
Otherwise, although the code diff is reverted, the internal context of the model has not been rolled back together, leading to later tasks experiencing context pollution — i.e., the code was reverted but the context is still dirty.
✅ Suggest supporting two types of rollback
In practice, there are two common scenarios:
Full revert of the task (code + model context) → similar to Cursor's “Revert Task”
Only undo the code diff, without touching the context → similar to an editor's Undo or manually reverting code
The issue I encountered is:
Although the code diff was rolled back, the context residue created by that task in history was not cleaned up together, which causes abnormal behavior in subsequent tasks.
Activity
github-actions commentedon Nov 12, 2025
Potential duplicates detected. Please review them and close your issue if it is a duplicate.
Powered by Codex Action
etraut-openai commentedon Nov 13, 2025
When you say "revert a previously executed task", what do you mean? What actions are you taking to perform the revert? Are you asking the model to revert its work? Are you click on the "Undo" in the code diff summary?
LucasInsight commentedon Nov 17, 2025
Thank you for your reply! I'd like to clarify what I mean by “revert previously executed task”.
In my view, the revert behavior of a task should follow the Cursor processing logic:
✅ Expected behavior
When a task is confirmed reverted, the system should:
Otherwise, although the code diff is reverted, the internal context of the model has not been rolled back together, leading to later tasks experiencing context pollution — i.e., the code was reverted but the context is still dirty.
✅ Suggest supporting two types of rollback
In practice, there are two common scenarios:
The issue I encountered is:
Although the code diff was rolled back, the context residue created by that task in history was not cleaned up together, which causes abnormal behavior in subsequent tasks.
etraut-openai commentedon Jan 17, 2026
Closing out old bugs.