Skip to content

feat: Scope clear-pause-point resume to pause-point-owned pauses#1910

Merged
hatayama merged 2 commits into
feature/round6-pause-point-improvementsfrom
feature/round6-clear-scoped-resume
Jul 21, 2026
Merged

feat: Scope clear-pause-point resume to pause-point-owned pauses#1910
hatayama merged 2 commits into
feature/round6-pause-point-improvementsfrom
feature/round6-clear-scoped-resume

Conversation

@hatayama

@hatayama hatayama commented Jul 21, 2026

Copy link
Copy Markdown
Owner

Summary

Round-6 pause-point improvements, PR-1 of 5. Base branch: feature/round6-pause-point-improvements (the Round-6 integration branch), not v3-beta.

clear-pause-point (both --id and --all) previously called ResumeEditorPause() unconditionally. Clearing a marker therefore also resumed a manual pause the user had set outside the pause-point workflow (control-play-mode --action Pause, or the Editor pause button), discarding their run state.

This scopes the resume so a clear only ever resumes a pause-point-owned pause.

Changes

  • UloopPausePointRegistry: Clear/ClearAll now resume only while a pause window is open (_pauseWindowStartUtc.HasValue) — i.e. only when a pause-point hit is what is holding the Editor paused. A manual pause leaves no open window and is left untouched. New private helper ResumeEditorPauseIfOwnedByPausePoint() centralizes the decision and reports whether it resumed.
  • Client-disconnect and expiry paths are unchanged: ApplyPendingClientDisconnectResume and ApplyCaptureWindowExpirations still resume unconditionally, because they must guarantee release of the Editor even when the pause was manual.
  • Resume propagation (no out/ref, per repo convention): Clear returns a tuple (UloopPausePointSnapshot Snapshot, bool ResumedFromPause); UloopPausePointClearAllResult gains a ResumedFromPause field.
  • Warning: the clear-pause-point tool response sets a new SourcePausePointConstants.ClearResumedPlayModeWarning when the clear actually resumed Play Mode.
  • Rewrote the stale "Why always Resume: Option B ..." comments and the UnityEditorPausePointPauseController.Resume() comment to match the new design.

Tests

Added EditMode coverage in PausePointTests (via the pure-C# FakePauseController, new PauseExternally() seam):

  • Clear / ClearAll resume and report ResumedFromPause=true when a hit owns the pause.
  • Clear / ClearAll leave a manual pause untouched (ResumeCount==0) and report ResumedFromPause=false.
  • clear-pause-point / --all tool responses carry the resume warning when they resume, and no warning when a manual pause is preserved.

Existing disconnect/expiry tests are unchanged and still assert unconditional resume.

Validation

  • uloop compile: 0 errors, 0 warnings.
  • uloop run-tests (EditMode, .*PausePoint.*): 222 passed, 0 failed.

Skill files, version fields, changelogs, and protocolVersion are intentionally untouched (skill wording is handled separately in PR-5).

Review in cubic

clear-pause-point previously called ResumeEditorPause() unconditionally,
so clearing a marker also resumed a manual pause the user had set outside
the pause-point workflow (control-play-mode --action Pause or the Editor
pause button). This lost the user's manual pause state.

Clear/ClearAll now resume only while a pause window is open, i.e. only when
a pause-point hit is what is holding the Editor paused. A manual pause
leaves no open window and is left untouched. Client-disconnect and expiry
paths still resume unconditionally, because those must guarantee release of
the Editor even when the pause was manual.

The registry reports whether it actually resumed (Clear returns a tuple,
ClearAll adds ResumedFromPause to its result DTO), and the clear-pause-point
tool response surfaces a warning when the clear resumed Play Mode as a side
effect. Rewrote the stale "Option B" comments accordingly.
@coderabbitai

coderabbitai Bot commented Jul 21, 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: 46 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: 15b31b3f-6c7b-4e6b-9a47-d725217c1849

📥 Commits

Reviewing files that changed from the base of the PR and between 93ac269 and 0248e65.

📒 Files selected for processing (2)
  • Assets/Tests/Editor/PausePointTests.cs
  • Packages/src/Runtime/PausePoints/UloopPausePointRegistry.cs
📝 Walkthrough

Walkthrough

Pause-point clear operations now return whether they resumed a pause-point-owned editor pause. Tool responses expose a warning for that case, while manual pauses remain active. Runtime result types, callers, and editor tests were updated for the new contracts.

Changes

Pause-point clear flow

Layer / File(s) Summary
Runtime clear contract and ownership
Packages/src/Runtime/PausePoints/UloopPausePointClearAllResult.cs, Packages/src/Runtime/PausePoints/UloopPausePointRegistry.cs, Packages/src/Runtime/PausePoints/UnityEditorPausePointPauseController.cs
Clear operations report pause-point-owned resumption and only resume pauses owned by pause points.
Tool response propagation
Packages/src/Editor/FirstPartyTools/PausePoint/*, Packages/src/Editor/Infrastructure/Api/PausePointStatusBridgeCommand.cs
Clear responses set the standardized warning when clearing resumes Play Mode, and callers consume the updated tuple result.
Clear behavior validation
Assets/Tests/Editor/PausePointCaptureModeTests.cs, Assets/Tests/Editor/PausePointTests.cs
Tests cover updated return handling, owned-pause resumption, preserved manual pauses, bulk clearing, and warning behavior.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Sequence Diagram(s)

sequenceDiagram
  participant PausePointTool
  participant UloopPausePointRegistry
  participant UnityEditorPausePointPauseController
  PausePointTool->>UloopPausePointRegistry: Clear or ClearAll
  UloopPausePointRegistry->>UnityEditorPausePointPauseController: Resume only for owned pause
  UnityEditorPausePointPauseController-->>UloopPausePointRegistry: Pause state updated
  UloopPausePointRegistry-->>PausePointTool: Snapshot and resumedFromPause
  PausePointTool-->>PausePointTool: Set clear warning when resumed
Loading

Possibly related PRs

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 12.50% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly summarizes the main change: scoping clear-pause-point resume behavior to pause-point-owned pauses.
Description check ✅ Passed The description matches the changeset and explains the scoped resume behavior, warnings, and tests.
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 feature/round6-clear-scoped-resume

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.

ResumeEditorPauseIfOwnedByPausePoint checked only _pauseWindowStartUtc,
which is closed by ClosePauseWindowIfEditorResumedExternally on the Editor
update tick. If a hit opened the window and the Editor was then unpaused
manually (pause button / control-play-mode) before that tick ran, a clear
in between would report ResumedFromPause=true even though Resume is a no-op
on an already-unpaused Editor, emitting a false "resumed Play Mode" warning,
and the stale window would keep freezing every marker's expiry countdown.

Reconcile via ClosePauseWindowIfEditorResumedExternally at the start of the
helper so the stale window is credited and closed, and the clear correctly
reports it did not resume. Covers both Clear and ClearAll (shared path).
@hatayama
hatayama merged commit 570f18a into feature/round6-pause-point-improvements Jul 21, 2026
1 of 2 checks passed
@hatayama
hatayama deleted the feature/round6-clear-scoped-resume branch July 21, 2026 05:56
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.

1 participant