Skip to content

fix: Setup updates outdated CLI before offering PATH repair#1258

Merged
hatayama merged 2 commits into
v3-betafrom
feature/hatayama/fix-path
Jun 1, 2026
Merged

fix: Setup updates outdated CLI before offering PATH repair#1258
hatayama merged 2 commits into
v3-betafrom
feature/hatayama/fix-path

Conversation

@hatayama

@hatayama hatayama commented Jun 1, 2026

Copy link
Copy Markdown
Owner

Summary

  • Setup and Settings now update an outdated terminal-visible CLI before offering PATH repair.
  • The control-play-mode skill docs now describe the timeout option and the wait behavior.

User Impact

  • Before this change, users could see Fix PATH while their terminal still resolved an older CLI version. Pressing that button did not satisfy the package requirement.
  • After this change, the primary action updates the CLI first when the visible command is too old. Fix PATH remains available for the case where a usable package-owned CLI is installed but not visible from a fresh shell.

Changes

  • Reordered Setup Wizard and Settings button label/action selection so CLI update wins over PATH repair when both are needed.
  • Added regression coverage for the outdated CLI plus PATH repair overlap.
  • Updated generated control-play-mode skill docs for timeout guidance.

Verification

  • cli/dist/darwin-arm64/uloop compile --project-path <PROJECT_ROOT> succeeded with 0 errors and 0 warnings.
  • cli/dist/darwin-arm64/uloop run-tests --project-path <PROJECT_ROOT> --test-mode EditMode --filter-type regex --filter-value .(CliSetupSectionTests|SetupWizardWindowTests|UnityCliLoopSettingsWindowCliActionTests). passed 151 tests.

hatayama added 2 commits June 1, 2026 21:08
When the terminal resolves an outdated uloop command, routing the primary setup action to PATH repair leaves the old CLI in place. Update the settings and setup wizard action selection so stale PATH repair only wins after the visible CLI already satisfies the required version.
@coderabbitai

coderabbitai Bot commented Jun 1, 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: Pro

Run ID: 7b28f95b-a74b-4e43-9698-1ce36237ef01

📥 Commits

Reviewing files that changed from the base of the PR and between c96ca3e and 59ddaf0.

📒 Files selected for processing (8)
  • .agents/skills/uloop-control-play-mode/SKILL.md
  • .claude/skills/uloop-control-play-mode/SKILL.md
  • Assets/Tests/Editor/CliSetupSectionTests.cs
  • Assets/Tests/Editor/SetupWizardWindowTests.cs
  • Assets/Tests/Editor/UnityCliLoopSettingsWindowCliActionTests.cs
  • Packages/src/Editor/Presentation/Setup/SetupWizardWindow.cs
  • Packages/src/Editor/Presentation/UIToolkit/Components/CliSetupSection.cs
  • Packages/src/Editor/Presentation/UnityCliLoopSettingsWindow.cs

📝 Walkthrough

Walkthrough

This PR introduces a --timeout-seconds parameter for the play-mode control skill and refactors CLI setup decision logic to prioritize CLI updates over PATH repair when both are needed. The method ShouldRepairCliPathFromPrimaryButton now accepts an additional needsUpdate parameter and returns true only when PATH repair is needed and an update is not.

Changes

Play Mode Control Skill Documentation

Layer / File(s) Summary
Agent and Claude skill documentation
.agents/skills/uloop-control-play-mode/SKILL.md, .claude/skills/uloop-control-play-mode/SKILL.md
Both skill files document a new --timeout-seconds parameter (default 180) for controlling the maximum wait time to reach the requested play mode state. Examples are extended to show --timeout-seconds 600 usage, and notes are updated to direct users to increase the timeout for slow PlayMode entry, replacing prior guidance about retrying.

CLI Setup and PATH Repair Priority Logic

Layer / File(s) Summary
Method signature update
Packages/src/Editor/Presentation/Setup/SetupWizardWindow.cs, Packages/src/Editor/Presentation/UnityCliLoopSettingsWindow.cs
ShouldRepairCliPathFromPrimaryButton is updated in both classes to accept needsUpdate as a second parameter. Logic now returns true only when needsCliPathSetup && !needsUpdate, making CLI updates take priority over PATH repair.
SetupWizardWindow handler updates
Packages/src/Editor/Presentation/Setup/SetupWizardWindow.cs
GetCliButtonTextForSetupWizard reorders decision branches so "Fixing PATH..." displays only when installing and not updating. HandleInstallCli computes needsUpdate and invokes the updated two-parameter ShouldRepairCliPathFromPrimaryButton.
UnityCliLoopSettingsWindow handler update
Packages/src/Editor/Presentation/UnityCliLoopSettingsWindow.cs
ResolveCliPrimaryButtonAction computes needsUpdate earlier and calls the updated ShouldRepairCliPathFromPrimaryButton(needsCliPathSetup, needsUpdate) to determine primary button action routing.
Button text label generation
Packages/src/Editor/Presentation/UIToolkit/Components/CliSetupSection.cs
GetInstallCliButtonText refactors branching to show "Fixing PATH..." only when installing and neither updating nor downgrading; non-installing PATH issues yield "Fix PATH" before the "Install CLI" label, respecting the new update-over-repair priority.
Test coverage
Assets/Tests/Editor/CliSetupSectionTests.cs, Assets/Tests/Editor/SetupWizardWindowTests.cs, Assets/Tests/Editor/UnityCliLoopSettingsWindowCliActionTests.cs
Tests update to exercise the new two-parameter ShouldRepairCliPathFromPrimaryButton signature. New test cases cover combined update+PATH-setup scenarios, validating that repair routing respects the priority of updates over PATH repair.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

  • hatayama/unity-cli-loop#1219: Documents the --timeout-seconds play-mode waiting parameter in the uloop-control-play-mode SKILL.md that this PR's native CLI implementation provides.
  • hatayama/unity-cli-loop#1034: Also modifies SetupWizardWindow.HandleInstallCli, changing the NativeCliInstaller.InstallAsync call signature within the same handler alongside this PR's PATH-repair decision flow changes.
🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.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 'fix: Setup updates outdated CLI before offering PATH repair' directly describes the main change: reordering setup logic so CLI updates take priority over PATH repair when both are needed.
Description check ✅ Passed The description clearly relates to the changeset, detailing the user impact, changes made, and verification steps for the CLI update prioritization and skill documentation updates.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ 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/hatayama/fix-path

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 and usage tips.

@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.

No issues found across 8 files

Re-trigger cubic

@hatayama
hatayama merged commit 2254286 into v3-beta Jun 1, 2026
8 checks passed
@hatayama
hatayama deleted the feature/hatayama/fix-path branch June 1, 2026 12:27
@github-actions github-actions Bot mentioned this pull request Jun 1, 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