Skip to content

[codex] Refactor session slash command module#31

Merged
roackb2 merged 1 commit intomainfrom
codex/session-slash-command-module
May 2, 2026
Merged

[codex] Refactor session slash command module#31
roackb2 merged 1 commit intomainfrom
codex/session-slash-command-module

Conversation

@roackb2
Copy link
Copy Markdown
Owner

@roackb2 roackb2 commented May 2, 2026

Summary

Refactors the M4 session slash-command slice so /continue, /clear, and the /session ... command family run through the core slash command registry instead of the TUI local command switchboard.

Changes include:

  • Added src/core/commands/slash/modules/session/session-commands.ts for session command behavior and module-owned static hints.
  • Added session ports to SlashCommandExecutionContext and wired them from the TUI slash command adapter.
  • Removed session command handlers and static session hints from local-commands.ts; dynamic /session switch <id> hints remain in the TUI wrapper because that API receives live session state.
  • Added direct core module tests for session host-port routing, required-argument matching, and pure session reference resolution.

Impact

This keeps existing TUI behavior stable while moving session command policy into a reusable core module. Session reference resolution now has a dedicated pure helper and preserves the existing exact-id-before-index behavior.

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 vitest run src/__tests__/integration/tui/session-cli.test.ts
  • yarn eslint
  • yarn typecheck
  • yarn test outside the sandbox, because the full integration suite needs localhost binding and normal git identity for temp repositories

@roackb2 roackb2 marked this pull request as ready for review May 2, 2026 13:16
@roackb2 roackb2 merged commit 8f2a9c4 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