Skip to content

fix: Unity stall diagnostics now point to modal dialogs#1361

Merged
hatayama merged 2 commits into
v3-betafrom
feature/detect-modal
Jun 16, 2026
Merged

fix: Unity stall diagnostics now point to modal dialogs#1361
hatayama merged 2 commits into
v3-betafrom
feature/detect-modal

Conversation

@hatayama

@hatayama hatayama commented Jun 16, 2026

Copy link
Copy Markdown
Owner

Summary

  • The CLI now explains when an accepted Unity request appears blocked by a stopped Editor main thread.
  • Stall diagnostics now guide users to check Unity for a modal dialog or long editor operation.

User Impact

  • Before, a stalled accepted request could look like a generic timeout or freeze.
  • Now the CLI progress and final error tell users to focus Unity, close any blocking modal dialog, or wait for the Editor operation to finish before retrying.

Changes

  • Updated heartbeat stall progress text with modal-dialog and long-operation guidance.
  • Added a dedicated structured error for Unity Editor unresponsive diagnostics.
  • Added tests for the new error envelope and heartbeat progress message.

Verification

  • scripts/check-go-cli.sh

Review in cubic

Classify heartbeat-based editor unresponsive errors separately so CLI output points users at possible modal dialogs or long editor operations.
Update stall progress text and cover both envelope and heartbeat progress behavior with tests.
@coderabbitai

coderabbitai Bot commented Jun 16, 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: 663a9874-18e3-4d7a-bbaf-1b65507dd378

📥 Commits

Reviewing files that changed from the base of the PR and between 961b6cc and 454eace.

📒 Files selected for processing (4)
  • cli/internal/cli/error_editor_unresponsive.go
  • cli/internal/cli/error_envelope_test.go
  • cli/internal/unityipc/client.go
  • cli/internal/unityipc/client_heartbeat_test.go
✅ Files skipped from review due to trivial changes (1)
  • cli/internal/unityipc/client.go
🚧 Files skipped from review as they are similar to previous changes (3)
  • cli/internal/unityipc/client_heartbeat_test.go
  • cli/internal/cli/error_editor_unresponsive.go
  • cli/internal/cli/error_envelope_test.go

📝 Walkthrough

Walkthrough

Adds UNITY_EDITOR_UNRESPONSIVE error code and unityEditorUnresponsiveError helper to classify and construct a retryable cliError for editor unresponsiveness with stall duration and next-action guidance. The connectionAttemptCause helper is relocated to a new file. The IPC client's stall progress message is reworded from "busy" to "stuck" and includes modal-dialog hints.

Changes

Editor Unresponsive Error Handling

Layer / File(s) Summary
Error code, helpers, and classification wiring
cli/internal/cli/error_editor_unresponsive.go, cli/internal/cli/error_envelope.go
UNITY_EDITOR_UNRESPONSIVE error code is added. connectionAttemptCause is relocated to the new file and unityEditorUnresponsiveError builder is added to construct a retryable cliError with stall details and next-action guidance. classifyError is extended to detect *unityipc.EditorUnresponsiveError and dispatch to the builder.
Error classification test
cli/internal/cli/error_envelope_test.go
TestClassifyEditorUnresponsiveError validates error code, phase, retry flags, Details["stallSeconds"], and NextActions content without stale restart advice.
Stall progress messaging
cli/internal/unityipc/client.go
Progress notification for main-thread stall changes from "busy" wording to "stuck" and includes guidance hints for modal dialogs and long operations.

Sequence Diagram

sequenceDiagram
  participant unityipc
  participant classifyError
  participant unityEditorUnresponsiveError
  participant cliError
  
  unityipc->>classifyError: detects EditorUnresponsiveError
  classifyError->>unityEditorUnresponsiveError: error + context
  unityEditorUnresponsiveError->>cliError: code=UNITY_EDITOR_UNRESPONSIVE<br/>phase=ResponseWaiting<br/>stallSeconds + NextActions
  cliError-->>unityipc: Retryable=true, SafeToRetry
Loading

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

Possibly related PRs

  • hatayama/unity-cli-loop#1312: Updates the IPC client heartbeat logic to produce EditorUnresponsiveError on main-thread stalls, which is the error type this PR classifies and handles.
  • hatayama/unity-cli-loop#1353: Extends editor-unresponsive handling in the same CLI packages, wiring stall classification into connection-retry and focus behavior.
  • hatayama/unity-cli-loop#1339: Modifies classifyError to classify different Unity IPC failure types into standardized error codes and phases.
🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 30.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: Unity stall diagnostics now point to modal dialogs' accurately captures the main change—improved diagnostic guidance for Unity Editor main thread stalls.
Description check ✅ Passed The description clearly relates to the changeset, outlining the improvements to stall diagnostics, user impact, specific changes made, and verification approach.
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/detect-modal

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.

2 issues found across 5 files

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

Re-trigger cubic

Comment thread cli/internal/cli/error_editor_unresponsive.go Outdated
Comment thread cli/internal/unityipc/client.go Outdated
Remove stale restart advice from the structured editor-unresponsive error and shorten the heartbeat stall progress text so it stays suitable for spinner output.
@hatayama
hatayama merged commit dc8ff2c into v3-beta Jun 16, 2026
9 checks passed
@hatayama
hatayama deleted the feature/detect-modal branch June 16, 2026 14:50
@github-actions github-actions Bot mentioned this pull request Jun 16, 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