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
{{ message }}
Repository navigation
Windows 1.2.20: Agent edits stop showing Modified Files and /undo does not restore files #16391
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:
This suggests the regression introduced by 74effa8eec01b3cb816178a37921333420fe2d82:
the worker ends up with Path, but not PATH
which("git") returns null
Bun.which("git") still finds Git
git --version still 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.
changed the title [-]Windows: worker loses git detection in 1.2.20, breaking Modified Files and /undo[/-][+]Windows 1.2.20: Agent edits stop showing Modified Files and /undo does not restore files[/+]on Mar 6, 2026
Activity
[-]Windows: worker loses git detection in 1.2.20, breaking Modified Files and /undo[/-][+]Windows 1.2.20: Agent edits stop showing Modified Files and /undo does not restore files[/+]Hona commentedon Mar 7, 2026
I believe I fixed this for you - is that why you closed the issue? :)
yeyaowei commentedon Mar 8, 2026
@Hona Yes 😄 Been keeping an eye on the latest commits 👀 #16422
Thanks for the quick fix!