Skip to content

fix: avoid unnecessary Discord members intent on startup - #4690

Closed
abhey-gupta wants to merge 1 commit into
NousResearch:mainfrom
abhey-gupta:fix/discord-startup-intents-lock
Closed

fix: avoid unnecessary Discord members intent on startup#4690
abhey-gupta wants to merge 1 commit into
NousResearch:mainfrom
abhey-gupta:fix/discord-startup-intents-lock

Conversation

@abhey-gupta

@abhey-gupta abhey-gupta commented Apr 3, 2026

Copy link
Copy Markdown
Contributor

Summary

  • only request the privileged Discord members intent when DISCORD_ALLOWED_USERS includes non-numeric entries that require username resolution
  • release the Discord token-scoped lock when startup fails or times out so retries/restarts are not blocked by a stale lock
  • add regression tests for conditional intent selection and startup lock cleanup

Why

Numeric Discord allowlists should not require the privileged members intent. Requesting it unconditionally can leave bots offline when the intent is disabled in the Discord developer portal, even though the bot token and channel setup are otherwise correct.

Testing

  • /home/abhey/.hermes/hermes-agent/venv/bin/pytest -q tests/gateway/test_discord_connect.py tests/gateway/test_discord_free_response.py tests/gateway/test_discord_slash_commands.py

Only request the privileged members intent when DISCORD_ALLOWED_USERS includes non-numeric entries that need username resolution. Also release the Discord token lock when startup fails so retries and restarts are not blocked by a stale lock.\n\nAdds regression tests for conditional intents and startup lock cleanup.
@teknium1

teknium1 commented Apr 5, 2026

Copy link
Copy Markdown
Contributor

Merged via PR #5302. Your commit was cherry-picked onto current main with authorship preserved. Added a minor test mock fix for compatibility with recent ExecApprovalView addition. Thanks @abhey-gupta!

@teknium1 teknium1 closed this Apr 5, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants