Skip to content

fix(ralph-loop): ensure new session starts on /ralph-loop invocation (fixes #1900)#3430

Closed
MoerAI wants to merge 2 commits intocode-yeongyu:devfrom
MoerAI:fix/ralph-loop-new-session
Closed

fix(ralph-loop): ensure new session starts on /ralph-loop invocation (fixes #1900)#3430
MoerAI wants to merge 2 commits intocode-yeongyu:devfrom
MoerAI:fix/ralph-loop-new-session

Conversation

@MoerAI
Copy link
Copy Markdown
Contributor

@MoerAI MoerAI commented Apr 14, 2026

Summary

  • default /ralph-loop to the reset strategy so each iteration starts in a fresh session
  • treat legacy loop state without an explicit strategy as reset instead of continuing in-place
  • add a regression test covering both the default state and legacy-state fallback

Problem

/ralph-loop was still falling back to the continue strategy when no explicit strategy was set. That kept iterations in the same session, which broke the expected fresh-session loop behavior reported in #1900 and also affected older saved loop state that did not persist a strategy.

Fix

The ralph-loop config schema and runtime fallbacks now default to reset, so a plain /ralph-loop invocation creates a new iteration session by default. I also added a focused regression test to verify both newly started loops and legacy state continue into a fresh session.

Changes

File Change
src/config/schema/ralph-loop.ts Change the default configured strategy from continue to reset
src/hooks/ralph-loop/loop-state-controller.ts Default newly started loop state to reset when no strategy is provided
src/hooks/ralph-loop/iteration-continuation.ts Default legacy in-memory/state-file continuation logic to reset
src/hooks/ralph-loop/default-reset-strategy.test.ts Add regression coverage for default and legacy-state reset behavior

Fixes #1900


Summary by cubic

Make /ralph-loop start a fresh session by default and handle legacy loop state correctly. Also fix plugin config discovery to detect both canonical and legacy files, preferring the canonical name. Fixes #1900 and #3133.

  • Bug Fixes
    • Ralph loop: default strategy is now reset in schema and runtime; legacy state without a strategy is treated as reset so each iteration spawns a new session; added a focused regression test.
    • Plugin config: getOpenCodeConfigPaths now uses detectPluginConfigFile to find oh-my-openagent.json (canonical) or oh-my-opencode.jsonc (legacy), preferring the canonical file when both exist; added tests.

Written for commit cf5c2e3. Summary will update on new commits.

@MoerAI
Copy link
Copy Markdown
Contributor Author

MoerAI commented Apr 14, 2026

I have read the CLA Document and I hereby sign the CLA

Copy link
Copy Markdown

@cubic-dev-ai cubic-dev-ai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No issues found across 6 files

Confidence score: 5/5

  • Automated review surfaced no issues in the provided summaries.
  • No files require special attention.

Auto-approved: Targeted fixes for #1900 and #3133 with new regression tests. Logic changes for defaulting to 'reset' and config file discovery are safe and improve reliability.

@MoerAI
Copy link
Copy Markdown
Contributor Author

MoerAI commented Apr 30, 2026

Closing — PR has been open 14+ days with zero maintainer engagement. Happy to reopen or rework if this fix is still wanted.

@MoerAI MoerAI closed this Apr 30, 2026
@MoerAI MoerAI deleted the fix/ralph-loop-new-session branch April 30, 2026 10:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: /ralph-loop do not start new session

1 participant