Conversation
The 'list' command displayed hash_val[:8] (first 8 hex chars of the code's SHA-256 hash) under a 'Code' column. Operators copied that value and ran 'hermes pairing approve', which always failed with 'not found' because the fingerprint is not the approvable code. The real code is delivered via the bot's DM. - relabel the column to 'Request ID' and add a note pointing to the DM-sent code - make approve reject an 8-hex fingerprint input with a clear message instead of a cryptic 'not found' Reported symptom: pairing approval looped endlessly because the only code visible via CLI was a non-approvable hash.
tonydwb
left a comment
There was a problem hiding this comment.
Code Review Summary
Verdict: Approved
Straightforward UX fix that correctly renames the "Code" column to "Request ID" in hermes pairing list output, since the displayed value is the SHA-256 hash prefix — not the actual approvable code (which comes from the bot's DM). Also adds a helpful note explaining this distinction and includes a regex guard to reject the 8-char hex hash input and guide the operator to the correct code source. The test in the diff validates the rejection of hash-prefix input.
Reviewed by Hermes Agent
teknium1
left a comment
There was a problem hiding this comment.
Thanks for addressing a real CLI mismatch: current main labels a hash prefix as a code even though the DM contains the actual approvable value (hermes_cli/pairing.py:42-47, gateway/pairing.py:542-565).
Problems
hermes_cli/pairing.py:82rejects any eight-character hexadecimal input. That can be a valid generated code:gateway/pairing.py:43-44uses an eight-character alphabet containingA-Fand2-9, so a value such asABCDEF23is possible and should reachapprove_code().- The new
Request IDheading is not exact. The displayed field is a truncated hash prefix; the actual stored entry ID is generated separately (gateway/pairing.py:453-458,gateway/pairing.py:561-565).
Suggested changes
- Detect a displayed fingerprint by comparing against pending entries for the platform, not by matching its character shape; add a regression test that an all-hex valid code remains approvable.
- Rename the column to
Fingerprint/Hash prefix, or expose a real request ID if that is the intended contract.
Automated hermes-sweeper review.
| # 8 hex chars of the code's SHA-256 hash, NOT the approvable code. Reject | ||
| # hash-prefix input explicitly so operators don't chase a "wrong code" | ||
| # rabbit hole (the real code comes from the bot's DM). | ||
| if re.fullmatch(r"[0-9a-fA-F]{8}", code): |
There was a problem hiding this comment.
This guard also rejects legitimate pairing codes. gateway/pairing.py generates eight-character codes from an alphabet containing A-F and 2-9, so ABCDEF23 is valid and must reach approve_code(). Identify an input as a displayed fingerprint by comparing it with pending fingerprints, not by its shape.
| print(f"\n Pending Pairing Requests ({len(pending)}):") | ||
| print(f" {'Platform':<12} {'Code':<10} {'User ID':<20} {'Name':<20} {'Age'}") | ||
| print(f" {'--------':<12} {'----':<10} {'-------':<20} {'----':<20} {'---'}") | ||
| print(f" {'Platform':<12} {'Request ID':<10} {'User ID':<20} {'Name':<20} {'Age'}") |
There was a problem hiding this comment.
The displayed value is a truncated SHA-256 hash prefix, not the stored request entry ID (gateway/pairing.py:453-458, gateway/pairing.py:561-565). Fingerprint or Hash prefix would be accurate here.
|
Your diagnosis was right: the value under "Code" is a hash fingerprint that can never be approved, and operators were looping on it. #74427 fixes it structurally rather than by relabeling — pending entries now carry a real |
Problem
hermes pairing listdisplayedhash_val[:8](the first 8 hex chars of thepairing code's SHA-256 hash) under a column labeled "Code". Operators
reasonably copied that value and ran
hermes pairing approve <platform> <code>,which always failed with "Code '…' not found or expired" — the fingerprint is
never an approvable code. The real code is only delivered via the bot's DM.
This produced an endless approval loop (verified symptom: the same user
generated a fresh pending code on every DM, each showing a different
non-approvable fingerprint).
Fix
list: relabel the column to "Request ID" and add a note pointing theoperator to the DM-sent code.
approve: reject an 8-hex fingerprint input explicitly with guidance insteadof the cryptic "not found" error.
Verification
Local import + stubbed
gateway.pairing: an 8-hex fingerprint input isrejected without calling
approve_code, and prints the corrective message.Syntax + static checks pass. No token/secret touched.
Note
The fix only affects CLI ergonomics for authorizing new users; existing
approved users are unaffected.