Skip to content

fix(cli): add timeout to git stash during update - #909

Open
hashbender wants to merge 1 commit into
mainfrom
mirror/pr-57134
Open

fix(cli): add timeout to git stash during update#909
hashbender wants to merge 1 commit into
mainfrom
mirror/pr-57134

Conversation

@hashbender

Copy link
Copy Markdown
Owner

What does this PR do?

Add a 120-second timeout to git stash push --include-untracked in the update flow. On Windows, this command can hang indefinitely when files are locked by other processes (antivirus, gateway, etc.), causing hermes update to appear stuck for hours.

When the timeout is reached, the update proceeds without stashing and prints guidance for manual stash/reset.

Related Issue

Fixes NousResearch#57081

Type of Change

  • 🐛 Bug fix (non-breaking change that fixes an issue)

Changes Made

  • hermes_cli/main.py: Added timeout=120 to the git stash push --include-untracked subprocess call in _stash_local_changes_if_needed(). Catches subprocess.TimeoutExpired and returns None (skip stashing) with actionable guidance.
  • tests/hermes_cli/test_update_autostash.py: Added test_stash_local_changes_if_needed_returns_none_on_timeout verifying the timeout behavior.

How to Test

  1. Run pytest tests/hermes_cli/test_update_autostash.py -q — all 34 tests should pass.
  2. On a system with locked files (e.g., Windows with antivirus scanning), hermes update should no longer hang indefinitely. After 120s, it prints a warning and proceeds.

Checklist

Code

  • I've read the Contributing Guide
  • My commit messages follow Conventional Commits (fix(scope):, feat(scope):, etc.)
  • I searched for existing PRs to make sure this isn't a duplicate
  • My PR contains only changes related to this fix/feature (no unrelated commits)
  • I've run pytest tests/ -q and all tests pass
  • I've added tests for my changes (required for bug fixes, strongly encouraged for features)
  • I've tested on my platform: macOS 26.4.1

Documentation & Housekeeping

  • I've updated relevant documentation (README, docs/, docstrings) — or N/A
  • I've updated cli-config.yaml.example if I added/changed config keys — or N/A
  • I've updated CONTRIBUTING.md or AGENTS.md if I changed architecture or workflows — or N/A
  • I've considered cross-platform impact (Windows, macOS) per the compatibility guide — or N/A
  • I've updated tool descriptions/schemas if I changed tool behavior — or N/A

Mirror-of: NousResearch#57134
NousResearch#57134

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: stuck on update for 7 hours, windows

1 participant