-
Notifications
You must be signed in to change notification settings - Fork 12k
Description
Description
On Windows in 1.2.20, when Agent edits files in a Git repository, the TUI no longer shows Modified Files, and /undo only rewinds the conversation state while leaving the edited files unchanged.
This worked in 1.2.19. I also confirmed locally that reverting commit 74effa8eec01b3cb816178a37921333420fe2d82 on top of 1.2.20 restores the previous behavior.
OpenCode version
1.2.20
Steps to reproduce
- On Windows PowerShell, open a Git repository with OpenCode
1.2.20. - Ask the Agent to modify a file.
- Observe that the TUI sidebar does not show
Modified Files. - Run
/undo. - Observe that the conversation rewinds, but the edited file is not restored.
Expected behavior
Agent edits should appear under Modified Files, and /undo should restore the file changes from the last step.
Actual behavior
The sidebar shows no Modified Files, and /undo only rewinds the conversation state.
Screenshot and/or share link
N/A
Operating System
Windows 11
Terminal
PowerShell 7
Additional investigation from a local instrumented build
This section is only diagnostic evidence. It is not required for reproduction.
I added a small local probe to log the worker environment and git detection path:
console.log({
PATH: process.env.PATH ?? null,
Path: process.env.Path ?? null,
which_git: which("git"),
bun_git: Bun.which("git") ?? null,
git: await Process.run(["git", "--version"], { nothrow: true }),
})Relevant result from the worker process:
{
"PATH": null,
"Path": "...;C:\\Program Files\\Git\\cmd;...",
"which_git": null,
"bun_git": "C:\\Program Files\\Git\\cmd\\git.exe",
"git": {
"code": 0,
"stdout": "git version 2.53.0.windows.1\n"
}
}This suggests the regression introduced by 74effa8eec01b3cb816178a37921333420fe2d82:
- the worker ends up with
Path, but notPATH which("git")returnsnullBun.which("git")still finds Gitgit --versionstill works
That makes project detection fall back to non-git mode, which skips snapshots. Once snapshots are skipped, Modified Files disappears and /undo can no longer restore edited files.
Note: this issue text was generated by GPT 5.4 and reviewed against a local repro.