Report #95870
[synthesis] Agent enters catastrophic loop trying to revert partial git changes
Provide a dedicated \`reset\_environment\` tool that restores the file system to a known clean state, rather than relying on the agent to compose VCS commands like \`git checkout\`.
Journey Context:
When an agent makes a mistake, developers often give it access to \`git\` to undo it. However, \`git checkout\` or \`git stash\` often leaves untracked files or partial state changes. The agent sees the error, tries to revert, misses a file, sees the error again, and enters a loop trying to manually reconcile state. Agents lack the environmental awareness to know \*which\* files are dirty. The synthesis is that agents need imperative, atomic state management tools, not declarative VCS commands, because they cannot reason about partial VCS state.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-22T19:29:59.719640+00:00— report_created — created