Skip to content

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

Merged
hatayama merged 1 commit into
v3-betafrom
feature/mouse-press-delivered-verdict
Sep 2, 2026
Merged

hatayama merged 1 commit into
v3-betafrom
feature/mouse-press-delivered-verdict

Conversation

@hatayama

@hatayama hatayama commented Sep 2, 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.

Closes #2382

https://claude.ai/code/session_01R3jkx6NbNYKPdy5q1NSWYo

Review in cubic

…interrupted by a pause point

When a Click or LongPress landed on the same frame as a pause-point hit, the
response hedged: "the game may have registered the press". Callers then had
to re-derive whether the world changed from unrelated observations. The
verdict is actually definite: a press is applied only inside an Input
System update of the configured gameplay type, so pressWasApplied means the
game's polling in that frame observed the edge, and its absence means the
queued edge was discarded before any gameplay update ran.

- Add PressDeliveredToGame (nullable) to the mouse input response, set to
  true/false on interrupted Click/LongPress and left null elsewhere
- Reword both interruption messages: delivered means the world state may
  already have changed, so re-check it instead of retrying; discarded means
  the game never observed a press and a retry after resume is safe
- Document the field in the skill reference and point the SKILL.md
  interruption note at it (generated copies regenerated)
- Add factory tests for the three outcomes

Closes #2382

Claude-Session: https://claude.ai/code/session_01R3jkx6NbNYKPdy5q1NSWYo
@coderabbitai

coderabbitai Bot commented Sep 2, 2026 •

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Team

Run ID: 4f1c8acc-98ad-42d3-888d-4a16a85498aa

📥 Commits

Reviewing files that changed from the base of the PR and between ecbb004 and 6b88ab7.

⛔ 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

Included review availability: Your plan provides up to 4 included reviews per hour; 0 remain after this review.


📝 Walkthrough

Walkthrough

The mouse input response now reports whether an interrupted press reached gameplay before a pause point. The factory sets this nullable value, tests cover its states, and the bundled skill documentation explains how to interpret it.

Changes

Interrupted mouse input verdict

Layer / File(s) Summary
Response contract and factory behavior
Packages/src/Editor/FirstPartyTools/SimulateMouseInput/..., Assets/Tests/Editor/MouseInputSimulationResponseFactoryTests.cs
Adds PressDeliveredToGame, populates it for interrupted button actions, updates interruption messages, and tests delivered, discarded, and non-button cases.
Skill and output documentation
.agents/skills/uloop-simulate-mouse-input/..., .claude/skills/uloop-simulate-mouse-input/..., Packages/src/Editor/FirstPartyTools/SimulateMouseInput/Skill/...
Documents the true, false, and null field states and directs inspection of the field before retrying an interrupted action.

Estimated code review effort: 2 (Simple) | ~15 minutes

Merge Risk: ⚪ Minimal · up to 6b88a

The PR makes a localized response and documentation change for interrupted mouse input, with no actionable merge-blocking risk remaining after normal checks and review.

Possibly related PRs

  • hatayama/unity-cli-loop#1688: Updates related simulate-mouse-input pause-point documentation without the response-field and factory changes in this PR.
🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly summarizes the primary change: interrupted mouse presses now report whether they reached the game.
Description check ✅ Passed The description directly explains the new verdict, behavior, documentation updates, tests, and verification results.
Linked Issues check ✅ Passed The implementation satisfies issue #2382 by adding PressDeliveredToGame, deriving it from press application, updating guidance for delivered and discarded presses, documenting the behavior, and adding…
Out of Scope Changes check ✅ Passed All reviewed changes support issue #2382: implementation, response documentation, generated skill copies, interruption guidance, and focused tests. No unrelated changes are evident.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 4 functions across 3 files. (6 skipped: 6 …
Full details: Linked Issues check

Explanation

The implementation satisfies issue #2382 by adding PressDeliveredToGame, deriving it from press application, updating guidance for delivered and discarded presses, documenting the behavior, and adding coverage for both outcomes.

Full details: Docstring Coverage

Explanation

Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 4 functions across 3 files. (6 skipped: 6 unsupported.)

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feature/mouse-press-delivered-verdict

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/Skill/SKILL.md">

<violation number="1" location="Packages/src/Editor/FirstPartyTools/SimulateMouseInput/Skill/SKILL.md:62">
P3: For interrupted MoveDelta/SmoothDelta/Scroll, `InterruptedByPausePoint` can be true while `PressDeliveredToGame` is always null, so this unconditional instruction sends the agent to a field with no guidance. Scope the note to Click/LongPress, matching the reference doc's "null for other actions" rule.</violation>
</file>

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

Re-trigger cubic

### Pause Point Inspection (Standard for E2E)

For standard frame proof when this input drives a state transition, follow the `uloop-pause-point` skill — it covers line placement and interruption semantics. Tool-specific note: if `InterruptedByPausePoint: true`, Unity is paused and input bookkeeping was safely released. Clear inspection-only pause points (`uloop clear-pause-point --all`) before final validation.
For standard frame proof when this input drives a state transition, follow the `uloop-pause-point` skill — it covers line placement and interruption semantics. Tool-specific note: if `InterruptedByPausePoint: true`, Unity is paused; read `PressDeliveredToGame` before retrying. Clear inspection-only pause points (`uloop clear-pause-point --all`) before final validation.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P3: For interrupted MoveDelta/SmoothDelta/Scroll, InterruptedByPausePoint can be true while PressDeliveredToGame is always null, so this unconditional instruction sends the agent to a field with no guidance. Scope the note to Click/LongPress, matching the reference doc's "null for other actions" rule.

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/Skill/SKILL.md, line 62:

<comment>For interrupted MoveDelta/SmoothDelta/Scroll, `InterruptedByPausePoint` can be true while `PressDeliveredToGame` is always null, so this unconditional instruction sends the agent to a field with no guidance. Scope the note to Click/LongPress, matching the reference doc's "null for other actions" rule.</comment>

<file context>
@@ -59,7 +59,7 @@ uloop simulate-mouse-input --dry-run --x <x> --y <y> [--layer-mask <mask>] [--ma
 ### Pause Point Inspection (Standard for E2E)
 
-For standard frame proof when this input drives a state transition, follow the `uloop-pause-point` skill — it covers line placement and interruption semantics. Tool-specific note: if `InterruptedByPausePoint: true`, Unity is paused and input bookkeeping was safely released. Clear inspection-only pause points (`uloop clear-pause-point --all`) before final validation.
+For standard frame proof when this input drives a state transition, follow the `uloop-pause-point` skill — it covers line placement and interruption semantics. Tool-specific note: if `InterruptedByPausePoint: true`, Unity is paused; read `PressDeliveredToGame` before retrying. Clear inspection-only pause points (`uloop clear-pause-point --all`) before final validation.
 
 ## When to use this vs simulate-mouse-ui
</file context>
Suggested change
For standard frame proof when this input drives a state transition, follow the `uloop-pause-point` skill — it covers line placement and interruption semantics. Tool-specific note: if `InterruptedByPausePoint: true`, Unity is paused; read `PressDeliveredToGame` before retrying. Clear inspection-only pause points (`uloop clear-pause-point --all`) before final validation.
Tool-specific note: if `InterruptedByPausePoint: true`, Unity is paused; for `Click`/`LongPress`, read `PressDeliveredToGame` before retrying (motion/scroll actions return null). Clear inspection-only pause points (`uloop clear-pause-point --all`) before final validation.

@hatayama
hatayama merged commit aa4c218 into v3-beta Sep 2, 2026
16 checks passed
@hatayama
hatayama deleted the feature/mouse-press-delivered-verdict branch September 2, 2026 11:36
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