Skip to content

[codex] Refactor core slash command modules#30

Merged
roackb2 merged 1 commit intomainfrom
codex/slash-command-core-modules
May 2, 2026
Merged

[codex] Refactor core slash command modules#30
roackb2 merged 1 commit intomainfrom
codex/slash-command-core-modules

Conversation

@roackb2
Copy link
Copy Markdown
Owner

@roackb2 roackb2 commented May 2, 2026

Summary

Refactors the M3 slash-command slice so model, auth, compaction, and drift commands live in registered core slash modules instead of the TUI local command switchboard.

Changes include:

  • Added module-owned command implementations for /model, /models, /model list, /model set, /auth, /auth status, /auth login, /auth logout, /compact, /drift, /drift status, /drift on, and /drift off.
  • Added a TUI slash command context adapter so local-commands.ts can delegate to the core registry while keeping the existing TUI API stable.
  • Extended SlashCommandModule with module-owned hints, so help/autocomplete entries for migrated commands no longer need to be duplicated in local-commands.ts.
  • Added direct core module tests for command routing, model credential policy, host ports, and module-owned hints.

Impact

This keeps current TUI behavior stable while proving the domain-module command pattern. Future command modules can now own both behavior and help metadata, and local-commands.ts remains focused on compatibility and commands not yet migrated.

Validation

  • yarn test:unit src/__tests__/unit/core/slash-command-modules.test.ts
  • yarn test:unit src/__tests__/unit/tui/local-commands.test.ts
  • yarn test:unit src/__tests__/unit/core/llm-factory.test.ts
  • yarn eslint
  • yarn typecheck
  • yarn test

@roackb2 roackb2 marked this pull request as ready for review May 2, 2026 13:05
@roackb2 roackb2 merged commit 783b13a into main May 2, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant