Skip to content

fix: Launch now confirms when Unity is ready or restarted#1301

Merged
hatayama merged 2 commits into
v3-betafrom
feature/launch-restart-status
Jun 9, 2026
Merged

fix: Launch now confirms when Unity is ready or restarted#1301
hatayama merged 2 commits into
v3-betafrom
feature/launch-restart-status

Conversation

@hatayama

@hatayama hatayama commented Jun 9, 2026

Copy link
Copy Markdown
Owner

Summary

  • uloop launch now waits until Unity can answer tool requests even when the Editor was already running.
  • uloop launch -r now reports a structured restart result with previous and current process IDs.

User Impact

  • Before this change, agents could only see a successful already-running launch as plain text, and restart success did not show whether a restart actually happened.
  • After this change, agents can read JSON fields such as AlreadyRunning, Launched, Restarted, PreviousProcessId, and CurrentProcessId to confirm Unity is ready.

Changes

  • Return structured launch, restart, and quit status payloads.
  • Regenerate launch skill docs to document the machine-readable fields.
  • Bump the CLI contract and Unity minimum CLI version for the new launch response contract.

Verification

  • scripts/check-go-cli.sh
  • cli/dist/darwin-arm64/uloop compile --project-path "$(git rev-parse --show-toplevel)"
  • cli/dist/darwin-arm64/uloop launch --project-path "$(git rev-parse --show-toplevel)"
  • cli/dist/darwin-arm64/uloop launch -r --project-path "$(git rev-parse --show-toplevel)"
  • cli/dist/darwin-arm64/uloop execute-dynamic-code --project-path "$(git rev-parse --show-toplevel)" --code "return 12 + 12.22;"
  • CLI_MINIMUM_VERSION_BASE_REF=origin/v3-beta CLI_MINIMUM_VERSION_HEAD_REF=HEAD scripts/check-cli-minimum-version-warning.sh
  • git diff --check
  • codex-review --parallel-tests "scripts/check-go-cli.sh" v3-beta

Make launch success paths machine-readable so agents can tell whether Unity was already running, newly launched, or restarted. Include process IDs in restart responses and bump the CLI contract version for the new launch output contract.
@coderabbitai

coderabbitai Bot commented Jun 9, 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: 95f20519-d62f-44a2-968f-4105b72564da

📥 Commits

Reviewing files that changed from the base of the PR and between f145f48 and 2e97564.

📒 Files selected for processing (3)
  • .agents/skills/uloop-launch/SKILL.md
  • .claude/skills/uloop-launch/SKILL.md
  • Packages/src/Editor/CliOnlyTools~/Launch/Skill/SKILL.md
✅ Files skipped from review due to trivial changes (1)
  • .claude/skills/uloop-launch/SKILL.md
🚧 Files skipped from review as they are similar to previous changes (1)
  • .agents/skills/uloop-launch/SKILL.md

📝 Walkthrough

Walkthrough

Bump CLI/tool version to 3.0.0-beta.28. Extend uloop launch to wait for tool readiness when reusing an existing Unity process, capture previous/current process IDs, and emit richer structured JSON responses for already-running, launched, restarted, and quit paths. Add tests and update SKILL docs.

Changes

Launch Command Refactoring

Layer / File(s) Summary
Version contracts
Packages/src/Editor/Domain/CliConstants.cs, cli/contract.json, cli/internal/tools/default-tools.json
CLI and tool metadata bumped from 3.0.0-beta.273.0.0-beta.28.
Launch response schema and serialization
cli/internal/cli/launch_ready.go
launchReadyResponse extended with AlreadyRunning, Launched, Restarted, Quit, PreviousProcessId, CurrentProcessId, and ProjectRoot. Replaced single response writer with writeExistingLaunchReadyResponse, writeLaunchedReadyResponse, writeLaunchQuitResponse, all delegating to writeLaunchResponse for JSON serialization and error classification.
Launch command implementation and test coverage
cli/internal/cli/launch.go, cli/internal/cli/launch_test.go
Launch flow now uses a spinner and waitForToolReadinessForLaunch when reusing an existing process, captures currentPid and optional previousPid, handles restart/quit via killUnityProcessForLaunch, and returns structured responses. Tests added to decode stdout JSON and assert flags and PIDs; existing focus tests updated to stub readiness probing.
User-facing skill documentation
.agents/skills/uloop-launch/SKILL.md, .claude/skills/uloop-launch/SKILL.md, Packages/src/Editor/CliOnlyTools~/Launch/Skill/SKILL.md
Docs updated to explain focus vs launch/restart waiting behavior and the expanded JSON success schema including process-state flags and PID fields.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 14.29% 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 accurately reflects the main change: uloop launch now waits for Unity readiness and reports structured restart status with process IDs.
Description check ✅ Passed The description is directly related to the changeset, clearly explaining the summary, user impact, changes made, and verification steps.
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 unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feature/launch-restart-status

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.

@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

🤖 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/CliOnlyTools`~/Launch/Skill/SKILL.md:
- Around line 55-66: The launch JSON schema in SKILL.md is missing the Quit
field emitted by writeLaunchQuitResponse; update the enumerated output fields to
include `Quit`: a boolean indicating whether the command quit the running Unity
process (true when a process was stopped via quit, false otherwise), and place
it alongside the other top-level flags (e.g., near `Launched`/`Restarted`) so
consumers can detect quit outcomes without parsing `Message`; ensure the field
name exactly matches `Quit` and the description matches the boolean semantics
used by writeLaunchQuitResponse.
🪄 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

Run ID: a03b8474-7340-4996-a99e-196ff3800079

📥 Commits

Reviewing files that changed from the base of the PR and between a36e661 and f145f48.

📒 Files selected for processing (9)
  • .agents/skills/uloop-launch/SKILL.md
  • .claude/skills/uloop-launch/SKILL.md
  • Packages/src/Editor/CliOnlyTools~/Launch/Skill/SKILL.md
  • Packages/src/Editor/Domain/CliConstants.cs
  • cli/contract.json
  • cli/internal/cli/launch.go
  • cli/internal/cli/launch_ready.go
  • cli/internal/cli/launch_test.go
  • cli/internal/tools/default-tools.json

Comment thread Packages/src/Editor/CliOnlyTools~/Launch/Skill/SKILL.md

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

3 issues found across 9 files

Reply with feedback, questions, or to request a fix.

Re-trigger cubic

Comment thread .claude/skills/uloop-launch/SKILL.md
Comment thread .agents/skills/uloop-launch/SKILL.md
Comment thread Packages/src/Editor/CliOnlyTools~/Launch/Skill/SKILL.md
List the Quit flag in the launch skill output contract so agents can detect quit outcomes from the structured response instead of parsing the message text.
@hatayama
hatayama merged commit 3b72fff into v3-beta Jun 9, 2026
8 checks passed
@hatayama
hatayama deleted the feature/launch-restart-status branch June 9, 2026 09:48
@github-actions github-actions Bot mentioned this pull request Jun 9, 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