Skip to content

fix: simulate-mouse-input reports whether an interrupted press reached the game instead of "may have registered" - #2530

Merged
hatayama merged 1 commit into
mainfrom
port/simulate-mouse-input-delivered-verdict
Sep 3, 2026
Merged

hatayama merged 1 commit into
mainfrom
port/simulate-mouse-input-delivered-verdict

Conversation

@hatayama

@hatayama hatayama commented Sep 3, 2026 •

Copy link
Copy Markdown
Owner

Summary

  • When a simulate-mouse-input Click or LongPress is interrupted by a pause-point hit, the response now gives a definite PressDeliveredToGame: true/false verdict instead of "the game may have registered the press".

User Impact

  • Before: a click landing on the same frame as a pause-point hit returned ...so the game may have registered the press. The world-state change was left indeterminate. In the reported session the click had mined a block and the tester only found out three commands later by back-tracking an unexpected coordinate.
  • After: the response says whether the press reached the game before the pause and what to do about it.
    • PressDeliveredToGame: true — the Input System processed the press edge in a gameplay update before the pause, so game code polling that frame observed it and the world state may already have changed. The message says not to retry and to re-check the affected state and pause-point-status.
    • PressDeliveredToGame: false — the queued edge was discarded before any gameplay update ran, the game never observed a press, and a retry after resume is safe.
    • null for non-button actions and for uninterrupted responses.
  • Why the verdict is definite: the press is applied only inside an Input System update of the configured gameplay type, so "applied" is exactly "the game's polling in that frame could see it". Whether game code reacted is still up to the caller to check, which the message now says explicitly.

Changes

  • SimulateMouseInputResponse.PressDeliveredToGame (nullable bool), set on interrupted Click/LongPress from the existing pressWasApplied flag.
  • Both interruption messages reworded around the definite outcome and next step.
  • Skill reference output-and-coordinates.md documents the field; the SKILL.md interruption note points at it (generated .claude/ and .agents/ copies regenerated; SKILL.md stays under the size cap).
  • New MouseInputSimulationResponseFactoryTests covering delivered, discarded, and non-button outcomes.

Verification

  • uloop run-tests --filter-type regex --filter-value "MouseInputSimulationResponseFactoryTests|SimulateMouseInputDryRunTests": the 3 new factory tests pass. Two pre-existing SimulateMouseInputDryRunTests cases fail in this Editor environment (Hit: false; the test reads a 640x480 Game View size while the actual Game View is 1728x1028). That path does not touch the interruption response, so it is unrelated to this change.
  • check-skill-size: no SKILL.md over the limit.

Refs #2382

https://claude.ai/code/session_01R3jkx6NbNYKPdy5q1NSWYo

Review in cubic

https://claude.ai/code/session_01R3jkx6NbNYKPdy5q1NSWYo

…d the game instead of "may have registered" (#2509)

(cherry picked from commit aa4c218)
@coderabbitai

coderabbitai Bot commented Sep 3, 2026

Copy link
Copy Markdown
Contributor

Warning

Review limit reached

Next included review available in 9 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used all 4 included reviews currently available.

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Learn how review limits work.

Review configuration:

⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Team

Run ID: ce2c41a1-3848-4a3d-8f8c-d43ddbd9694b

📥 Commits

Reviewing files that changed from the base of the PR and between 52e9343 and fda5ff7.

⛔ Files ignored due to path filters (1)
  • Assets/Tests/Editor/MouseInputSimulationResponseFactoryTests.cs.meta is excluded by none and included by none
📒 Files selected for processing (9)
  • .agents/skills/uloop-simulate-mouse-input/SKILL.md
  • .agents/skills/uloop-simulate-mouse-input/references/output-and-coordinates.md
  • .claude/skills/uloop-simulate-mouse-input/SKILL.md
  • .claude/skills/uloop-simulate-mouse-input/references/output-and-coordinates.md
  • Assets/Tests/Editor/MouseInputSimulationResponseFactoryTests.cs
  • Packages/src/Editor/FirstPartyTools/SimulateMouseInput/MouseInputSimulationResponseFactory.cs
  • Packages/src/Editor/FirstPartyTools/SimulateMouseInput/SimulateMouseInputResponse.cs
  • Packages/src/Editor/FirstPartyTools/SimulateMouseInput/Skill/SKILL.md
  • Packages/src/Editor/FirstPartyTools/SimulateMouseInput/Skill/references/output-and-coordinates.md

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.

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

1 issue found across 10 files

Prompt for AI agents (unresolved issues)

Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.


<file name="Packages/src/Editor/FirstPartyTools/SimulateMouseInput/MouseInputSimulationResponseFactory.cs">

<violation number="1" location="Packages/src/Editor/FirstPartyTools/SimulateMouseInput/MouseInputSimulationResponseFactory.cs:60">
P1: The reworded interruption messages break the existing exact-match assertions in Assets/Tests/PlayMode/MouseInputSimulationResponseFactoryTests.cs (InterruptedButtonResult_WithMultiplePausePointHits_MapsPauseEvidenceAndButtonPosition and InterruptedButtonResult_WhenPressWasApplied_ReportsDeliveredBeforePauseMessage), which still assert the old messages via Is.EqualTo. Update those tests to the new wording (and assert PressDeliveredToGame) so the PlayMode suite keeps passing.</violation>
</file>

Reply with feedback, questions, or to request a fix.

Re-trigger cubic

string message = pressWasApplied
? $"Mouse input stopped because Unity paused during Pause Point inspection. Button '{buttonName}' press was already delivered to the game before the pause; Unity CLI Loop released it from bookkeeping, so the game may have registered the press."
: $"Mouse input stopped because Unity paused during Pause Point inspection. Button '{buttonName}' was released from Unity CLI Loop bookkeeping; the queued input edge was discarded.";
? $"Mouse input stopped because Unity paused during Pause Point inspection. Button '{buttonName}' press was delivered to the game before the pause: the Input System processed the press edge in a gameplay update, so game code polling that frame observed it and the world state may already have changed. Do not retry the press; re-check the affected state (and pause-point-status) before deciding the next step."

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1: The reworded interruption messages break the existing exact-match assertions in Assets/Tests/PlayMode/MouseInputSimulationResponseFactoryTests.cs (InterruptedButtonResult_WithMultiplePausePointHits_MapsPauseEvidenceAndButtonPosition and InterruptedButtonResult_WhenPressWasApplied_ReportsDeliveredBeforePauseMessage), which still assert the old messages via Is.EqualTo. Update those tests to the new wording (and assert PressDeliveredToGame) so the PlayMode suite keeps passing.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At Packages/src/Editor/FirstPartyTools/SimulateMouseInput/MouseInputSimulationResponseFactory.cs, line 60:

<comment>The reworded interruption messages break the existing exact-match assertions in Assets/Tests/PlayMode/MouseInputSimulationResponseFactoryTests.cs (InterruptedButtonResult_WithMultiplePausePointHits_MapsPauseEvidenceAndButtonPosition and InterruptedButtonResult_WhenPressWasApplied_ReportsDeliveredBeforePauseMessage), which still assert the old messages via Is.EqualTo. Update those tests to the new wording (and assert PressDeliveredToGame) so the PlayMode suite keeps passing.</comment>

<file context>
@@ -47,15 +47,18 @@ internal static SimulateMouseInputResponse SuccessButtonResult(
             string message = pressWasApplied
-                ? $"Mouse input stopped because Unity paused during Pause Point inspection. Button '{buttonName}' press was already delivered to the game before the pause; Unity CLI Loop released it from bookkeeping, so the game may have registered the press."
-                : $"Mouse input stopped because Unity paused during Pause Point inspection. Button '{buttonName}' was released from Unity CLI Loop bookkeeping; the queued input edge was discarded.";
+                ? $"Mouse input stopped because Unity paused during Pause Point inspection. Button '{buttonName}' press was delivered to the game before the pause: the Input System processed the press edge in a gameplay update, so game code polling that frame observed it and the world state may already have changed. Do not retry the press; re-check the affected state (and pause-point-status) before deciding the next step."
+                : $"Mouse input stopped because Unity paused during Pause Point inspection. Button '{buttonName}' was released from Unity CLI Loop bookkeeping; the queued input edge was discarded before any gameplay update processed it, so the game never observed a press and it is safe to retry after resume.";
             SimulateMouseInputResponse result = new()
</file context>

@hatayama
hatayama merged commit 3f06b4e into main Sep 3, 2026
16 checks passed
@hatayama
hatayama deleted the port/simulate-mouse-input-delivered-verdict branch September 3, 2026 05:18
@github-actions github-actions Bot mentioned this pull request Sep 3, 2026
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