feat: Add Status action to control-play-mode#1943
Conversation
Callers previously had no way to inspect PlayMode state without also requesting a transition (Play/Stop/Pause) or relying on the internal StatusOnly polling flag, which is not part of the public tool schema. Status returns the same response fields (IsPlaying/IsPaused/etc.) with Changed=false, never enters the quiet-save path, and is intentionally excluded from the Go-side wait-for-state-transition allowlist so it returns the initial response immediately instead of polling.
…rol-play-mode skill The Status action (this PR) and the CONTROL_PLAY_MODE_UNSAVED_CHANGES fast failure (#1941) were both observable in responses but absent from the skill, so an agent had no way to know a side-effect-free state query exists or what to do when Play refuses to start over an Untitled scene.
Syncs the generated .claude/ and .agents/ skill files with the source SKILL.md update documenting the new Status action and the CONTROL_PLAY_MODE_UNSAVED_CHANGES fast failure.
|
Warning Review limit reached
Next review available in: 38 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 Run ID: 📒 Files selected for processing (6)
📝 WalkthroughWalkthroughAdds ChangesPlay Mode Status Action
Estimated code review effort: 2 (Simple) | ~10 minutes Sequence Diagram(s)sequenceDiagram
participant ProjectRunner
participant ControlPlayModeUseCase
participant EditorState
ProjectRunner->>ControlPlayModeUseCase: Dispatch Status action
ControlPlayModeUseCase->>EditorState: Read current play-mode state
ControlPlayModeUseCase-->>ProjectRunner: Return status without waiting or side effects
Possibly related PRs
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 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: 2
🧹 Nitpick comments (1)
Assets/Tests/Editor/ControlPlayModeUseCaseTests.cs (1)
99-129: 🎯 Functional Correctness | 🔵 Trivial | ⚡ Quick winCover blocker and state variants for
Status.The new test only exercises playing/unpaused state with no blockers. Add stopped, paused, compile-error, and unsaved-change cases, asserting blocker metadata is returned while
SaveCallCount, state setters, andStepCallCountremain unchanged.🤖 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 `@Assets/Tests/Editor/ControlPlayModeUseCaseTests.cs` around lines 99 - 129, Expand ExecuteAsync_WhenStatusAction_ReturnsCurrentStateWithoutSideEffects to cover stopped, paused, compile-error, and unsaved-change states. Assert Status returns the correct IsPlaying, IsPaused, BlockedByCompileErrors, and BlockedByUnsavedChanges metadata for each case, while SaveCallCount, IsPlayingSetCount, IsPausedSetCount, and StepCallCount remain unchanged.
🤖 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 `@cli/common/tools/default-tools.json`:
- Line 323: Align the public action summaries with the complete Play, Stop,
Pause, Step, and Status set: update cli/common/tools/default-tools.json at line
323 to include Step, and update the introductory summaries at line 21 in
Packages/src/Editor/FirstPartyTools/ControlPlayMode/Skill/SKILL.md,
.agents/skills/uloop-control-play-mode/SKILL.md, and
.claude/skills/uloop-control-play-mode/SKILL.md to list all five actions.
In
`@Packages/src/Editor/FirstPartyTools/ControlPlayMode/ControlPlayModeUseCase.cs`:
- Around line 111-112: Update the public Status branch in the ControlPlayMode
use case to build a read-only response that reports current compile-error and
unsaved-change blockers, populating BlockedByCompileErrors, CompileErrors, and
BlockedByUnsavedChanges without saving or mutating the Editor. Reuse the
existing blocker-detection logic where applicable, preserve normal status
behavior when unblocked, and add tests covering both compile failures and
unsaved changes while keeping the skill documentation and tool contract
consistent.
---
Nitpick comments:
In `@Assets/Tests/Editor/ControlPlayModeUseCaseTests.cs`:
- Around line 99-129: Expand
ExecuteAsync_WhenStatusAction_ReturnsCurrentStateWithoutSideEffects to cover
stopped, paused, compile-error, and unsaved-change states. Assert Status returns
the correct IsPlaying, IsPaused, BlockedByCompileErrors, and
BlockedByUnsavedChanges metadata for each case, while SaveCallCount,
IsPlayingSetCount, IsPausedSetCount, and StepCallCount remain unchanged.
🪄 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
Run ID: e2c4e2a9-d358-49e8-bafc-265d4751e596
📒 Files selected for processing (8)
.agents/skills/uloop-control-play-mode/SKILL.md.claude/skills/uloop-control-play-mode/SKILL.mdAssets/Tests/Editor/ControlPlayModeUseCaseTests.csPackages/src/Editor/FirstPartyTools/ControlPlayMode/ControlPlayModeSchema.csPackages/src/Editor/FirstPartyTools/ControlPlayMode/ControlPlayModeUseCase.csPackages/src/Editor/FirstPartyTools/ControlPlayMode/Skill/SKILL.mdcli/common/tools/default-tools.jsoncli/project-runner/internal/projectrunner/control_play_mode_wait_test.go
…porting The intro sentence listed only play/stop/pause (Step was already missing before this PR), and the Status note predated the decision to report the current compile-error blocker state, so it wrongly implied Status carries no blocker information at all.
CodeRabbit flagged that Status always claimed no blockers even when Unity had failed compile errors, which actively misreports the state a Play attempt would hit. Status now reads BlockedByCompileErrors and CompileErrors from the existing read-only compile-failure checks (no new compile triggered), while still never predicting BlockedByUnsavedChanges, since that field means a save attempt during this request failed and Status makes no save attempt. Also fixes the tool catalog's control-play-mode description, which listed play/stop/pause/status but omitted step.
Syncs the generated .claude/.agents skill docs with Fable's SKILL.md source update (compile-error blocker reporting note).
d7aa587
into
feature/round8-pause-point-improvements
Summary
control-play-modenow supports--action Status, a side-effect-free way to check whether Play Mode is running or paused.User Impact
Play/Stop/Pauseaction, which could unintentionally change state, or waiting for a status side-channel that wasn't part of the documented command surface.--action Statusreports the current state (playing/paused, any blocking compile errors or unsaved changes) without starting, stopping, pausing, or saving anything, and returns immediately instead of waiting for a state transition.Changes
Statusto thecontrol-play-modeaction enum (both the Unity-side schema and the CLI tool catalog).Statusreuses the existing response shape (IsPlaying/IsPaused/etc.) withChanged=falseand skips the unsaved-changes quiet-save path entirely.control-play-modeskill doc with the new action and a note on the existingCONTROL_PLAY_MODE_UNSAVED_CHANGESfast failure.Verification
Statusenum value before it existed (confirmedCS0117compile failure), then implemented it (uloop compile: 0 errors / 0 warnings).ControlPlayModeUseCaseTests: 19/19 passed, including the new Status coverage (no state mutation, no quiet-save calls).Statusnever enters the state-wait poll loop; full Go suite (check-go-cli.sh) passed with 0 lint issues.stamp-release-inputs.shrun; produced no changes, since the tool catalog JSON is not part of the shared-input hash.uloop control-play-mode --action Statusreturned the current state withChanged: falseand no observable side effects.