Skip to content

Conversation

@zerone0x
Copy link
Contributor

@zerone0x zerone0x commented Jan 25, 2026

Summary

Fixes #120

When using --monitor flag, the tmux session now correctly forwards all CLI parameters to the inner ralph_loop.sh execution. Previously, only --calls and --prompt were forwarded, causing parameters like --output-format text to be silently ignored.

Changes

  • Modified setup_tmux_session() in ralph_loop.sh to forward all 6 additional CLI parameters:
    • --output-format (json/text) - was the reported bug
    • --verbose (boolean flag)
    • --timeout (minutes, default 15)
    • --allowed-tools (tool permissions)
    • --no-continue (disable session continuity)
    • --session-expiry (hours, default 24)
  • Each parameter is only forwarded if it differs from default value to keep the command clean
  • Added 8 new unit tests for parameter forwarding validation

Test Plan

  1. Verify existing tests pass: npx bats tests/unit/test_cli_parsing.bats
  2. Test manual reproduction case:
    ralph --monitor --output-format text --verbose
    # Should now show "[INFO] Using modern CLI mode (text output)" instead of JSON
  3. Test multiple parameters:
    ralph --monitor --output-format text --timeout 30 --verbose
    # All parameters should be forwarded to the inner loop

Test Results

  • All 329 tests pass (up from 321 with 8 new tests)
  • New tests cover all 6 parameter types plus combination scenarios

🤖 Generated with Claude Code (issue-hunter-pro)

Summary by CodeRabbit

  • Improvements

    • Enhanced the monitor flow to properly forward all CLI parameters to the inner Ralph loop. Your configuration settings for output format, verbosity, timeout, allowed tools, continue behavior, and session expiry are now consistently applied throughout the monitoring process.
  • Tests

    • Added comprehensive test coverage for monitor parameter forwarding to ensure all parameters are correctly propagated.

✏️ Tip: You can customize this high-level summary in your review settings.

…ia#120)

When using --monitor flag, the tmux session now correctly forwards all
CLI parameters to the inner ralph_loop.sh execution instead of only
--calls and --prompt.

Added forwarding for:
- --output-format (json/text)
- --verbose
- --timeout
- --allowed-tools
- --no-continue
- --session-expiry

Added 8 new tests for parameter forwarding validation.
Test count: 329 (up from 321)

Fixes frankbria#120

Co-Authored-By: Claude <[email protected]>
@coderabbitai
Copy link

coderabbitai bot commented Jan 25, 2026

Walkthrough

The changes address Issue #120 by implementing parameter forwarding in the --monitor workflow. The ralph_loop.sh script now conditionally forwards CLI parameters (--output-format, --verbose, --timeout, --allowed-tools, --no-continue, --session-expiry, --calls, --prompt) to the inner tmux session based on non-default values, preventing parameter loss when using tmux monitoring mode. Corresponding test cases validate this forwarding behavior.

Changes

Cohort / File(s) Summary
Parameter Forwarding Logic
ralph_loop.sh
Added conditional parameter forwarding in setup_tmux_session() function. Now appends CLI flags to ralph_cmd when values differ from defaults: --calls, --prompt, --output-format, --verbose, --timeout, --allowed-tools, --no-continue, --session-expiry.
Monitor Parameter Forwarding Tests
tests/unit/test_cli_parsing.bats
Added new test suite (Issue #120) with helper function build_ralph_cmd_for_test() and multiple test cases validating forwarding of individual and combined parameters. Tests verify default parameters are suppressed and non-default values are properly forwarded.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

Poem

🐰 A rabbit hops through tmux with glee,
Forwarding flags left and right, you see!
When --output-format meets --verbose cheer,
All parameters now arrive crystal clear!
No more lost defaults in the monitor's night. ✨

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately describes the main change: forwarding all CLI parameters to the inner ralph loop in the monitor flow.
Linked Issues check ✅ Passed The PR comprehensively addresses issue #120 by implementing parameter forwarding for six parameters (--output-format, --verbose, --timeout, --allowed-tools, --no-continue, --session-expiry) with appropriate tests.
Out of Scope Changes check ✅ Passed All changes are focused on implementing parameter forwarding logic and corresponding unit tests directly related to issue #120, with no extraneous modifications.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@macroscopeapp
Copy link
Contributor

macroscopeapp bot commented Jan 25, 2026

Forward monitor CLI parameters into the inner ralph loop by updating setup_tmux_session in ralph_loop.sh

setup_tmux_session appends non-default flags to the left-pane ralph_cmd, including --output-format, --verbose, --timeout, --allowed-tools, --no-continue, and --session-expiry. Tests add a build_ralph_cmd_for_test helper and validate flag forwarding patterns in tests/unit/test_cli_parsing.bats.

📍Where to Start

Start with the setup_tmux_session function in ralph_loop.sh, then review the build_ralph_cmd_for_test helper in tests/unit/test_cli_parsing.bats.


Macroscope summarized 23f2951.

@frankbria
Copy link
Owner

Hey! I just merged a fix on main (#133) for a flaky test (test 199 in test_session_continuity.bats) that was causing your CI failure. The issue was unrelated to your changes — a variable was being used before it was explicitly set in that test.

Could you rebase onto main so CI can re-run? Everything else in this PR looks good.

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.

Using --monitor causes other parameters not to take effect.

2 participants