fix: auto-restore pairing data from pre-update snapshot after hermes update#27702
Open
sgfdhgfnjgmhgmnfd657-sys wants to merge 1 commit into
Conversation
After `hermes update`, the gateway restart clears all platform pairing authorization (Issue NousResearch#15733). The pre-update quick snapshot backs up the pairing JSON files, but the update flow never restores them before the gateway restarts. This commit adds an auto-restore step after git pull + pip install complete, restoring `pairing/`, `platforms/pairing/` and `feishu_comment_pairing.json` from the pre-update snapshot before the gateway is restarted. The restore is defense-in-depth: even if the pairing JSONs survive the virtualenv rebuild or code change, this ensures they are always in the expected location that the newly started gateway code reads. Fixes: NousResearch#15733
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.
Problem
After
hermes update, the gateway restart clears platform pairing authorization (Issue #15733). All paired messaging users become "Unauthorized" until the operator manually runs/snapshot restore.The pre-update quick snapshot already backs up the pairing JSONs (
pairing/,platforms/pairing/,feishu_comment_pairing.json), but the update flow (_cmd_update_impl) never restores them before the gateway restarts.Fix
Insert an auto-restore step after
✓ Update complete!(post git pull + pip install) and before the gateway restart / curator notices. It:pre-updatequick snapshot~/.hermes/locationsThe restore is defense-in-depth: even if the JSONs survive the git pull + venv rebuild, this ensures they are always in the expected state when the newly started gateway validates authorization.
Testing
_QUICK_STATE_FILESincludes"pairing","platforms/pairing"and"feishu_comment_pairing.json"ast.parseCloses #15733