Skip to content

Add plan-mode-style pause/suppression for active ralph loops #13

Description

@charfeng1

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions