Skip to content

Fix wait command returning before editor is ready#20

Merged
Niaobu merged 1 commit intomainfrom
fix/wait-editor-readiness
Feb 19, 2026
Merged

Fix wait command returning before editor is ready#20
Niaobu merged 1 commit intomainfrom
fix/wait-editor-readiness

Conversation

@Niaobu
Copy link
Contributor

@Niaobu Niaobu commented Feb 19, 2026

Summary

Fixes #18unityctl wait returned as soon as the WebSocket connected, but the editor could still be blocked on asset imports or safe mode dialogs.

  • Bridge now sends editor.ping RPCs after the hello handshake until Unity's main thread responds, proving the editor is truly ready
  • Health endpoint includes new editorReady field
  • wait command checks editorReady instead of just unityConnected
  • Three distinct timeout error messages: no bridge / not connected / connected but not ready
  • Intermediate progress: "Unity connected, waiting for editor to be ready..."
  • Readiness resets on disconnect, reconnect, and domain reload

Changes

  • Protocol: editor.ping command, EditorReady on HealthResult
  • Bridge: ProbeEditorReadinessAsync ping loop, IsEditorReady state with && IsUnityConnected guard
  • CLI: WaitCommand tracks 3 states with distinct UX per state
  • Unity plugin: editor.ping handler
  • Tests: 6 new EditorReadinessTests + updated HealthEndpointTests and DtoSerializationTests

Test plan

  • dotnet test — 159 tests pass
  • Manual test against live Unity Editor: wait shows 3-stage progress, scene list and script eval work immediately after
  • Health endpoint returns editorReady: true when editor is responsive
  • JSON output includes both unityConnected and editorReady fields

After WebSocket connection, the bridge now sends editor.ping RPCs to
Unity until the main thread responds, proving the editor isn't blocked
on asset import or safe mode. The wait command checks editorReady
instead of just unityConnected, with intermediate progress messages
and distinct timeout errors for each failure mode.

Closes #18
@Niaobu Niaobu self-assigned this Feb 19, 2026
@Niaobu Niaobu marked this pull request as ready for review February 19, 2026 19:16
@Niaobu Niaobu merged commit 3103288 into main Feb 19, 2026
1 check passed
@Niaobu Niaobu deleted the fix/wait-editor-readiness branch February 20, 2026 07:40
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.

wait command returns early

1 participant