Skip to content

Bug: Codex deleted unstaged changes outside the requested edit scope. #13099

@xxmuyou

Description

@xxmuyou

What version of the IDE extension are you using?

0.4.79

What subscription do you have?

I am not a paying user yet.

Which IDE are you using?

VS Code

What platform is your computer?

No response

What issue are you seeing?

I encountered a severe data loss issue where the extension performed a destructive overwrite of my local files. When I requested a localized edit for a specific code block, the tool completely discarded all my uncommitted Git changes (unstaged and staged) in the file/workspace, reverting or overwriting them without any confirmation or backup.

What steps can reproduce the bug?

It appears the tool might be relying on Git reference points to manage file states during edits. This is fragile when the workspace has "dirty" (uncommitted) changes. I‘m Not sure about the base logical of your coding IDE extension.

Instead of anchoring to Git, the extension should leverage the IDE's internal Document/Buffer model (similar to how 'Local History' functions). The AI's output should be treated as a partial buffer update rather than a full file overwrite based on the last known Git commit. This would ensure that localized edits remain localized and do not interfere with unstaged manual work.

What is the expected behavior?

No response

Additional information

The editing permissions should be very clear, rather than vaguely defined. I feel that Codex often oversteps its authority, which makes me very uneasy.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingextensionIssues related to the VS Code extensionmodel-behaviorIssues related to behaviors exhibited by the model

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions