Skip to content

Single-Instance Command Routing (IPC) (M2 #22) #54

Description

@ddroid

What to build

Implement single-instance enforcement so only one Ronin process runs at a time. When a second ronin invocation is launched:

  1. Detect that an instance is already running (via lock file, socket, or D-Bus)
  2. Route the CLI intent (--new, --quick, --attach <path>) to the existing process
  3. Focus the existing window
  4. Apply the launch intent in the running instance

This replaces the M0 behavior where multiple simultaneous processes were unsupported but not prevented.

Acceptance criteria

  • First ronin launch acquires an instance lock
  • Second ronin launch detects the existing instance
  • Second launch's CLI flags are routed to the running instance
  • Running instance receives and applies the intent (--new creates a thread, --quick opens quick mode, --attach attaches file)
  • Running instance's window is focused/raised
  • Second process exits cleanly after routing
  • If the first instance crashes or is killed, the lock is released and a new instance can start
  • IPC mechanism works on common Linux desktop environments (GNOME, KDE, Sway)
  • Tests cover lock acquisition, routing, and stale lock recovery

Blocked by

None - can start immediately

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions