Files
oh-my-claudecode/templates
Bellman 3b596c6a54 fix(persistent-mode): check cancel signal before blocking stop hook (#1306)
Add isSessionCancelInProgress() function to scripts/persistent-mode.cjs and
templates/hooks/persistent-mode.mjs to check for cancel-signal-state.json
before blocking session stops.

This fixes issue #1299 where /oh-my-claudecode:cancel was not working because
the stop hook continued blocking even after the cancel command was issued.

The fix:
- Checks session-scoped cancel signal first (.omc/state/sessions/{id}/cancel-signal-state.json)
- Falls back to legacy path (.omc/state/cancel-signal-state.json)
- Validates 30-second TTL on the signal
- Allows stop immediately if cancel is in progress

This affects all persistent modes (ralph, autopilot, ultrawork, etc.) since
they all rely on the same persistent-mode hook.

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-04 10:27:40 +09:00
..