feat: check 3D physics hits with simulate-mouse-input --dry-run - #2072
Conversation
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>
|
Warning Review limit reached
Next review available in: 33 minutes Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?After more reviews become available, a review can be triggered using the 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 configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (3)
📝 WalkthroughWalkthroughThe standalone ChangesSimulate-mouse-input dry-run migration
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
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches 💡 1📝 Generate docstrings 💡
🧪 Generate unit tests (beta)
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. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🧹 Nitpick comments (1)
Assets/Tests/Editor/SimulateMouseInputDryRunTests.cs (1)
251-261: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winCover the exposed raycast parameters.
ExecuteDryRunfixesLayerMaskandMaxDistanceto defaults, so the suite never verifies either new option. Add cases that exclude/include the cube throughLayerMaskand that place it beyondMaxDistance.🤖 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
⛔ Files ignored due to path filters (11)
Assets/Tests/Editor/RaycastToolTests.cs.metais excluded by none and included by noneAssets/Tests/Editor/SimulateMouseInputDryRunTests.cs.metais excluded by none and included by noneAssets/Tests/Editor/UnityCLILoop.Tests.Editor.asmdefis excluded by none and included by nonePackages/src/Editor/FirstPartyTools/Raycast.metais excluded by none and included by nonePackages/src/Editor/FirstPartyTools/Raycast/RaycastSchema.cs.metais excluded by none and included by nonePackages/src/Editor/FirstPartyTools/Raycast/Skill.metais excluded by none and included by nonePackages/src/Editor/FirstPartyTools/Raycast/Skill/SKILL.md.metais excluded by none and included by nonePackages/src/Editor/FirstPartyTools/Raycast/UnityCLILoop.FirstPartyTools.Raycast.Editor.asmdefis excluded by none and included by nonePackages/src/Editor/FirstPartyTools/Raycast/UnityCLILoop.FirstPartyTools.Raycast.Editor.asmdef.metais excluded by none and included by nonePackages/src/Editor/FirstPartyTools/SimulateMouseInput/MouseInputDryRunResponseBuilder.cs.metais excluded by none and included by nonePackages/src/Editor/FirstPartyTools/SimulateMouseInput/UnityCLILoop.FirstPartyTools.SimulateMouseInput.Editor.asmdefis 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.mdAssets/Tests/Editor/SimulateMouseInputDryRunTests.csPackages/src/Editor/FirstPartyTools/Common/GameView/AssemblyInfo.csPackages/src/Editor/FirstPartyTools/Common/MouseUi/AssemblyInfo.csPackages/src/Editor/FirstPartyTools/Raycast/RaycastResponse.csPackages/src/Editor/FirstPartyTools/Raycast/RaycastSchema.csPackages/src/Editor/FirstPartyTools/Raycast/Skill/SKILL.mdPackages/src/Editor/FirstPartyTools/Screenshot/Skill/SKILL.mdPackages/src/Editor/FirstPartyTools/SimulateMouseInput/MouseInputDryRunResponseBuilder.csPackages/src/Editor/FirstPartyTools/SimulateMouseInput/SimulateMouseInputResponse.csPackages/src/Editor/FirstPartyTools/SimulateMouseInput/SimulateMouseInputSchema.csPackages/src/Editor/FirstPartyTools/SimulateMouseInput/SimulateMouseInputUseCase.csPackages/src/Editor/FirstPartyTools/SimulateMouseInput/Skill/SKILL.mdPackages/src/Editor/Infrastructure/SkillSetup/SkillTargetInstaller.csREADME.mdcli/common/tooldocs/skill_guidance.gocli/common/tools/default-tools.jsoncli/dispatcher/internal/dispatcher/skills.gocli/dispatcher/shared-inputs-stamp.jsoncli/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>
Incorrect protocol-bump request; optional schema fields do not require a protocolVersion bump per docs/protocol-version.md. Advisor final review LGTM.
Summary
uloop simulate-mouse-input --dry-run(works in EditMode; no Input System required).raycasttool anduloop-raycastskill are removed; existing installs pruneuloop-raycaston the nextuloop skills install.Closes #2068
User Impact
uloop raycastcommand was needed only to preview 3D physics hits before clicking.simulate-mouse-input --dry-run(optional--layer-mask/--max-distance). Agents should stop callingraycast.Changes
DryRun,LayerMask, andMaxDistanceto simulate-mouse-input, with hit fields on the response.GameViewRaycastUtilityfor screenshot raycast-grid annotation.uloop-raycastin both deprecated-skill lists.Verification
uloop compile: 0 errors / 0 warningsuloop run-tests --filter-type regex --filter-value SimulateMouseInputDryRunTests: TestCount 7, PassedCount 7uloop run-tests --filter-type regex --filter-value "SimulateMouseInputDryRunTests|DefaultToolsCatalogDriftTests": 8/8 (7 dry-run + 1 catalog drift)scripts/check-go-cli.sh: passgo run ./cmd/sync-tool-docs --check: no driftuloop list:raycastabsent;simulate-mouse-inputpresentuloop simulate-mouse-input --dry-run --x 400 --y 300returns 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 cleanorigin/v3-betawithout 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.