Skip to content

feat: check 3D physics hits with simulate-mouse-input --dry-run - #2072

Merged
hatayama merged 4 commits into
v3-betafrom
feature/fold-raycast-into-simulate-mouse-input
Jul 29, 2026
Merged

feat: check 3D physics hits with simulate-mouse-input --dry-run#2072
hatayama merged 4 commits into
v3-betafrom
feature/fold-raycast-into-simulate-mouse-input

Conversation

@hatayama

@hatayama hatayama commented Jul 29, 2026

Copy link
Copy Markdown
Owner

Summary

  • You can check what a Game View coordinate hits in 3D physics with uloop simulate-mouse-input --dry-run (works in EditMode; no Input System required).
  • The standalone raycast tool and uloop-raycast skill are removed; existing installs prune uloop-raycast on the next uloop skills install.

Closes #2068

User Impact

  • Before: a separate uloop raycast command was needed only to preview 3D physics hits before clicking.
  • After: the same check is simulate-mouse-input --dry-run (optional --layer-mask / --max-distance). Agents should stop calling raycast.

Changes

  • Add DryRun, LayerMask, and MaxDistance to simulate-mouse-input, with hit fields on the response.
  • Short-circuit dry-run before Input System / PlayMode preflight; keep shared GameViewRaycastUtility for screenshot raycast-grid annotation.
  • Remove the Raycast first-party tool, tests, catalog entry, and skill copies; register uloop-raycast in both deprecated-skill lists.
  • Update simulate-mouse-input / screenshot skills, README, and shared-inputs stamps.

Verification

  • uloop compile: 0 errors / 0 warnings
  • uloop run-tests --filter-type regex --filter-value SimulateMouseInputDryRunTests: TestCount 7, PassedCount 7
  • uloop run-tests --filter-type regex --filter-value "SimulateMouseInputDryRunTests|DefaultToolsCatalogDriftTests": 8/8 (7 dry-run + 1 catalog drift)
  • scripts/check-go-cli.sh: pass
  • go run ./cmd/sync-tool-docs --check: no drift
  • uloop list: raycast absent; simulate-mouse-input present
  • Smoke: uloop simulate-mouse-input --dry-run --x 400 --y 300 returns conversion metadata (and Success=false when Camera.main is missing)

Known pre-existing failure

Full EditMode suite runs on this branch still report one failure in WatchExpressionCompilerTests.CompileAsync_ValidExpressionReturnsCompiledEvaluator: an unhandled CS0012 log from the shared Roslyn worker (HashAlgorithmName / System.Security.Cryptography.Primitives). The same failure reproduces on clean origin/v3-beta without this PR's changes, so it is not caused by this diff. The test passes when run alone. Investigation is tracked separately and is out of scope for this PR.

Review in cubic

hatayama and others added 3 commits July 29, 2026 22:26
Standalone raycast only wrapped GameViewRaycastUtility for pre-click hit checks.
Fold that path into simulate-mouse-input so EditMode and Input-System-less environments can inspect 3D hits without a separate tool.

Co-authored-by: Cursor <cursoragent@cursor.com>
Its only use case was pre-click 3D hit checks, now covered by
simulate-mouse-input --dry-run. Register uloop-raycast in deprecatedSkillNames
so already-installed agent skill copies are pruned on the next skills install.

Co-authored-by: Cursor <cursoragent@cursor.com>
Document --dry-run / --layer-mask / --max-distance, drop the standalone
raycast catalog entry and skill guidance map, and refresh README plus
shared-inputs stamps after the cli/common catalog change.

Co-authored-by: Cursor <cursoragent@cursor.com>
@coderabbitai

coderabbitai Bot commented Jul 29, 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: 33 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 Plus

Run ID: c08be31e-d268-4414-9813-bef271f603b9

📥 Commits

Reviewing files that changed from the base of the PR and between db5f29f and a02a21d.

📒 Files selected for processing (3)
  • .agents/skills/uloop-screenshot/references/annotated-elements.md
  • .claude/skills/uloop-screenshot/references/annotated-elements.md
  • Packages/src/Editor/FirstPartyTools/Screenshot/Skill/references/annotated-elements.md
📝 Walkthrough

Walkthrough

The standalone raycast tool is folded into simulate-mouse-input through a new --dry-run path. Runtime responses, physics-hit tests, tool schemas, documentation, skill cleanup, and generated input stamps are updated accordingly.

Changes

Simulate-mouse-input dry-run migration

Layer / File(s) Summary
Dry-run runtime path
Packages/src/Editor/FirstPartyTools/SimulateMouseInput/*, Packages/src/Editor/FirstPartyTools/Common/*/AssemblyInfo.cs
Adds dry-run parameters and nullable hit metadata, routes dry-run requests through MouseInputDryRunResponseBuilder, and updates internal assembly access and logging.
Dry-run test coverage
Assets/Tests/Editor/SimulateMouseInputDryRunTests.cs
Replaces raycast execution tests with simulate-mouse-input dry-run tests covering hits, misses, camera resolution, logging, layer filtering, and transform synchronization.
Tool and skill documentation
.agents/skills/..., .claude/skills/..., Packages/src/Editor/FirstPartyTools/*/Skill/*, README.md
Documents dry-run usage, parameters, prerequisites, output fields, and coordinate handling while removing standalone raycast references.
Tool catalog and legacy cleanup
cli/common/tools/*, cli/dispatcher/**, Packages/src/Editor/Infrastructure/SkillSetup/*, cli/*/shared-inputs-stamp.json
Removes raycast from tool metadata and guidance, marks its skill directory deprecated, and updates shared-input hashes.

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

Sequence Diagram(s)

sequenceDiagram
  participant CLI
  participant SimulateMouseInputUseCase
  participant MouseInputDryRunResponseBuilder
  participant UnityPhysics
  CLI->>SimulateMouseInputUseCase: Execute with --dry-run and coordinates
  SimulateMouseInputUseCase->>MouseInputDryRunResponseBuilder: Build dry-run response
  MouseInputDryRunResponseBuilder->>UnityPhysics: Raycast using camera, layer mask, and max distance
  UnityPhysics-->>MouseInputDryRunResponseBuilder: Hit or miss metadata
  MouseInputDryRunResponseBuilder-->>CLI: SimulateMouseInputResponse
Loading
🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 25.00% 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: adding a --dry-run physics-hit check to simulate-mouse-input.
Description check ✅ Passed The description is directly related to the changeset and describes the dry-run raycast fold-in and tool removal.
Linked Issues check ✅ Passed The changes add --dry-run hit reporting, remove the standalone raycast tool/skill/catalog entry, and keep screenshot docs aligned.
Out of Scope Changes check ✅ Passed No clear unrelated code changes stand out; the edits all support the dry-run raycast migration or its documentation.
✨ Finishing Touches 💡 1
📝 Generate docstrings 💡
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feature/fold-raycast-into-simulate-mouse-input

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[bot]
coderabbitai Bot previously requested changes Jul 29, 2026

@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: 1

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

251-261: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Cover the exposed raycast parameters.

ExecuteDryRun fixes LayerMask and MaxDistance to defaults, so the suite never verifies either new option. Add cases that exclude/include the cube through LayerMask and that place it beyond MaxDistance.

🤖 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/SimulateMouseInputDryRunTests.cs` around lines 251 - 261,
Add test cases around ExecuteDryRun and its callers that set LayerMask to
exclude and include the cube, and set MaxDistance below and above the cube’s
distance. Update the helper to accept and forward these parameters while
preserving existing defaults for current tests.
🤖 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
`@Packages/src/Editor/FirstPartyTools/SimulateMouseInput/SimulateMouseInputSchema.cs`:
- Around line 21-23: Increment the IPC protocol version for the new DryRun field
in both contract.json’s protocolVersion and
CliConstants.REQUIRED_CLI_PROTOCOL_VERSION, keeping the compatibility gate as an
exact match. Update the runner pin to a published runner that supports the new
protocol generation before release.

---

Nitpick comments:
In `@Assets/Tests/Editor/SimulateMouseInputDryRunTests.cs`:
- Around line 251-261: Add test cases around ExecuteDryRun and its callers that
set LayerMask to exclude and include the cube, and set MaxDistance below and
above the cube’s distance. Update the helper to accept and forward these
parameters while preserving existing defaults for current tests.
🪄 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 Plus

Run ID: 81634b6b-554e-48a2-b38f-68a66c45c4f3

📥 Commits

Reviewing files that changed from the base of the PR and between 0713b6c and db5f29f.

⛔ Files ignored due to path filters (11)
  • Assets/Tests/Editor/RaycastToolTests.cs.meta is excluded by none and included by none
  • Assets/Tests/Editor/SimulateMouseInputDryRunTests.cs.meta is excluded by none and included by none
  • Assets/Tests/Editor/UnityCLILoop.Tests.Editor.asmdef is excluded by none and included by none
  • Packages/src/Editor/FirstPartyTools/Raycast.meta is excluded by none and included by none
  • Packages/src/Editor/FirstPartyTools/Raycast/RaycastSchema.cs.meta is excluded by none and included by none
  • Packages/src/Editor/FirstPartyTools/Raycast/Skill.meta is excluded by none and included by none
  • Packages/src/Editor/FirstPartyTools/Raycast/Skill/SKILL.md.meta is excluded by none and included by none
  • Packages/src/Editor/FirstPartyTools/Raycast/UnityCLILoop.FirstPartyTools.Raycast.Editor.asmdef is excluded by none and included by none
  • Packages/src/Editor/FirstPartyTools/Raycast/UnityCLILoop.FirstPartyTools.Raycast.Editor.asmdef.meta is excluded by none and included by none
  • Packages/src/Editor/FirstPartyTools/SimulateMouseInput/MouseInputDryRunResponseBuilder.cs.meta is excluded by none and included by none
  • Packages/src/Editor/FirstPartyTools/SimulateMouseInput/UnityCLILoop.FirstPartyTools.SimulateMouseInput.Editor.asmdef is excluded by none and included by none
📒 Files selected for processing (25)
  • .agents/skills/uloop-raycast/SKILL.md
  • .agents/skills/uloop-screenshot/SKILL.md
  • .agents/skills/uloop-simulate-mouse-input/SKILL.md
  • .claude/skills/uloop-raycast/SKILL.md
  • .claude/skills/uloop-screenshot/SKILL.md
  • .claude/skills/uloop-simulate-mouse-input/SKILL.md
  • Assets/Tests/Editor/SimulateMouseInputDryRunTests.cs
  • Packages/src/Editor/FirstPartyTools/Common/GameView/AssemblyInfo.cs
  • Packages/src/Editor/FirstPartyTools/Common/MouseUi/AssemblyInfo.cs
  • Packages/src/Editor/FirstPartyTools/Raycast/RaycastResponse.cs
  • Packages/src/Editor/FirstPartyTools/Raycast/RaycastSchema.cs
  • Packages/src/Editor/FirstPartyTools/Raycast/Skill/SKILL.md
  • Packages/src/Editor/FirstPartyTools/Screenshot/Skill/SKILL.md
  • Packages/src/Editor/FirstPartyTools/SimulateMouseInput/MouseInputDryRunResponseBuilder.cs
  • Packages/src/Editor/FirstPartyTools/SimulateMouseInput/SimulateMouseInputResponse.cs
  • Packages/src/Editor/FirstPartyTools/SimulateMouseInput/SimulateMouseInputSchema.cs
  • Packages/src/Editor/FirstPartyTools/SimulateMouseInput/SimulateMouseInputUseCase.cs
  • Packages/src/Editor/FirstPartyTools/SimulateMouseInput/Skill/SKILL.md
  • Packages/src/Editor/Infrastructure/SkillSetup/SkillTargetInstaller.cs
  • README.md
  • cli/common/tooldocs/skill_guidance.go
  • cli/common/tools/default-tools.json
  • cli/dispatcher/internal/dispatcher/skills.go
  • cli/dispatcher/shared-inputs-stamp.json
  • cli/project-runner/shared-inputs-stamp.json
💤 Files with no reviewable changes (7)
  • .claude/skills/uloop-raycast/SKILL.md
  • Packages/src/Editor/FirstPartyTools/Common/GameView/AssemblyInfo.cs
  • .agents/skills/uloop-raycast/SKILL.md
  • Packages/src/Editor/FirstPartyTools/Raycast/Skill/SKILL.md
  • Packages/src/Editor/FirstPartyTools/Raycast/RaycastResponse.cs
  • cli/common/tooldocs/skill_guidance.go
  • Packages/src/Editor/FirstPartyTools/Raycast/RaycastSchema.cs

The screenshot skill still pointed agents at the removed standalone
raycast command for SimX/SimY follow-up. Point those steps at
simulate-mouse-input --dry-run instead.

Co-authored-by: Cursor <cursoragent@cursor.com>
@hatayama
hatayama dismissed coderabbitai[bot]’s stale review July 29, 2026 13:59

Incorrect protocol-bump request; optional schema fields do not require a protocolVersion bump per docs/protocol-version.md. Advisor final review LGTM.

@hatayama
hatayama merged commit 24225f6 into v3-beta Jul 29, 2026
13 checks passed
@hatayama
hatayama deleted the feature/fold-raycast-into-simulate-mouse-input branch July 29, 2026 13:59
@github-actions github-actions Bot mentioned this pull request Jul 29, 2026
hatayama added a commit that referenced this pull request Jul 29, 2026
The standalone raycast tool was folded into simulate-mouse-input as
--dry-run (#2072, closes the plan from #2068). Describe the option in
the README feature section and add a release-notes note next to the
set-game-view-size one.
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