Skip to content

fix(update): prompt before resetting working tree on stash conflicts#2390

Merged
teknium1 merged 1 commit intomainfrom
hermes/hermes-baa39faf
Mar 21, 2026
Merged

fix(update): prompt before resetting working tree on stash conflicts#2390
teknium1 merged 1 commit intomainfrom
hermes/hermes-baa39faf

Conversation

@teknium1
Copy link
Copy Markdown
Contributor

Summary

When hermes update stashes local changes and the restore hits conflicts, the previous behavior silently ran git reset --hard HEAD. Users could lose their working tree state without realizing it.

Now the conflict handler:

  • Lists the specific conflicted files
  • Reassures the user their stash is preserved
  • Asks before resetting (in interactive mode)
  • Auto-resets in non-interactive mode (prompt_user=False)
  • If the user declines, leaves the working tree as-is with guidance on manual resolution

Inspired by the autostash improvements in PR #2370 (which bundled this with an unrelated prompt_caching change).

Test plan

  • Full test suite passes (5775 passed)
  • 3 new tests: prompt+accept, prompt+decline, auto-reset non-interactive
When 'hermes update' stashes local changes and the restore hits
conflicts, the previous behavior silently ran 'git reset --hard HEAD'
to clean up. This could surprise users who didn't realize their
working tree was being nuked.

Now the conflict handler:
- Lists the specific conflicted files
- Reassures the user their stash is preserved
- Asks before resetting (interactive mode)
- Auto-resets in non-interactive mode (prompt_user=False)
- If declined, leaves the working tree as-is with guidance
@teknium1 teknium1 merged commit c57d5cb into main Mar 21, 2026
1 check passed
outsourc-e pushed a commit to outsourc-e/hermes-agent that referenced this pull request Mar 26, 2026
…ousResearch#2390)

When 'hermes update' stashes local changes and the restore hits
conflicts, the previous behavior silently ran 'git reset --hard HEAD'
to clean up. This could surprise users who didn't realize their
working tree was being nuked.

Now the conflict handler:
- Lists the specific conflicted files
- Reassures the user their stash is preserved
- Asks before resetting (interactive mode)
- Auto-resets in non-interactive mode (prompt_user=False)
- If declined, leaves the working tree as-is with guidance
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

1 participant