Skip to content

fix: Launch V2 Unity projects without hanging#1826

Merged
hatayama merged 5 commits into
v3-betafrom
fix/v2-launch-readiness
Jul 18, 2026
Merged

fix: Launch V2 Unity projects without hanging#1826
hatayama merged 5 commits into
v3-betafrom
fix/v2-launch-readiness

Conversation

@hatayama

@hatayama hatayama commented Jul 17, 2026

Copy link
Copy Markdown
Owner

Summary

  • V2 projects can now be launched by the native dispatcher instead of waiting for the V3 IPC server.
  • Launch reports that Unity opened the project while clearly stating that V2 server readiness was not checked.

User Impact

  • uloop launch no longer waits up to ten minutes for a V3 named pipe that V2 projects never create.
  • Existing -q and -r process management continues to work for V2 projects.

Changes

  • Keep only launch out of V2 CLI delegation; live V2 commands remain delegated.
  • Require a UnityLockfile created or updated after the new process begins, and return a structured timeout if it never appears.

Verification

  • go test ./... -count=1 from cli/dispatcher
  • Repo-local Windows CLI: V2 launch, -q, -r, and forced-stop stale-lockfile relaunch
  • scripts/check-go-cli.sh was attempted but Git Bash misreported Windows-path cli/common as containing no Go files; CI will run the authoritative check.

Review in cubic

Keep V2 launch in the dispatcher so it can confirm a fresh UnityLockfile without depending on the V3 named-pipe server. Other V2 commands remain delegated to the V2 CLI.
@coderabbitai

coderabbitai Bot commented Jul 17, 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: 40 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

Run ID: e578e7d9-cccc-45d6-84e1-64d3dce5cbce

📥 Commits

Reviewing files that changed from the base of the PR and between 45b9ae9 and 00eb247.

📒 Files selected for processing (2)
  • cli/dispatcher/internal/dispatcher/launch.go
  • cli/dispatcher/internal/dispatcher/launch_unity.go
📝 Walkthrough

Walkthrough

V2 launch commands remain in the native dispatcher. New V2 launch flows wait for a fresh Unity lockfile, skip V3 server readiness probes, and emit V2-specific launch responses with structured timeout handling.

Changes

V2 Native Launch Handling

Layer / File(s) Summary
Fresh lockfile readiness
cli/dispatcher/internal/dispatcher/launch_v2_lockfile.go, cli/dispatcher/internal/dispatcher/launch_v2_lockfile_test.go
Adds polling for post-launch Unity lockfiles, cancellation and timeout handling, and tests for fresh versus stale lockfiles.
V2 launch responses and dependencies
cli/dispatcher/internal/dispatcher/launch_deps.go, cli/dispatcher/internal/dispatcher/launch_ready.go
Adds injectable launch timing and lockfile dependencies plus response writers for existing and newly launched V2 projects.
Native V2 launch routing
cli/dispatcher/internal/dispatcher/dispatcher_v2_run.go, cli/dispatcher/internal/dispatcher/launch.go, cli/dispatcher/internal/dispatcher/*_test.go
Prevents V2 launch delegation, routes V2 launches through native handling, waits on fresh lockfiles, skips server probes, and validates the resulting responses.

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

Sequence Diagram(s)

sequenceDiagram
  participant User
  participant Dispatcher
  participant Unity
  participant Lockfile
  User->>Dispatcher: Run V2 launch command
  Dispatcher->>Unity: Start or find Unity process
  Unity->>Lockfile: Update project lockfile
  Dispatcher->>Lockfile: Poll for post-launch modification
  Lockfile-->>Dispatcher: Confirm fresh lockfile
  Dispatcher-->>User: Write V2 project-open response
Loading

Possibly related PRs

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly summarizes the main change: fixing V2 Unity project launch hangs.
Description check ✅ Passed The description accurately covers the V2 launch flow, lockfile readiness, and process-management behavior.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
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.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/v2-launch-readiness

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.

Keep the dispatcher launch entrypoint within the focused-file size limit and remove the unused timeout state found by CI.

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

🧹 Nitpick comments (1)
cli/dispatcher/internal/dispatcher/launch_v2_lockfile.go (1)

12-15: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value

Remove unused projectRoot field.

The projectRoot field is never populated or used. The ToCLIError method accurately relies on context.ProjectRoot instead, making this struct field redundant.

♻️ Proposed refactor
 type v2LaunchLockfileTimeoutError struct {
-	projectRoot  string
 	lockfilePath string
 }
🤖 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 `@cli/dispatcher/internal/dispatcher/launch_v2_lockfile.go` around lines 12 -
15, Remove the unused projectRoot field from v2LaunchLockfileTimeoutError,
keeping lockfilePath and the existing ToCLIError behavior unchanged.
🤖 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.

Nitpick comments:
In `@cli/dispatcher/internal/dispatcher/launch_v2_lockfile.go`:
- Around line 12-15: Remove the unused projectRoot field from
v2LaunchLockfileTimeoutError, keeping lockfilePath and the existing ToCLIError
behavior unchanged.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 8ec6d996-7c5f-4570-a5a0-49580beb142d

📥 Commits

Reviewing files that changed from the base of the PR and between 1cc123b and 77b257c.

📒 Files selected for processing (8)
  • cli/dispatcher/internal/dispatcher/dispatcher_v2_detect_test.go
  • cli/dispatcher/internal/dispatcher/dispatcher_v2_run.go
  • cli/dispatcher/internal/dispatcher/launch.go
  • cli/dispatcher/internal/dispatcher/launch_deps.go
  • cli/dispatcher/internal/dispatcher/launch_ready.go
  • cli/dispatcher/internal/dispatcher/launch_test.go
  • cli/dispatcher/internal/dispatcher/launch_v2_lockfile.go
  • cli/dispatcher/internal/dispatcher/launch_v2_lockfile_test.go

hatayama added 3 commits July 18, 2026 08:40
Remove non-semantic whitespace so the source remains at the repository physical-line limit enforced by CI.
Keep launch orchestration focused and satisfy the repository source-file size guard without relying on non-formatted whitespace.
Preserve the function separator required by the CI Go formatter after extracting Unity executable resolution.
@hatayama
hatayama merged commit 4ace5b4 into v3-beta Jul 18, 2026
10 checks passed
@hatayama
hatayama deleted the fix/v2-launch-readiness branch July 18, 2026 00:04
@github-actions github-actions Bot mentioned this pull request Jul 18, 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