From 3c489fda8175fa317be3c9c8d51f90f23de3a50a Mon Sep 17 00:00:00 2001 From: Teknium <127238744+teknium1@users.noreply.github.com> Date: Wed, 10 Jun 2026 05:40:35 -0700 Subject: [PATCH] =?UTF-8?q?fix(commands):=20unpin=20/reset=20from=20Slack?= =?UTF-8?q?=20priority=20aliases=20=E2=80=94=20registry=20hit=20the=2050-c?= =?UTF-8?q?ap?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit CI tests the PR merged with current main, where the new /memory canonical command filled Slack's 50-slash cap: with btw/bg/reset all pinned ahead of canonicals, the last canonical (/debug) got clamped and the Telegram-parity test failed. Canonical commands must win slots over alias spellings — /new keeps its native slot and 'reset' stays reachable via /hermes reset. Also updates test_includes_aliases_as_first_class_slashes to assert the pinned-alias contract (_SLACK_PRIORITY_ALIASES survive) instead of a specific unpinned alias's survival, which was the same change-detector pattern the docstring already warned about. --- hermes_cli/commands.py | 6 +++++- tests/hermes_cli/test_commands.py | 12 +++++++----- 2 files changed, 12 insertions(+), 6 deletions(-) diff --git a/hermes_cli/commands.py b/hermes_cli/commands.py index dc931820e6c..20a87eb811c 100644 --- a/hermes_cli/commands.py +++ b/hermes_cli/commands.py @@ -1037,7 +1037,11 @@ _SLACK_RESERVED_COMMANDS = frozenset({ # unrelated command landed. These claim their slots right after /hermes, # ahead of both canonical names and the rest of the aliases. Anything not # listed here still degrades gracefully (reachable via /hermes ). -_SLACK_PRIORITY_ALIASES = ("btw", "bg", "reset") +# Keep this list TIGHT: every pinned alias takes a slot a canonical command +# would otherwise get, and the Telegram-parity test fails when a canonical +# gets clamped ("reset" was unpinned for exactly that — /new keeps its +# native slot, the alias spelling stays reachable via /hermes reset). +_SLACK_PRIORITY_ALIASES = ("btw", "bg") def _sanitize_slack_name(raw: str) -> str: diff --git a/tests/hermes_cli/test_commands.py b/tests/hermes_cli/test_commands.py index 62c2be4ab79..0954ccf790d 100644 --- a/tests/hermes_cli/test_commands.py +++ b/tests/hermes_cli/test_commands.py @@ -336,20 +336,22 @@ class TestSlackNativeSlashes: ) def test_includes_aliases_as_first_class_slashes(self): - """Aliases (/btw, /bg, /reset, …) must be registered as standalone + """Aliases (/btw, /bg, …) must be registered as standalone slashes — this is the whole point of native-slashes parity. Asserts the contract (aliases are surfaced as first-class slashes), not a specific alias's survival of Slack's 50-slash clamp — which alias - lands last shifts whenever a canonical command is added, so pinning one - name (previously ``q``) made this a change-detector. + lands last shifts whenever a canonical command is added. Only the + explicitly pinned ``_SLACK_PRIORITY_ALIASES`` are guaranteed slots; + every other alias (e.g. ``reset``) may be clamped once the registry + fills the cap — canonical commands win the contest, and clamped + aliases stay reachable via ``/hermes ``. """ slashes = slack_native_slashes() names = {n for n, _d, _h in slashes} - # Aliases that sort early in the registry always fit under the cap. + # The pinned priority aliases are guaranteed to survive the clamp. assert "btw" in names assert "bg" in names - assert "reset" in names # And at least one alias is surfaced as an alias entry (description # carries the "Alias for /…" marker), proving the alias pass ran. assert any(d.startswith("Alias for /") for _n, d, _h in slashes)