Problem
Once a ralph loop is active, the plugin continues on every session.idle event regardless of what the user wants to do. There's no way to pause the loop to think or chat without /cancel-ralph (which destroys state).
Reference: Codex /goal Plan mode
Codex's equivalent feature (/goal) handles this with collaboration modes. When the user is in Plan mode, goal continuations are suppressed entirely — but the goal itself stays alive. The user can flip back to Default/Execute to resume.
Key behaviors when continuations are suppressed:
- Idle events do not inject a continuation prompt
- Token/time accounting against the goal pauses
- Interrupts don't auto-pause (no active accounting to pause)
- Resume restores from the last accounted state
Enforced by a single predicate checked at every continuation gate (see codex codex-rs/core/src/goals.rs::should_ignore_goal_for_mode).
Proposal
Add a paused: true|false field to the state frontmatter. Two new actions:
/ralph-pause — set paused: true. Loop stops auto-continuing on idle but state persists.
/ralph-resume — set paused: false. Loop resumes from current iteration count.
The event handler in src/index.ts gains one early-return guard:
```ts
if (state.paused) return;
```
Open questions
- Should pausing also reset the iteration counter, or preserve it? (Codex preserves accounting; argues for preserve.)
- Should there be a single
/ralph command with subcommands (pause, resume, status) instead of two commands, for tidiness? Codex packs all of those under /goal.
- Should pause auto-trigger on user interrupt (Ctrl-C)? Codex does this. Probably yes — interrupting a ralph loop should pause, not cancel.
Problem
Once a ralph loop is active, the plugin continues on every
session.idleevent regardless of what the user wants to do. There's no way to pause the loop to think or chat without/cancel-ralph(which destroys state).Reference: Codex
/goalPlan modeCodex's equivalent feature (
/goal) handles this with collaboration modes. When the user is inPlanmode, goal continuations are suppressed entirely — but the goal itself stays alive. The user can flip back toDefault/Executeto resume.Key behaviors when continuations are suppressed:
Enforced by a single predicate checked at every continuation gate (see codex
codex-rs/core/src/goals.rs::should_ignore_goal_for_mode).Proposal
Add a
paused: true|falsefield to the state frontmatter. Two new actions:/ralph-pause— setpaused: true. Loop stops auto-continuing on idle but state persists./ralph-resume— setpaused: false. Loop resumes from current iteration count.The event handler in
src/index.tsgains one early-return guard:```ts
if (state.paused) return;
```
Open questions
/ralphcommand with subcommands (pause,resume,status) instead of two commands, for tidiness? Codex packs all of those under/goal.