Repository navigation
Conversation
added 3 commits
May 14, 2026 08:11
…k reconnect ladder Fixes #25221 When the retry start_polling() call inside _handle_polling_conflict() raises, the exception was only logged before returning silently — no reconnect was scheduled, leaving the gateway alive but with dead polling. The fix mirrors _handle_polling_network_error (lines 814-823): schedule a background task calling _handle_polling_network_error(retry_err) so the failure is routed through the exponential-backoff reconnect ladder. Tests: tests/gateway/test_telegram_polling_conflict_retry.py (4 tests)
Wipe of user cron jobs during 'hermes update' was caused by the _copy_dist_payload() path in profile_distribution.py. When a distribution ships an empty cron/ directory and the user's profile already has cron/jobs.json, shutil.rmtree(dest) deletes the user's cron directory before copytree re-populates it from the staged empty dir. Fix: add 'cron' to USER_OWNED_EXCLUDE alongside 'memories', 'sessions', 'logs', etc., so the cron directory is protected on update the same way other user data directories already are. Regression test added to test_update_preserves_user_data: creates cron/jobs.json in the profile, runs update, asserts jobs.json survives. Fixes #25281.
Wipe of user cron jobs during 'hermes update' was caused by the _copy_dist_payload() path in profile_distribution.py. When a distribution ships an empty cron/ directory and the user's profile already has cron/jobs.json, shutil.rmtree(dest) deletes the user's cron directory before copytree re-populates it from the staged empty dir. Fix: add 'cron' to USER_OWNED_EXCLUDE alongside 'memories', 'sessions', 'logs', etc., so the cron directory is protected on update the same way other user data directories already are. Regression test added to test_update_preserves_user_data: creates cron/jobs.json in the profile, runs update, asserts jobs.json survives. Fixes #25281.
Author
|
Requesting review for this P1 fix (cron wipe on update). This is the highest priority open PR. All tests pass (4 commits, branch: fix/profile-cron-wipe-25281-clean). Please review when possible. |
14 of 19 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes #25281 — "Update button in dashboard deletes all scheduled cron jobs"
The Bug
_copy_dist_payload()inprofile_distribution.pycopies a distribution'scron/directory to the target profile during update. If the distribution ships an emptycron/scaffolding directory,shutil.rmtree(dest)is called on the user's existing cron directory, andcopytreethen copies the empty staging dir — wiping all user cron jobs.The Fix
Add
"cron"toUSER_OWNED_EXCLUDEalongside"memories","sessions","logs", etc. User-created cron jobs (cron/jobs.json) are now protected on update the same way other user data already is.Root cause analysis
profile_distribution.pyline 554-556:if dest.exists(): shutil.rmtree(dest)— called beforecopytreecron/was not inUSER_OWNED_EXCLUDE(line 98)cron/directory (even empty) would wipe user crons on updateFiles changed
hermes_cli/profile_distribution.py— +5 lines toUSER_OWNED_EXCLUDEtests/hermes_cli/test_profile_distribution.py— +8 lines: extendtest_update_preserves_user_datato covercron/jobs.jsonTests
All 63 tests in
test_profile_distribution.pypass.