fix(gateway): delete stale Discord slash commands before creating new ones - #24371
Closed
itenev wants to merge 2 commits into
Closed
fix(gateway): delete stale Discord slash commands before creating new ones#24371itenev wants to merge 2 commits into
itenev wants to merge 2 commits into
Conversation
… ones When syncing slash commands, stale (removed) commands were deleted AFTER new commands were created. If stale commands from old versions brought the total close to Discord's hard limit of 100 global application commands, adding new commands via upsert_global_command would exceed the limit and Discord would reject the entire sync batch. Fix: identify stale keys (existing but not in desired set) and delete them FIRST, before the create/update loop. This guarantees the total never exceeds 100 during sync.
Collaborator
|
Likely duplicate of #19366 — same fix (reorder Discord slash-command sync to prune stale commands before creating new ones). Please coordinate or close one. |
…mmand sync - test_safe_sync_slash_commands_deletes_stale_before_creating: Verifies all delete_global_command calls happen before any upsert/edit calls, guarding against regression of the >100 commands limit bug. - test_safe_sync_slash_commands_deletion_error_does_not_block_sync: Verifies that a failing stale command deletion is caught and logged, allowing the sync to continue creating/updating remaining commands.
loki-hermes-agent
Bot
force-pushed
the
fix/discord-slash-command-sync-order
branch
from
May 12, 2026 13:53
fc93b26 to
df3765a
Compare
Contributor
Author
|
Collaborator
|
Closing in favor of #46078 (merged). As noted in that PR, the delete-before-create reordering here helps with stale/transient over-count but doesn't address the case where the desired set itself exceeds 100 — which is the recurring failure. It also targets the moved |
This was referenced Jun 22, 2026
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?
Type of Change
Changes Made
How to Test
Checklist
Code
Documentation & Housekeeping