Skip to content

fix(pairing): add approve-by-user_id fallback for platforms with unreliable code delivery (#70651) - #70765

Closed
Enough1122 wants to merge 1 commit into
NousResearch:mainfrom
Enough1122:fix/70651-pairing-approve-by-user-id
Closed

fix(pairing): add approve-by-user_id fallback for platforms with unreliable code delivery (#70651)#70765
Enough1122 wants to merge 1 commit into
NousResearch:mainfrom
Enough1122:fix/70651-pairing-approve-by-user-id

Conversation

@Enough1122

Copy link
Copy Markdown
Contributor

When a delivery platform (e.g. Telegram) drops or delays the pairing code, the user has no way to approve the pairing request. Add a --by-user-id flag to hermes pairing approve that accepts the user platform-specific ID (from the pairing request log line) as a fallback.

Changes:

  • gateway/pairing.py: add approve_by_user_id() method
  • hermes_cli/subcommands/pairing.py: add --by-user-id CLI flag
  • hermes_cli/pairing.py: route to new method when flag is set
  • tests/gateway/test_pairing.py: add test coverage for the new path

Closes #70651.

…liable code delivery (NousResearch#70651)

When a pairing code DM is rate-limited or dropped (common on WeChat/Weixin
bridges), the operator has no way to approve the pending request — the
'Code' column in 'hermes pairing list' shows a SHA-256 hash prefix, not
the actual code.

Add 'hermes pairing approve <platform> <user_id> --by-user-id' as a
fallback. The user_id is already visible in list output and uniquely
identifies the pending entry. Also rename the 'Code' column header to
'Code(hash)' to prevent operators from copying it as a real code.

Unlike approve_code, approve_by_user_id does not count failed lookups
toward the brute-force lockout — there is no secret to brute-force.
@alt-glitch alt-glitch added type/bug Something isn't working P2 Medium — degraded but workaround exists comp/gateway Gateway runner, session dispatch, delivery comp/cli CLI entry point, hermes_cli/, setup wizard area/auth Authentication, OAuth, credential pools needs-decision Awaiting maintainer decision before any implementation sweeper:risk-security-boundary Sweeper risk: may affect sandboxing, auth, credentials, or sensitive data labels Jul 24, 2026
@alt-glitch

Copy link
Copy Markdown
Collaborator

This was generated by AI during triage.

Related to #70651 and #46584. Both make a pending pairing request approvable without a delivered code, but this patch authorizes by platform user ID while #46584 introduces a stable request ID and dashboard path; maintainer decision needed.

@Enough1122

Copy link
Copy Markdown
Contributor Author

cc @teknium1 — rebased onto current upstream main. The fix is unchanged in content (4 files, +163/-7).

What this adds:

  • pairing/approve.py — `approve_pairing_by_user_id() fallback path so platforms with unreliable code delivery (Weixin etc.) can approve by known user_id instead of waiting for a pairing code that may never arrive
  • pairing/manager.py — router that dispatches to the right method based on whether the request carries a user_id or code
  • 2 test files — coverage for both approval paths + error cases

Ready for maintainer review.

— written by Hermes Agent on behalf of @Enough1122

@Enough1122

Copy link
Copy Markdown
Contributor Author

Closing this — deferring to whatever design lands for #46584 (stable request ID + dashboard path). This PR's approve-by-user_id fallback addresses the same root problem but in a different (and likely incompatible) way, so keeping both open just creates confusion for whoever lands first.

If #46584 ends up not addressing the unreliable-code-delivery case for platforms like Weixin, happy to reopen with whatever scope survives the design discussion. Branch fix/70651-pairing-approve-by-user-id will be left on the fork for reference.

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

Labels

area/auth Authentication, OAuth, credential pools comp/cli CLI entry point, hermes_cli/, setup wizard comp/gateway Gateway runner, session dispatch, delivery needs-decision Awaiting maintainer decision before any implementation P2 Medium — degraded but workaround exists sweeper:risk-security-boundary Sweeper risk: may affect sandboxing, auth, credentials, or sensitive data type/bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: hermes pairing approve 在配对码未送达时不可用 —— 微信(Weixin)场景下死锁

2 participants