fix(pairing): store plaintext code so list_pending shows approvable value - #46630
Closed
liuhao1024 wants to merge 1 commit into
Closed
fix(pairing): store plaintext code so list_pending shows approvable value#46630liuhao1024 wants to merge 1 commit into
liuhao1024 wants to merge 1 commit into
Conversation
…alue list_pending() was displaying hash_val[:8] as the "code" but approve_code() expects the original plaintext code. Operators copying the displayed value into ``hermes pairing approve`` got "Code not found or expired" and eventually triggered lockout. Store the plaintext code alongside the hash in generate_code() and return it from list_pending(). Legacy entries without a ``code`` key gracefully fall back to hash[:8]. Fixes NousResearch#46580
Contributor
Author
|
Closing as duplicate of #46584 by @itsflownium, which implements the same fix with a more comprehensive approach (stable request ID, dashboard UI updates, full test coverage). That PR was opened earlier (2026-06-15T10:20Z) and has all CI checks passing. Our approach stored the plaintext code directly but failed to update the existing |
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.
What does this PR do?
Fixes
hermes pairing listdisplaying a hash prefix instead of the actual pairing code. The displayed value could not be used withhermes pairing approve, causing "Code not found or expired" errors and eventual lockout.Related Issue
Fixes #46580
Type of Change
Changes Made
gateway/pairing.py: Store plaintext code in pending entry duringgenerate_code(); updatelist_pending()to return the stored code instead ofhash[:8]; add backward-compatible fallback for legacy entries without acodekey.tests/test_pairing_code_display.py: 4 tests — code-is-approvable round-trip, code format validation, legacy-entry fallback, multi-platform correctness.How to Test
hermes pairing list— the Code column now shows the actual code sent to the userhermes pairing approve telegram <displayed-code>— should succeed without lockoutcodefield)Checklist
Code
fix(scope):,feat(scope):, etc.)pytest tests/ -qand all tests passDocumentation & Housekeeping
docs/, docstrings) — or N/Acli-config.yaml.exampleif I added/changed config keys — or N/ACONTRIBUTING.mdorAGENTS.mdif I changed architecture or workflows — or N/ACode Intelligence
gateway/pairing.py—PairingStore.generate_code(),PairingStore.list_pending(),PairingStore.approve_code()list_pending():hermes_cli/pairing.py::_cmd_list(),hermes_cli/web_server.py::list_pairing()