Context Pollution When Reverting a Task
What version of Codex is running?
0.5.39
What subscription do you have?
Context Pollution When Reverting a Task
Which model were you using?
codex
What platform is your computer?
mac + vscode + codex.ide.ext
What issue are you seeing?
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.
What steps can reproduce the bug?
revert task
What is the expected behavior?
_No response_
Additional information
_No response_
4 Comments
Potential duplicates detected. Please review them and close your issue if it is a duplicate.
Powered by Codex Action
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:
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.
Closing out old bugs.