Skip to content

fix: prune stale Discord slash commands before creating - #19366

Open
aaronsagents-stack wants to merge 2 commits into
NousResearch:mainfrom
aaronsagents-stack:aa/discord-slash-cleanup-and-channel-create
Open

fix: prune stale Discord slash commands before creating#19366
aaronsagents-stack wants to merge 2 commits into
NousResearch:mainfrom
aaronsagents-stack:aa/discord-slash-cleanup-and-channel-create

Conversation

@aaronsagents-stack

Copy link
Copy Markdown

Summary

  • preserve the local Discord create_channel tool action as a commit
  • fix Discord slash-command reconciliation so stale commands are deleted before new commands are created
  • prevents 100-command-limit failures when old per-skill/plugin slash commands fill the Discord app quota

Test plan

  • python -m pytest tests/gateway/test_discord_connect.py tests/gateway/test_discord_slash_commands.py tests/tools/test_discord_tool.py -q

Notes

The observed failure was Discord error 30032: maximum number of application commands reached (100). Desired Hermes commands are ~40; the app had 76 stale commands, mostly legacy per-skill commands. The reconcile order was creating before pruning, so it hit the cap before cleanup could happen.

@teknium1

Copy link
Copy Markdown
Contributor

Thanks for identifying the Discord 100-command reconciliation failure. The slash-sync portion has already landed on current main: plugins/platforms/discord/adapter.py:1897-1914 deletes obsolete commands before upserts, using the paced mutation wrapper; merged commit e9b86f352fc73db5ca3de6e3fb50ef57d774f8f9 implements this behavior. Current regression coverage in tests/gateway/test_discord_sync_limit.py:61-140 asserts deletion precedes creation.

Problems

  • The PR targets the former gateway/platforms/discord.py path; Discord now lives in plugins/platforms/discord/adapter.py after the platform migration.
  • The create_channel addition is separate from the superseded sync fix and is not currently present in the action registry at tools/discord_tool.py:633-676.

Suggested changes

  • If salvaged, isolate and re-review only create_channel against the current Discord tool action/schema paths and current tests. Do not reapply the slash-sync ordering hunk.

This is an automated hermes-sweeper review.

@teknium1 teknium1 added sweeper:risk-message-delivery Sweeper risk: may drop, duplicate, misroute, or suppress messages sweeper:risk-security-boundary Sweeper risk: may affect sandboxing, auth, credentials, or sensitive data sweeper:blast-moderate Sweeper blast radius: moderate — a subsystem or single platform labels Jul 12, 2026
@GottZ

GottZ commented Aug 3, 2026

Copy link
Copy Markdown

This was generated by AI during triage.

Summary

Seven PRs address Discord error 30032 through two related causes: #46078 caps the desired command set at 100, while #19366, #24371, #29134, #40699, #50890, and #50992 delete obsolete remote commands before creating replacements. #19366 additionally introduces a separate create_channel action that is not part of the slash-sync failure.

Related pull requests

Duplicates

#19366, #24371, #29134, #40699, #50890, and #50992 substantially duplicate the delete-before-create reconciliation change; #50890 was directly salvaged by #50992, while #46078 is complementary because it caps an intrinsically oversized desired set.

Suggested consolidation

Keep #19366 open only with the salvage path identified by the maintainer-bot review: author action to rebase onto main and split out create_channel for review against the current tool action/schema paths, dropping the obsolete slash-sync hunk. The sync fix is already evidenced on main by merged commit e9b86f3 at plugins/platforms/discord/adapter.py:1897-1914 with coverage at tests/gateway/test_discord_sync_limit.py:61-140; treat #24371, #29134, #40699, and #50890 as closed duplicates/superseded work, with merged #46078 and #50992 retained as the two complementary reference implementations.

Complex graph

flowchart TD
    classDef open fill:#dbeafe,stroke:#1d4ed8,color:#1e3a8a
    classDef merged fill:#dcfce7,stroke:#15803d,color:#14532d
    classDef closed fill:#e5e7eb,stroke:#6b7280,color:#1f2937
    classDef unverified fill:#f3f4f6,stroke:#9ca3af,color:#374151
    classDef best stroke-width:3px,stroke:#b45309
    classDef target stroke-width:3px,stroke:#4338ca
    subgraph Dup19366 ["PRs duplicating each other"]
        P19366["PR #19366 (open)"]
        P24371["PR #24371 (closed)"]
        P29134["PR #29134 (closed)"]
        P40699["PR #40699 (closed)"]
        P50890["PR #50890 (closed)"]
        P50992["PR #50992 (merged)"]
    end
    class P19366 open
    class P24371 closed
    class P29134 closed
    class P40699 closed
    class P50890 closed
    class P50992 merged
    class P19366 target
    click P19366 "https://github.com/NousResearch/hermes-agent/pull/19366"
    click P24371 "https://github.com/NousResearch/hermes-agent/pull/24371"
    click P29134 "https://github.com/NousResearch/hermes-agent/pull/29134"
    click P40699 "https://github.com/NousResearch/hermes-agent/pull/40699"
    click P50890 "https://github.com/NousResearch/hermes-agent/pull/50890"
    click P50992 "https://github.com/NousResearch/hermes-agent/pull/50992"
Loading

Graph: solid arrow = fixes / best fix, dashed arrow = partial or unverified (see edge label); boxed group = PRs duplicating each other; amber border = best fix; indigo border = target; gray node = closed (state tag in the node label).

Cross-PR triage: Reviewed 7 pull requests and 0 issues in this complex. Each diff was read against this issue; Assessment working set: 58 kB of PR diffs, 13 kB of issue/PR text, 9 kB of discussion (11 comments), 0 verify verdicts. verdicts reflect diff content, not PR titles. Part of an automated triage batch.

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

Labels

comp/gateway Gateway runner, session dispatch, delivery P2 Medium — degraded but workaround exists platform/discord Discord bot adapter sweeper:blast-moderate Sweeper blast radius: moderate — a subsystem or single platform sweeper:risk-message-delivery Sweeper risk: may drop, duplicate, misroute, or suppress messages 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.

4 participants