Skip to content

v3.7.1 β€” Command registry refactor

Choose a tag to compare

@eniz1806 eniz1806 released this 06 Jun 12:29

Internal refactor β€” no user-facing behavior change (only `/help` has a nicer grouped layout).

Changed

  • Command dispatch is now a registry. The ~850-line `if/elif` chain in `_handle_slash` is replaced by an 18-line dispatcher over a `_COMMAND_HANDLERS` table; each of the 73 commands is its own `cmd*` method. A single `_COMMAND_SPECS` registry (name, aliases, handler, group, args, description) is the source of truth β€” the dispatch table, the tab-completion list, and `/help` all derive from it, so they can no longer drift out of sync. Adding a command is now two steps (a method + one registry row).

Tests

  • Added `TestCommandRegistry` integrity tests. 326 total; ruff + CI green.