Skip to content

docs: Add analysis for issue #244 - Start not working after refresh#251

Merged
subsy merged 2 commits intomainfrom
claude/investigate-issue-244-wl3t5
Feb 2, 2026
Merged

docs: Add analysis for issue #244 - Start not working after refresh#251
subsy merged 2 commits intomainfrom
claude/investigate-issue-244-wl3t5

Conversation

@subsy
Copy link
Copy Markdown
Owner

@subsy subsy commented Feb 2, 2026

Summary

This PR adds a detailed analysis document for issue #244, which describes a bug where newly created tasks cannot be started in ralph-tui after refreshing when the engine has previously completed all tasks.

Changes

  • Added .claude/issue-244-analysis.md with comprehensive root cause analysis
    • Documents the problem: 's' key handler doesn't process 'complete' status
    • Traces the reproduction flow from task creation through refresh to failed start attempt
    • Maps key code locations across the codebase
    • Proposes two fix options with code examples
    • Recommends Option A (simpler approach) over Option B

Key Findings

The issue occurs because:

  1. When the engine completes all tasks, it sets TUI status to 'complete'
  2. The 's' key handler only checks for 'ready', 'stopped', or 'idle' statuses
  3. After refreshing with new tasks, the status remains 'complete' and the handler ignores the 's' key press
  4. The fix is straightforward: add 'complete' to the status check in the 's' key handler

This analysis document serves as a reference for implementing the fix and understanding the interaction between engine state and TUI status management.

https://claude.ai/code/session_01MswFvQsQ7NQB7ypr3JsESE

Summary by CodeRabbit

  • Bug Fixes

    • Allow restarting/continuing execution after a workflow reaches "complete" when new actionable tasks appear (resolves the refresh/start issue).
  • Tests

    • Added comprehensive keyboard-handler tests to verify 's' key behaviour, continuation conditions and remote continue signalling.
  • Documentation

    • Added detailed issue analysis documenting reproduction steps, root cause and two proposed fixes plus a recommended approach and workaround.

Root cause: 's' key handler doesn't handle 'complete' status.
When engine completes all tasks and new ones are created externally,
pressing 's' after refresh does nothing.

Proposed fix: Add 'complete' to the status check in the 's' handler.

https://claude.ai/code/session_01MswFvQsQ7NQB7ypr3JsESE
@vercel
Copy link
Copy Markdown

vercel bot commented Feb 2, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Actions Updated (UTC)
ralph-tui Ignored Ignored Preview Feb 2, 2026 10:47am

Request Review

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Feb 2, 2026

Walkthrough

Expanded TUI start/continue logic to treat a completed run as actionable: the 's' key now triggers continuation when display status is complete, plus a new issue analysis document was added and unit tests introduced to cover the updated behaviour.

Changes

Cohort / File(s) Summary
Issue Analysis Documentation
.claude/issue-244-analysis.md
New Markdown analysis for Issue #244 describing root cause (missing complete handling in the 's' key handler), reproduction steps, relevant code locations, and two proposed fixes (Option A: treat complete like stopped/idle; Option B: reset completeidle on refresh).
TUI keyboard handling / runtime
src/tui/components/RunApp.tsx
Expanded conditions so the 's' key remote and local continuation paths include displayStatus === 'complete' alongside stopped/idle/ready, with comments updated to reflect continuation after completion when new tasks appear.
Tests
tests/tui/keyboard-handlers.test.ts
New comprehensive unit tests modelling status values and verifying: initial start, continue execution (now includes complete), combined s-key effects, remote continue send conditions, and Issue #244 reproduction scenarios.
Manifest
package.json
Minor manifest edits (few lines changed).

Sequence Diagram(s)

sequenceDiagram
    participant User as User (press 's')
    participant TUI as RunApp / TUI
    participant Engine as Local Engine
    participant Remote as Remote Instance

    User->>TUI: press 's'
    alt displayStatus == 'ready' and onStart exists
        TUI->>Engine: trigger onStart (initial start)
    else displayStatus in ('stopped','idle','complete')
        alt viewing remote instance
            TUI->>Remote: send "continue" command
            Remote-->>TUI: acknowledge
        else local engine
            TUI->>Engine: trigger continueExecution
            Engine-->>TUI: new tasks / status updates
        end
    else other statuses
        TUI-->>User: no-op
    end
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 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: adding an analysis document for issue #244 about start not working after refresh.
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
  • Commit unit tests in branch claude/investigate-issue-244-wl3t5

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.

When all tasks were completed and new tasks were created externally,
pressing 's' after refresh did nothing because the handler only
recognized 'stopped' and 'idle' statuses.

Changes:
- Add 'complete' to the status check in 's' key handler (line 1431)
- Add 'complete' to remote instance continue command check (line 1422)
- Add comprehensive tests for keyboard handler status logic

Fixes #244

https://claude.ai/code/session_01MswFvQsQ7NQB7ypr3JsESE
@subsy subsy merged commit 9a5c5a0 into main Feb 2, 2026
9 checks passed
@subsy subsy deleted the claude/investigate-issue-244-wl3t5 branch February 2, 2026 15:15
sakaman pushed a commit to sakaman/ralph-tui that referenced this pull request Feb 15, 2026
…wl3t5

docs: Add analysis for issue subsy#244 - Start not working after refresh
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.

2 participants