fix(discord): name missing privileged intents and stop reconnect loop - #79448
Closed
astraltrekkin wants to merge 1 commit into
Closed
astraltrekkin wants to merge 1 commit into
astraltrekkin wants to merge 1 commit into
Conversation
PrivilegedIntentsRequired is a Developer Portal config error; surface which intents Hermes requested as a non-retryable fatal and teach setup/docs. Co-authored-by: Cursor <cursoragent@cursor.com>
teknium1
added a commit
that referenced
this pull request
Aug 13, 2026
The cherry-picked #79448 predated #85049's _classify_connect_exception, so it added a parallel PrivilegedIntentsRequired branch ahead of the classifier (plus its own _is_privileged_intents_required detector). Fold the tailored guidance into the classifier's existing intents arm instead: one classification path, one error code (discord_intents_required), and the message now names exactly the intents Hermes requested (Message Content always; Server Members only when username/role allowlists need it). Wizard callout, docs corrections, and tests from #79448 kept as-is.
Collaborator
|
Merged via PR #85108 (#85108) — your commit was cherry-picked onto current main with your authorship preserved in git history. Thanks for a genuinely user-centered fix: the members-intent predicate, the tailored guidance text, the wizard callout, and catching the docs telling people to enable Presence Intent were all kept. One adaptation during salvage: #85049 landed a type-based connect classifier ( |
skappafrost
pushed a commit
to skappafrost/hermes-agent
that referenced
this pull request
Aug 15, 2026
The cherry-picked NousResearch#79448 predated NousResearch#85049's _classify_connect_exception, so it added a parallel PrivilegedIntentsRequired branch ahead of the classifier (plus its own _is_privileged_intents_required detector). Fold the tailored guidance into the classifier's existing intents arm instead: one classification path, one error code (discord_intents_required), and the message now names exactly the intents Hermes requested (Message Content always; Server Members only when username/role allowlists need it). Wizard callout, docs corrections, and tests from NousResearch#79448 kept as-is.
bobaba76
pushed a commit
to bobaba76/hermes-agent
that referenced
this pull request
Aug 27, 2026
The cherry-picked NousResearch#79448 predated NousResearch#85049's _classify_connect_exception, so it added a parallel PrivilegedIntentsRequired branch ahead of the classifier (plus its own _is_privileged_intents_required detector). Fold the tailored guidance into the classifier's existing intents arm instead: one classification path, one error code (discord_intents_required), and the message now names exactly the intents Hermes requested (Message Content always; Server Members only when username/role allowlists need it). Wizard callout, docs corrections, and tests from NousResearch#79448 kept as-is.
melon-xf
added a commit
to melon-xf/hermes-agent
that referenced
this pull request
Sep 3, 2026
The cherry-picked NousResearch#79448 predated NousResearch#85049's _classify_connect_exception, so it added a parallel PrivilegedIntentsRequired branch ahead of the classifier (plus its own _is_privileged_intents_required detector). Fold the tailored guidance into the classifier's existing intents arm instead: one classification path, one error code (discord_intents_required), and the message now names exactly the intents Hermes requested (Message Content always; Server Members only when username/role allowlists need it). Wizard callout, docs corrections, and tests from NousResearch#79448 kept as-is.
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?
When Discord rejects the gateway WebSocket with
PrivilegedIntentsRequired, Hermes previously logged discord.py's vague message and kept reconnecting forever (hundreds of attempts). That error is a Developer Portal config problem, not a transient network blip.This PR:
PrivilegedIntentsRequiredon connect and logs/stores an actionable fatal that names the intent(s) Hermes is actually requesting (always Message Content; Server Members only when username/role allowlists need it), with a Developer Portal fix path and docs link.interactive_setup()to call out Privileged Gateway Intents before asking for the bot token (the wizard previously only said "create a bot at …").Related Issue
Fixes #79430
Type of Change
Changes Made
plugins/platforms/discord/adapter.py— helpers for members-intent need / PrivilegedIntents detection / guidance text;connect()setsprivileged_intents_requirednon-retryable fatal;interactive_setup()prints intent requirements before the token prompttests/gateway/test_discord_connect.py— unit coverage for guidance text, members-intent rules, and connect → non-retryable fatal onPrivilegedIntentsRequiredtests/gateway/test_discord_plugin_setup.py— setup wizard must mention Message Content / Privileged Gateway Intentswebsite/docs/user-guide/messaging/discord.md— troubleshooting section aligned with the real error and Hermes's actual intent requestsHow to Test
scripts/run_tests.sh tests/gateway/test_discord_connect.py tests/gateway/test_discord_plugin_setup.py -qExpect the new PrivilegedIntents / setup guidance tests to pass.
fatal/ non-retryable behavior, and no endlessReconnect discord (attempt N)loop.DISCORD_ALLOWED_ROLES), restart the gateway, confirm Discord connects and can send/receive in a test channel.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/AScreenshots / Logs
Before (reporter, #79430): opaque
PrivilegedIntentsRequired+Reconnect discord (attempt 438)...After (unit-simulated PrivilegedIntents path): non-retryable fatal with guidance naming Message Content Intent + Developer Portal / docs links.
Happy-path live check: patched
DiscordAdapter.connect()succeeded and posted to the test guild channel with intents enabled.