Skip to content

[codex] Refactor heartbeat slash command module#32

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

[codex] Refactor heartbeat slash command module#32
roackb2 merged 1 commit intomainfrom
codex/heartbeat-slash-command-module

Conversation

@roackb2
Copy link
Copy Markdown
Owner

@roackb2 roackb2 commented May 2, 2026

Summary

Completes the M5 slash-command migration slice by moving heartbeat commands into core modules and isolating the TUI-only debug snapshot command outside core.

Changes include:

  • Added src/core/commands/slash/modules/heartbeat/heartbeat-commands.ts for /heartbeat tasks, /heartbeat task, /heartbeat runs, /heartbeat run, and /heartbeat continue.
  • Added heartbeat ports to SlashCommandExecutionContext and wired the TUI adapter to createFileHeartbeatTaskStore.
  • Added src/cli/chat/commands/debug-snapshot-command.ts so /debug tui-snapshot is registered from the TUI layer rather than core.
  • Reduced local-commands.ts to compatibility exports, composed hints, autocomplete, /help, and registry orchestration.
  • Added direct unit coverage for heartbeat routing and the pure continuation prompt builder.

Impact

Heartbeat command behavior is now reusable through the core slash registry while keeping store access host-supplied. The TUI-only debug command is explicitly host-owned, which keeps core command modules focused on reusable domains.

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/tui/heartbeat-cli.test.ts
  • yarn vitest run src/__tests__/integration/core/heartbeat-scheduler.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:29
@roackb2 roackb2 merged commit 2664db0 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