Skip to content

feat: Add Status action to control-play-mode#1943

Merged
hatayama merged 6 commits into
feature/round8-pause-point-improvementsfrom
feat/control-play-mode-status-action
Jul 22, 2026
Merged

feat: Add Status action to control-play-mode#1943
hatayama merged 6 commits into
feature/round8-pause-point-improvementsfrom
feat/control-play-mode-status-action

Conversation

@hatayama

@hatayama hatayama commented Jul 22, 2026

Copy link
Copy Markdown
Owner

Summary

  • control-play-mode now supports --action Status, a side-effect-free way to check whether Play Mode is running or paused.

User Impact

  • Before: checking Play Mode state meant issuing a Play/Stop/Pause action, which could unintentionally change state, or waiting for a status side-channel that wasn't part of the documented command surface.
  • After: --action Status reports 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

  • Added Status to the control-play-mode action enum (both the Unity-side schema and the CLI tool catalog).
  • Status reuses the existing response shape (IsPlaying/IsPaused/etc.) with Changed=false and skips the unsaved-changes quiet-save path entirely.
  • Updated the control-play-mode skill doc with the new action and a note on the existing CONTROL_PLAY_MODE_UNSAVED_CHANGES fast failure.

Verification

  • TDD: added a test referencing the new Status enum value before it existed (confirmed CS0117 compile 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).
  • Added a Go regression test locking in that Status never enters the state-wait poll loop; full Go suite (check-go-cli.sh) passed with 0 lint issues.
  • stamp-release-inputs.sh run; produced no changes, since the tool catalog JSON is not part of the shared-input hash.
  • Live end-to-end check against a running Unity Editor: uloop control-play-mode --action Status returned the current state with Changed: false and no observable side effects.

Review in cubic

hatayama added 3 commits July 22, 2026 18:06
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.
@coderabbitai

coderabbitai Bot commented Jul 22, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Warning

Review limit reached

@hatayama, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 38 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

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 configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 2db8c57f-20e3-4dd9-9d7c-203b271f0ca0

📥 Commits

Reviewing files that changed from the base of the PR and between 581777f and d003ca7.

📒 Files selected for processing (6)
  • .agents/skills/uloop-control-play-mode/SKILL.md
  • .claude/skills/uloop-control-play-mode/SKILL.md
  • Assets/Tests/Editor/ControlPlayModeUseCaseTests.cs
  • Packages/src/Editor/FirstPartyTools/ControlPlayMode/ControlPlayModeUseCase.cs
  • Packages/src/Editor/FirstPartyTools/ControlPlayMode/Skill/SKILL.md
  • cli/common/tools/default-tools.json
📝 Walkthrough

Walkthrough

Adds Status to control-play-mode, implements it as a read-only state query, prevents CLI state-wait polling for it, updates documentation and tool schema, and adds Unity and Go tests for the behavior.

Changes

Play Mode Status Action

Layer / File(s) Summary
Status action contract and documentation
Packages/src/Editor/FirstPartyTools/ControlPlayMode/ControlPlayModeSchema.cs, cli/common/tools/default-tools.json, Packages/src/Editor/FirstPartyTools/ControlPlayMode/Skill/SKILL.md, .agents/skills/..., .claude/skills/...
The public action enum, tool schema, and documentation now include Status, including its non-mutating behavior and documented unsaved-change errors for Play.
Status action execution
Packages/src/Editor/FirstPartyTools/ControlPlayMode/ControlPlayModeUseCase.cs
Status returns the current play-mode result with the Play mode status message and no change flags.
Read-only behavior validation
Assets/Tests/Editor/ControlPlayModeUseCaseTests.cs, cli/project-runner/internal/projectrunner/control_play_mode_wait_test.go
Tests verify that Status avoids quiet saving and editor-state setters and does not enter state-wait polling.

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
Loading

Possibly related PRs

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly names the main change: adding the Status action to control-play-mode.
Description check ✅ Passed The description accurately summarizes the new Status action, its behavior, and the related docs/tests.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/control-play-mode-status-action

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.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 2

🧹 Nitpick comments (1)
Assets/Tests/Editor/ControlPlayModeUseCaseTests.cs (1)

99-129: 🎯 Functional Correctness | 🔵 Trivial | ⚡ Quick win

Cover 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, and StepCallCount remain 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

📥 Commits

Reviewing files that changed from the base of the PR and between f45e3cf and 581777f.

📒 Files selected for processing (8)
  • .agents/skills/uloop-control-play-mode/SKILL.md
  • .claude/skills/uloop-control-play-mode/SKILL.md
  • Assets/Tests/Editor/ControlPlayModeUseCaseTests.cs
  • Packages/src/Editor/FirstPartyTools/ControlPlayMode/ControlPlayModeSchema.cs
  • Packages/src/Editor/FirstPartyTools/ControlPlayMode/ControlPlayModeUseCase.cs
  • Packages/src/Editor/FirstPartyTools/ControlPlayMode/Skill/SKILL.md
  • cli/common/tools/default-tools.json
  • cli/project-runner/internal/projectrunner/control_play_mode_wait_test.go

Comment thread cli/common/tools/default-tools.json Outdated
Comment thread Packages/src/Editor/FirstPartyTools/ControlPlayMode/ControlPlayModeUseCase.cs Outdated
hatayama added 3 commits July 22, 2026 18:21
…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).
@hatayama
hatayama merged commit d7aa587 into feature/round8-pause-point-improvements Jul 22, 2026
1 check passed
@hatayama
hatayama deleted the feat/control-play-mode-status-action branch July 22, 2026 09:29
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