fix: allow installation without the new Input System package#938
Conversation
📝 WalkthroughWalkthroughThis PR makes Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes 🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 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.
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
README.md (1)
503-513:⚠️ Potential issue | 🟡 MinorAdd the Active Input Handling requirement here too.
record-input/replay-inputnow only mention package installation, but the tool-side guidance also requiresActive Input Handlingto beInput System Package (New)orBoth. Without that note, users can end up with “installed but still not working” setups.Suggested doc tweak
-Record keyboard and mouse input during PlayMode frame-by-frame into a JSON file. Captures key presses, mouse movement, clicks, and scroll events via Input System device state diffing. This tool is available only when the Input System package is installed. +Record keyboard and mouse input during PlayMode frame-by-frame into a JSON file. Captures key presses, mouse movement, clicks, and scroll events via Input System device state diffing. This tool is available only when the Input System package is installed, and Active Input Handling must be set to `Input System Package (New)` or `Both` in Player Settings. -Replay recorded keyboard and mouse input during PlayMode. Loads a JSON recording and injects input frame-by-frame via Input System. Supports looping and progress monitoring. This tool is available only when the Input System package is installed. +Replay recorded keyboard and mouse input during PlayMode. Loads a JSON recording and injects input frame-by-frame via Input System. Supports looping and progress monitoring. This tool is available only when the Input System package is installed, and Active Input Handling must be set to `Input System Package (New)` or `Both` in Player Settings.🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@README.md` around lines 503 - 513, Update the documentation for the "record-input" and "replay-input" sections to also require Unity's Active Input Handling to be set to "Input System Package (New)" or "Both"; specifically, amend the paragraphs that currently only mention the Input System package installation (the lines describing record-input and replay-input) to add a short note stating that even with the package installed the tools will not work unless Active Input Handling is configured to "Input System Package (New)" or "Both" in Player Settings, and include the exact terms "record-input", "replay-input", and "Active Input Handling" so users can find the setting.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Outside diff comments:
In `@README.md`:
- Around line 503-513: Update the documentation for the "record-input" and
"replay-input" sections to also require Unity's Active Input Handling to be set
to "Input System Package (New)" or "Both"; specifically, amend the paragraphs
that currently only mention the Input System package installation (the lines
describing record-input and replay-input) to add a short note stating that even
with the package installed the tools will not work unless Active Input Handling
is configured to "Input System Package (New)" or "Both" in Player Settings, and
include the exact terms "record-input", "replay-input", and "Active Input
Handling" so users can find the setting.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: 24c483e9-4b7e-4277-b02d-4228fb10e916
⛔ Files ignored due to path filters (1)
Assets/Tests/PlayMode/uLoopMCP.Tests.PlayMode.asmdefis excluded by none and included by none
📒 Files selected for processing (12)
Packages/packages-lock.jsonPackages/src/Editor/Api/McpTools/RecordInput/InputRecorder.csPackages/src/Editor/Api/McpTools/RecordInput/InputRecordingFileHelper.csPackages/src/Editor/Api/McpTools/RecordInput/RecordInputTool.csPackages/src/Editor/Api/McpTools/ReplayInput/InputReplayer.csPackages/src/Editor/Api/McpTools/ReplayInput/ReplayInputTool.csPackages/src/Editor/UI/Recordings/RecordingsEditorWindow.csPackages/src/README.mdPackages/src/TOOL_REFERENCE_ja.mdPackages/src/package.jsonREADME.mdREADME_ja.md
💤 Files with no reviewable changes (2)
- Packages/src/package.json
- Packages/packages-lock.json
There was a problem hiding this comment.
1 issue found across 13 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="README_ja.md">
<violation number="1" location="README_ja.md:76">
P1: `com.unity.inputsystem` を optional dependency と案内する記述は、Input System を必須依存として扱うプロジェクト方針と矛盾しています。必須依存として案内してください。
(Based on your team's feedback about requiring com.unity.inputsystem as a hard dependency.) [FEEDBACK_USED]</violation>
</file>
Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review.
| 3. Package Managerウィンドウを開き、My RegistriesセクションのOpenUPMを選択。Unity CLI Loopが表示されます。 | ||
|
|
||
| > [!NOTE] | ||
| > `com.unity.inputsystem` は optional dependency になりました。`simulate-keyboard`、`simulate-mouse-input`、`record-input`、`replay-input`、Recordings ウィンドウを使いたい場合だけ追加してください。 |
There was a problem hiding this comment.
P1: com.unity.inputsystem を optional dependency と案内する記述は、Input System を必須依存として扱うプロジェクト方針と矛盾しています。必須依存として案内してください。
(Based on your team's feedback about requiring com.unity.inputsystem as a hard dependency.)
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At README_ja.md, line 76:
<comment>`com.unity.inputsystem` を optional dependency と案内する記述は、Input System を必須依存として扱うプロジェクト方針と矛盾しています。必須依存として案内してください。
(Based on your team's feedback about requiring com.unity.inputsystem as a hard dependency.) </comment>
<file context>
@@ -72,6 +72,9 @@ Scope(s): io.github.hatayama.uloopmcp
3. Package Managerウィンドウを開き、My RegistriesセクションのOpenUPMを選択。Unity CLI Loopが表示されます。
+> [!NOTE]
+> `com.unity.inputsystem` は optional dependency になりました。`simulate-keyboard`、`simulate-mouse-input`、`record-input`、`replay-input`、Recordings ウィンドウを使いたい場合だけ追加してください。
+
# クイックスタート
</file context>
| > `com.unity.inputsystem` は optional dependency になりました。`simulate-keyboard`、`simulate-mouse-input`、`record-input`、`replay-input`、Recordings ウィンドウを使いたい場合だけ追加してください。 | |
| > `com.unity.inputsystem` は必須依存です。`simulate-keyboard`、`simulate-mouse-input`、`record-input`、`replay-input`、Recordings ウィンドウなどの機能を利用するため、プロジェクトに追加した状態を維持してください。 |
There was a problem hiding this comment.
Thanks for the review.
I did not apply this suggestion.
This PR intentionally makes com.unity.inputsystem optional at the package level by removing it from Packages/src/package.json (HEAD 63dd43c).
The README note is describing package installation, not the prerequisites for every Input System-based tool.
The tool-specific requirements still remain in the runtime error messages and skill docs for simulate-keyboard, simulate-mouse-input, record-input, and replay-input, so projects that want those features still need the Input System package installed.
There was a problem hiding this comment.
Thanks for the feedback! I've updated an existing learning with this new information.
Summary
com.unity.inputsystemoptional for package consumersChanges
com.unity.inputsystemdependency from the package manifest and lockfileULOOPMCP_HAS_INPUT_SYSTEMsimulate-keyboard,simulate-mouse-input,record-input, andreplay-inputregistered with clear error messages when Input System is not installedVerification
uloop compile --force-recompile true --wait-for-domain-reload trueuloop get-logs --log-type Error --max-count 20uloop get-logs --log-type Warning --max-count 20uloop simulate-keyboard --action Press --key Wuloop simulate-mouse-input --action Click --x 10 --y 10uloop record-input --action Startuloop replay-input --action Statuscodex-review-loopfinished with no actionable findingsOverview
This pull request makes the
com.unity.inputsystempackage an optional dependency for the uLoopMCP package. The Input System–dependent tools remain registered and discoverable, but emit clear error messages when the Input System package is not installed. All Input System–specific code is conditionally compiled behind theULOOPMCP_HAS_INPUT_SYSTEMpreprocessor symbol.Key Changes
Dependency Management
com.unity.inputsystem(version 1.14.2) from bothpackage.jsonandpackages-lock.jsoncom.unity.uguiandcom.unity.nuget.newtonsoft-jsonConditional Compilation Architecture
The following Input System–dependent classes are now wrapped in
#if ULOOPMCP_HAS_INPUT_SYSTEM...#endifblocks:Tool Implementation Changes
RecordInputTool.cs
ExecuteAsync()now provides dual behavior:ULOOPMCP_HAS_INPUT_SYSTEMis defined: Original logic executes (correlation ID generation, logging, action dispatch, response computation)RecordInputResponsewithSuccess = falseand an installation/configuration messageExecuteStartAsync()helper wrapped in preprocessor guardReplayInputTool.cs
ExecuteAsync()ExecuteStart()helper conditionally compiledReplayInputResponsewith configuration guidance when Input System is unavailableInputRecorder.cs, InputRecordingFileHelper.cs, InputReplayer.cs
ULOOPMCP_HAS_INPUT_SYSTEMis not definedRecordingsEditorWindow.cs
Documentation Updates
English Documentation (README.md and Packages/src/README.md)
com.unity.inputsystemis optionalsimulate-keyboard,simulate-mouse-input,record-input, andreplay-inputdocumentationJapanese Documentation (README_ja.md and TOOL_REFERENCE_ja.md)
com.unity.inputsystemis optionalImpact Analysis
When Input System is Present (
ULOOPMCP_HAS_INPUT_SYSTEMdefined)When Input System is Absent (
ULOOPMCP_HAS_INPUT_SYSTEMundefined)simulate-keyboard,simulate-mouse-input,record-input,replay-input) emit actionable error messages with installation guidanceBuild Configuration
The preprocessor symbol
ULOOPMCP_HAS_INPUT_SYSTEMis automatically defined whencom.unity.inputsystempackage is present in the project, enabling automatic conditional compilation based on package availability.Testing Verification
Per the PR description, the following verification was performed:
Summary by cubic
Make the Unity Input System optional so uLoop works without
com.unity.inputsystem. Input tools stay visible and show clear guidance if the package is missing; the Recordings window and Input System classes only compile when the package is present.New Features
com.unity.inputsystemfrompackage.jsonand the lockfile.ULOOPMCP_HAS_INPUT_SYSTEM(InputRecorder,InputRecordingFileHelper,InputReplayer,RecordingsEditorWindow; guarded imports inrecord-input/replay-inputwith helpful fallback messages).Packages/src/README_ja.md) and JP tool references.Migration
com.unity.inputsystemand set Active Input Handling to “Input System Package (New)” or “Both”.Written for commit 0c32f44. Summary will update on new commits.