Skip to content

fix(acp): resolve /compact alias collision across ACP, TUI, and command catalog - #69303

Merged
teknium1 merged 3 commits into
mainfrom
salvage/57162-compact-collision
Jul 22, 2026
Merged

fix(acp): resolve /compact alias collision across ACP, TUI, and command catalog#69303
teknium1 merged 3 commits into
mainfrom
salvage/57162-compact-collision

Conversation

@teknium1

Copy link
Copy Markdown
Contributor

Summary

/compact no longer means two different things at once: ACP/registry surfaces now advertise /compress for context compression and the TUI display toggle is /density, so the palette, completions, and dispatch all agree. Root cause: the command registry aliased compact → compress while ACP and the TUI's _TUI_EXTRA each independently registered their own compact, producing duplicate catalog entries and alias shadowing.

Changes

  • acp_adapter/server.py: ACP command compactcompress (advertisement, dispatch table, _cmd_compress, /context tips).
  • tui_gateway/server.py: TUI display toggle /compact/density (config.set/config.get key, _TUI_EXTRA, completions); commands.catalog now skips _TUI_EXTRA entries that collide with a registry command or alias (also removes a pre-existing /sessions duplicate).
  • ui-tui/src/app/slash/commands/core.ts + ui-tui/README.md: client-side toggle renamed to /density, docs updated.
  • apps/desktop/src/lib/desktop-slash-commands.ts: /compact routes as an alias of /compress (context compression) instead of dead-ending as "terminal-only"; /density marked terminal-only so the desktop never advertises a command its dispatcher can't run.
  • Tests: commands.catalog regression test (no duplicate advertised names, no command shadowing another command's alias); desktop /compact → /compress routing test; ACP assertion updates.

Validation

Before After
commands.catalog /compact advertised while registry aliases compact→compress; /sessions listed twice no duplicates, no alias shadowing (regression-tested)
TUI /compact ambiguous: display toggle vs compression /density toggles display, /compress (alias /compact) compresses
Desktop /compact "only available in the terminal interface" dispatches context compression via /compress

Targeted tests: tests/test_tui_gateway_server.py + tests/acp/ → 707 passed, 0 failed. ui-tui and apps/desktop typechecks clean; desktop vitest suite 17/17.

Credit

Salvaged from #57162 by @liuhao1024 (broadest of the competing fixes). Same collision independently addressed in #57073 and #57131 (TUI-only). Fixes #57133, #57070, #57532.

Infographic

compact-alias-collision

liuhao1024 and others added 3 commits July 22, 2026 04:54
…mmand collision

- acp_adapter/server.py: rename compact -> compress for context compression command
- tui_gateway/server.py: rename /compact -> /density for display density toggle
- ui-tui/core.ts: rename compact -> density for display density toggle
- Internal config keys (tui_compact) and UI state (ctx.ui.compact) unchanged
… to /compress, update README

- tui_gateway commands.catalog: skip _TUI_EXTRA entries that collide with a
  registry command or alias (the /compact class of bug, #57133; also removes
  the pre-existing /sessions duplicate) — registry entry is canonical.
- apps/desktop: /compact now dispatches as an alias of /compress (matching
  the registry's canonical alias) instead of dead-ending; /density (the
  renamed TUI display toggle) is marked terminal-only so the desktop palette
  doesn't advertise a command its dispatcher can't run.
- ui-tui/README.md: document /density instead of the old /compact toggle.
- tests: commands.catalog regression test asserting no duplicate advertised
  names and no command shadowing another command's alias; desktop routing test.
@github-actions

github-actions Bot commented Jul 22, 2026

Copy link
Copy Markdown
Contributor

૮ >ﻌ< ა ci review

running on 8b0bb9d

CI timings

CI timings · View job

Wall time 7m45s vs 7m46s (-0.2%). 6 job(s) slower, 12 faster, 2 unchanged.

  • Build&Test Docker image / build (amd64, ubuntu-latest, linux/amd64, type=gha,scope=docker-amd64, type=gha,mode=max,scope=do...: +24.0s
  • Build&Test Docker image / build (arm64, ubuntu-24.04-arm, linux/arm64, type=gha,scope=docker-arm64, type=gha,mode=max,scope...: -21.0s
  • Python tests / Run tests slice 4/8: -19.0s
  • Python tests / Run tests slice 8/8: -13.0s
  • Python tests / Run tests slice 2/8: -11.0s

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

Labels

area/compression Context compression and continuation sessions comp/acp Agent Communication Protocol adapter comp/desktop Electron desktop app (apps/desktop/*) comp/tui Terminal UI (ui-tui/ + tui_gateway/) P2 Medium — degraded but workaround exists sweeper:risk-compatibility Sweeper risk: may break existing users, config, migrations, defaults, or upgrades type/bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: /compact slash command name collision causes "Duplicate slash command alias" error

3 participants