Skip to content

fix: Compile waits longer before reporting indeterminate results#1276

Merged
hatayama merged 1 commit into
v3-betafrom
feature/hatayama/fix-issue-1273
Jun 2, 2026
Merged

fix: Compile waits longer before reporting indeterminate results#1276
hatayama merged 1 commit into
v3-betafrom
feature/hatayama/fix-issue-1273

Conversation

@hatayama

@hatayama hatayama commented Jun 2, 2026

Copy link
Copy Markdown
Owner

Summary

  • Compile now waits longer before treating a stopped compiler state as a missing finish callback.
  • Delayed normal completion callbacks no longer produce premature indeterminate results.

User Impact

  • Before, compile could return Success: null after Unity reported it was no longer compiling if the finish callback arrived later than 500ms.
  • After, compile allows a 2 second window before falling back to missed-callback recovery, reducing false indeterminate results while still recovering from real misses.

Changes

  • Extended the compile finish missed-callback grace window from 500ms to 2000ms.
  • Added watchdog coverage for requests that complete after the previous 500ms window.
  • Kept the existing missed-callback recovery path for real callback misses.

Verification

  • cli/dist/darwin-arm64/uloop compile --project-path <PROJECT_ROOT>
  • cli/dist/darwin-arm64/uloop run-tests --project-path <PROJECT_ROOT> --test-mode EditMode --filter-type regex --filter-value "CompileLifecycleWatchdogTests"
  • git diff --check

Closes #1273

Allow normal delayed compilationFinished callbacks after Unity reports that compilation has stopped before treating the compile result as indeterminate.

Add watchdog coverage for requests that complete after the previous 500ms window.
@coderabbitai

coderabbitai Bot commented Jun 2, 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: fbd49931-44a4-4809-97b0-4168916a68a0

📥 Commits

Reviewing files that changed from the base of the PR and between d64d9bb and 09bcbbd.

📒 Files selected for processing (2)
  • Assets/Tests/Editor/CompileLifecycleWatchdogTests.cs
  • Packages/src/Editor/ToolContracts/UnityCliLoopConstants.cs

📝 Walkthrough

Walkthrough

This PR addresses delayed compile-finish callback handling by extending the missed-callback grace period from 500ms to 2000ms and validating that the watchdog correctly accepts callbacks arriving in the extended window without triggering unnecessary recovery logic.

Changes

Compile finish callback grace period

Layer / File(s) Summary
Grace period constant increase and delayed callback test
Packages/src/Editor/ToolContracts/UnityCliLoopConstants.cs, Assets/Tests/Editor/CompileLifecycleWatchdogTests.cs
The COMPILE_FINISH_MISSED_CALLBACK_GRACE_MS constant is increased from 500ms to 2000ms. A new async test WatchAsync_WhenRequestCompletesAfterOldFinishGrace_StopsWithoutRecovery simulates a delayed finish callback (requires multiple IsCompiling polls before returning true) and verifies the watchdog stops without triggering missed-callback recovery, confirming no counter increments and polling time exceeded 500ms.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~4 minutes

Possibly related PRs

  • hatayama/unity-cli-loop#1237: This PR's updated grace constant and delayed-callback test directly extend and validate the missed-finish-callback watchdog behavior introduced in PR #1237.
🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.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 accurately summarizes the main change: extending the compile finish grace window to prevent premature indeterminate results.
Description check ✅ Passed The description is directly related to the changeset, explaining the rationale, user impact, and changes made.
Linked Issues check ✅ Passed The PR addresses all objectives from issue #1273: extends grace window from 500ms to 2000ms [#1273], adds watchdog test coverage for delayed callbacks [#1273], and preserves recovery path for real misses [#1273].
Out of Scope Changes check ✅ Passed All changes are directly related to the objectives: constant update for grace period and new test for delayed callback coverage. No unrelated modifications detected.

✏️ 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/hatayama/fix-issue-1273

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.

No issues found across 2 files

Re-trigger cubic

@hatayama
hatayama merged commit 100e9aa into v3-beta Jun 2, 2026
8 checks passed
@hatayama
hatayama deleted the feature/hatayama/fix-issue-1273 branch June 2, 2026 09:16
@github-actions github-actions Bot mentioned this pull request Jun 2, 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