Skip to content

[Bug] Active Ralph can become stranded across OMX session turnover in the same Codex session #1161

@Oxidane-bot

Description

@Oxidane-bot

Summary

An active Ralph can become stranded in the previous OMX session scope when the same Codex session continues after OMX session turnover.

Environment

  • OS: WSL2
  • Node.js version: v22.21.1
  • oh-my-codex version: local branch based on upstream/dev
  • Codex CLI version: 0.118.0

Steps to reproduce

  1. Start a Ralph run in one OMX session scope.
  2. Continue the same Codex session after OMX session turnover so the active Ralph remains in the previous session scope.
  3. Observe the new current session state and HUD behavior.

Problem detail

Today, the active Ralph can remain in the previous session scope while the current session does not see it.

That leaves the user in an inconsistent state:

  • the old scope still owns the live Ralph state
  • the new current scope may appear to have no Ralph
  • the user may need to restart Ralph manually even though the Codex session itself did not actually change

Suggested behavior

One possible way to make this behavior consistent is:

  • if the current authoritative scope is empty, notify-hook may adopt exactly one matching active prior Ralph into the current scope
  • if the current scope already has ralph-state.json, it should remain authoritative for automatic reconciliation, even if that file is inactive or unreadable
  • explicit new Ralph starts should still work normally through the existing mode/state-write path

This keeps automatic recovery narrow and avoids silently reviving or overwriting Ralph state that already exists in the current scope.

Additional notes

I will open a PR alongside this issue from fix/ralph-same-session-current-session so the proposed behavior and test coverage can be reviewed directly.

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