feat: add --resume-play to pause-point await flow#1964
Conversation
Capture the Red contract before implementation: require --await, resume-before-trigger ordering, skip-on-resume-failure, and skip when the marker is not armed. Confirmed with compile errors against current API. Co-authored-by: Cursor <cursoragent@cursor.com>
Resume PlayMode after arm confirmation and before --trigger so a paused-arm workflow can fire input in one CLI call. ResumePlayResult mirrors TriggerResult's omit-when-unused reporting, and a failed resume skips trigger dispatch with a fixed skip error. Co-authored-by: Cursor <cursoragent@cursor.com>
Lock in the enable-pause-point --await --resume-play --trigger path that resumes a manually paused PlayMode before firing the input trigger, using the existing KeyStateAfterPauseInterruption scene. Co-authored-by: Cursor <cursoragent@cursor.com>
|
Warning Review limit reached
Next review available in: 47 minutes Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (3)
📝 WalkthroughWalkthroughThe project runner adds ChangesPause-point resume-play flow
Estimated code review effort: 3 (Moderate) | ~25 minutes Sequence Diagram(s)sequenceDiagram
participant EnablePausePoint
participant WaitForPausePoint
participant ControlPlayMode
participant TriggerCommand
EnablePausePoint->>WaitForPausePoint: await with resume-play and trigger
WaitForPausePoint->>ControlPlayMode: Status
ControlPlayMode-->>WaitForPausePoint: paused status
WaitForPausePoint->>ControlPlayMode: Play
ControlPlayMode-->>WaitForPausePoint: resume result
WaitForPausePoint->>TriggerCommand: dispatch trigger
TriggerCommand-->>WaitForPausePoint: trigger result
WaitForPausePoint-->>EnablePausePoint: pause-point and resume results
Possibly related PRs
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🧹 Nitpick comments (2)
cli/project-runner/internal/projectrunner/pause_point_resume_play_test.go (1)
281-327: 📐 Maintainability & Code Quality | 🔵 TrivialConsider a combined not-armed test for
--resume-play+--trigger.This test only exercises
resumePlayalone against a not-armed marker. The implementation setsresumeResultandskippedTriggerResultin independentifblocks (not else-if) when not armed, so a test asserting both are populated together when both flags are passed would close a small coverage gap.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@cli/project-runner/internal/projectrunner/pause_point_resume_play_test.go` around lines 281 - 327, Extend TestWaitForPausePointSkipsResumeWhenNotArmed to pass both resumePlay and trigger options for a not-armed marker. Assert resumePlayModeForPausePoint is not called, resumeResult contains the skip error, and triggerResult is populated with the expected skipped-trigger result.cli/project-runner/internal/projectrunner/pause_point_wait_poll.go (1)
41-79: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winConsider extracting the armed-branch logic into a helper.
The nested
if armed { if resumePlay {...} else if trigger {...} } else {...}block is doing a lot in one function. A small helper (e.g.,resolveResumeAndTrigger(...)) returning(triggerHandle, skippedTriggerResult, resumeResult)would reduce nesting without changing behavior.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@cli/project-runner/internal/projectrunner/pause_point_wait_poll.go` around lines 41 - 79, The nested armed/not-armed handling in the pause-point wait flow should be extracted from the current function into a focused helper such as resolveResumeAndTrigger. Have it accept the existing context, connection, and options needed for pause-point resolution, return triggerHandle, skippedTriggerResult, and resumeResult, and preserve all current resume-play failure, trigger dispatch, and unarmed-marker result behavior.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@scripts/regression-harness-resume-play-paused-arm.sh`:
- Around line 18-21: Update the argument parsing around PROJECT_PATH to accept
only the expected --project-path value pair, reject missing values and any
unsupported argument list with an error and nonzero exit, and do so before
project selection or cleanup can proceed.
---
Nitpick comments:
In `@cli/project-runner/internal/projectrunner/pause_point_resume_play_test.go`:
- Around line 281-327: Extend TestWaitForPausePointSkipsResumeWhenNotArmed to
pass both resumePlay and trigger options for a not-armed marker. Assert
resumePlayModeForPausePoint is not called, resumeResult contains the skip error,
and triggerResult is populated with the expected skipped-trigger result.
In `@cli/project-runner/internal/projectrunner/pause_point_wait_poll.go`:
- Around line 41-79: The nested armed/not-armed handling in the pause-point wait
flow should be extracted from the current function into a focused helper such as
resolveResumeAndTrigger. Have it accept the existing context, connection, and
options needed for pause-point resolution, return triggerHandle,
skippedTriggerResult, and resumeResult, and preserve all current resume-play
failure, trigger dispatch, and unarmed-marker result behavior.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro Plus
Run ID: 835eb274-5559-4d5c-896b-2718161df761
📒 Files selected for processing (15)
cli/project-runner/internal/projectrunner/list_output.gocli/project-runner/internal/projectrunner/list_output_test.gocli/project-runner/internal/projectrunner/native_command_help.gocli/project-runner/internal/projectrunner/native_command_help_test.gocli/project-runner/internal/projectrunner/pause_point_enable.gocli/project-runner/internal/projectrunner/pause_point_enable_test.gocli/project-runner/internal/projectrunner/pause_point_resume_play.gocli/project-runner/internal/projectrunner/pause_point_resume_play_test.gocli/project-runner/internal/projectrunner/pause_point_trigger_test.gocli/project-runner/internal/projectrunner/pause_point_types.gocli/project-runner/internal/projectrunner/pause_point_wait.gocli/project-runner/internal/projectrunner/pause_point_wait_poll.gocli/project-runner/internal/projectrunner/pause_point_wait_test.godocs/regression-harness.mdscripts/regression-harness-resume-play-paused-arm.sh
Avoid silently falling back to cwd when argv is wrong, so the cleanup trap cannot clear pause points or stop Play Mode in the wrong project. Co-authored-by: Cursor <cursoragent@cursor.com>
Add injectable sendControlPlayModeForPausePointResume tests for the four Status/Play outcomes, accept --resume-play=true on enable, drop the unused Warning field, and rename the misleading playRequested flag. Co-authored-by: Cursor <cursoragent@cursor.com>
Summary
enable-pause-point --await/await-pause-pointcan now take--resume-play, so a manually paused PlayMode is resumed after the marker is confirmed armed and before--triggerruns — in one CLI call.User Impact
PlayMode is paused..., so agents either raced real time between setup and arm, or could not fold "resume then trigger" into one await.enable-pause-point --await --resume-play --trigger "..."resumes when needed, fires the trigger, and returnsResumePlayResultalongside the existingTriggerResult.Changes
--resume-play(requires--awaiton enable, same family as--trigger).--trigger.ResumePlayResult(WasPaused/Resumed/Error); on resume failure, skip trigger with a fixed skip error and keep waiting.scripts/regression-harness-resume-play-paused-arm.shand document it indocs/regression-harness.md.Verification
Red (paused arm without
--resume-play)Command (project path redacted):
Observed (excerpt):
{ "Success": false, "Error": { "ErrorCode": "PAUSE_POINT_EXPIRED", "Details": { "HitCount": 0, "Status": "Expired", "TriggerResult": { "Command": "simulate-keyboard --action Press --key Space --duration 5", "Completed": true, "Response": { "Message": "PlayMode is paused. Resume PlayMode before simulating keyboard input.", "Success": false } } } } }Green (same flow with
--resume-play)Observed (excerpt):
{ "Success": true, "Status": "Hit", "HitCount": 1, "ResumePlayResult": { "WasPaused": true, "Resumed": true }, "TriggerResult": { "Completed": true, "Response": { "InterruptedByPausePoint": true, "Success": true } } }Automated / local
cd cli/project-runner && go test ./...— passsh scripts/check-go-cli.sh— exit 0sh scripts/build-go-cli.sh— exit 0PATH=<PROJECT_ROOT>/dist/darwin-arm64:$PATH sh scripts/regression-harness-resume-play-paused-arm.sh --project-path <PROJECT_ROOT>— exit 0