fix(tui): resolve /compact alias collision between compress alias and TUI display toggle (#57070) - #57131
Conversation
… TUI display toggle PR NousResearch#57029 added 'compact' as an alias for the 'compress' command, which collided with the pre-existing /compact TUI display toggle in _TUI_EXTRA. This caused the commands.catalog RPC to return /compact twice with two different meanings, crashing clients like hermes-desktop. - Rename /compact TUI display toggle to /compact-ui in _TUI_EXTRA - Add dedup guard in catalog handler: skip _TUI_EXTRA entries whose name already appears as a registered command or alias in canon - Update settings.toggle and settings.get handlers to accept both 'compact' and 'compact-ui' for backward compatibility - Update autocomplete extras to use /compact-ui Fixes NousResearch#57070
Competing fix cluster for #57070 (all open, all fixing the |
teknium1
left a comment
There was a problem hiding this comment.
Thanks for tracing the catalog collision; it is still present on current main.
Problems
tui_gateway/server.pychanges the catalog-only name to/compact-ui, but the local TUI registry still implements onlycompactatui-tui/src/app/slash/commands/core.ts:279-290. The new catalog command therefore has no local TUI handler.- Please add coverage for the collision contract. Current catalog tests at
tests/test_tui_gateway_server.py:4511-4582cover quick commands,/mouse, and hidden gateway commands, but not/compactalias/catalog behavior.
Suggested changes
- Rename or alias the local TUI toggle to
compact-ui, retaining the proposed config-key compatibility bridge. - Assert that catalog
pairsexcludes/compact, includes/compact-uionce, and thatcanon['/compact']resolves to/compress.
Automated hermes-sweeper review.
| @@ -11122,7 +11122,7 @@ def _(rid, params: dict) -> dict: | |||
| ) | |||
There was a problem hiding this comment.
/compact-ui is only introduced in this backend catalog. The local TUI registry still recognizes compact at ui-tui/src/app/slash/commands/core.ts:279-290, so this advertised command has no local toggle handler. Rename or alias that frontend command and add an execution regression test.
Problem
PR #57029 added
"compact"as an alias for thecompresscommand (CommandDef("compress", ..., aliases=("compact",))). This collided with the pre-existing/compactTUI display toggle in_TUI_EXTRA, causingcommands.catalogRPC to return/compacttwice with two different meanings:/compress("Compress conversation context")Impact: Clients that treat
pairsentries andcanonaliases as mutually exclusive crash on startup (e.g. fathah/hermes-desktop#802).Changes
/compactTUI display toggle to/compact-uiin_TUI_EXTRAcommands.cataloghandler: skip_TUI_EXTRAentries whose name already appears as a registered command or alias incanonsettings.toggleandsettings.gethandlers accept both"compact"and"compact-ui"keys/compact-uiFixes #57070