Skip to content

feat: Add busy-stall focus rescue and richer server_busy / compile guidance#1721

Merged
hatayama merged 3 commits into
feat/cli-ux-guidancefrom
feat/cli-ux-busy-scene-guidance
Jul 12, 2026
Merged

feat: Add busy-stall focus rescue and richer server_busy / compile guidance#1721
hatayama merged 3 commits into
feat/cli-ux-guidancefrom
feat/cli-ux-busy-scene-guidance

Conversation

@hatayama

@hatayama hatayama commented Jul 12, 2026

Copy link
Copy Markdown
Owner

Summary

  • B-7a: When server_busy retries persist for 5s within the 10s busy retry window, focus Unity once via connectionRetryFocusController (busy_stall) and restore focus on exit.
  • B-7b: Enrich UNITY_SERVER_BUSY CLI errors with EditorActivity (compile/import/play state when true) and contextual NextActions.
  • B-8: When compile fails on externally changed Scene files (resolve/reload/save failure messages), add NextActions with an execute-dynamic-code EditorSceneManager.OpenScene example and unsaved-change guidance.

Pre-implementation verification (new protocol)

B-7a — busy path focus rescue repro (TDD Red → Green)

  • Root cause (pre-fix): busy retry loop never called focusController.tryFocus; terminal focus path also skips server_busy.
  • TDD repro: TestSendWithTransientConnectionRetryFocusesOnceAfterPersistentBusy was Red on pre-fix code (focusCallCount stayed 0).
  • Production tuning: finishBusyRetry bounds busy retries to serverConnectionRetryDefaultTimeout (10s), so the stall threshold must stay below that window. Default is 5s (focus at 5s, ~5s retry remaining). TestDefaultBusyFocusStallThresholdFitsWithinBusyRetryWindow guards this ratio.

B-7b — discriminable Unity states on server_busy

Field Source Included?
isCompiling EditorApplication.isCompiling via EditorRuntimeStateService Yes
isUpdating EditorApplication.isUpdating Yes
isPlaying / isPaused existing play state Yes
secondsSinceLastMainThreadTick EditorMainThreadLivenessTracker Yes (existing)
isDomainReloadInProgress only on compile-status bridge, not server_busy path Not added

B-8 — external Scene error wording (source-backed)

ExternalSceneChangeResolver.cs messages containing "externally changed Scene files":

  • CreateUnresolvedMessage (line 124)
  • CreateReloadFailureMessage (line 132)
  • CreateDirtySaveBeforeReloadFailureMessage (line 140)

These occur after auto save/reload attempts fail (default path without --stop-on-external-scene-changes). CreateStoppedMessage (line 116) uses different wording and does not match the NextActions gate.

NextActions[1] advises on unsaved in-editor conflicts (not a misleading --stop-on-external-scene-changes rerun hint).

Fable review fixes (bc20a6d)

  1. B-7a threshold: defaultBusyFocusStallThreshold 30s → 5s; constant regression test added.
  2. B-8 NextActions[1]: removed incorrect auto-reload flag advice; added unsaved-change decision guidance; OpenScene example notes Single discards unsaved editor changes.
  3. Editor readiness policy: pass editorState.IsCompiling / IsUpdating through without mutual-exclusion literals.

Verification

  • scripts/check-go-cli.sh pass (includes TestDefaultBusyFocusStallThresholdFitsWithinBusyRetryWindow + busy-stall focus test)
  • dist/darwin-arm64/uloop compile — 0 errors / 0 warnings
  • CompileResponseFactoryTests + ToolExecutionEditorReadyPolicyTests — 13 passed

Release triggers

  • cli/common touched with project-runner + dispatcher companions; scripts/stamp-release-inputs.sh run in prior commit.
  • No IPC protocol version bump.

Add busy-stall Unity focus rescue during persistent server_busy retries,
enrich server_busy error envelopes with editor activity and contextual
NextActions, and surface execute-dynamic-code reload guidance when compile
stops on externally changed Scene files.

Co-authored-by: Cursor <cursoragent@cursor.com>
@coderabbitai

coderabbitai Bot commented Jul 12, 2026

Copy link
Copy Markdown
Contributor

Warning

Review limit reached

@hatayama, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 14 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: a0c253d1-f2a3-405e-b4aa-130ddf0c02b3

📥 Commits

Reviewing files that changed from the base of the PR and between 76d4565 and bc20a6d.

📒 Files selected for processing (19)
  • Assets/Tests/Editor/CompileResponseFactoryTests.cs
  • Assets/Tests/Editor/ToolExecutionEditorReadyPolicyTests.cs
  • Packages/src/Editor/Application/UnityCliLoopEditorStateGuard.cs
  • Packages/src/Editor/Application/UnityCliLoopToolBusyException.cs
  • Packages/src/Editor/Application/UnityCliLoopToolExecutionService.cs
  • Packages/src/Editor/Domain/ToolExecutionEditorReadyPolicy.cs
  • Packages/src/Editor/FirstPartyTools/Compile/CompileResponse.cs
  • Packages/src/Editor/FirstPartyTools/Compile/CompileResponseFactory.cs
  • Packages/src/Editor/Infrastructure/Api/JsonRpcResponseFactory.cs
  • Packages/src/Editor/Infrastructure/Api/ServerBusyErrorData.cs
  • cli/common/errors/busy_editor_state.go
  • cli/common/errors/busy_editor_state_test.go
  • cli/common/errors/error_envelope.go
  • cli/common/errors/error_envelope_test.go
  • cli/dispatcher/internal/dispatcher/error_envelope_test.go
  • cli/dispatcher/shared-inputs-stamp.json
  • cli/project-runner/internal/projectrunner/connection_retry.go
  • cli/project-runner/internal/projectrunner/connection_retry_test.go
  • cli/project-runner/shared-inputs-stamp.json
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/cli-ux-busy-scene-guidance

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.

hatayama and others added 2 commits July 12, 2026 15:38
Record the busy-stall focus test as the pre-fix Red repro and add compile
response tests for additional ExternalSceneChangeResolver message shapes.

Co-authored-by: Cursor <cursoragent@cursor.com>
…uidance

Lower the default busy-stall focus threshold to 5s so it fires within the
10s server_busy retry window, replace misleading external-scene NextActions,
and pass live compile/import flags through the editor readiness policy.

Co-authored-by: Cursor <cursoragent@cursor.com>
@hatayama hatayama merged commit ba0c3b5 into feat/cli-ux-guidance Jul 12, 2026
2 checks passed
@hatayama hatayama deleted the feat/cli-ux-busy-scene-guidance branch July 12, 2026 06:43
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