Skip to content

fix: reattach a retried compile to the timed-out in-flight compile - #2034

Merged
hatayama merged 3 commits into
feature/issue-2032-compile-waitfrom
feature/issue-2032-attach-recovery
Jul 28, 2026
Merged

fix: reattach a retried compile to the timed-out in-flight compile#2034
hatayama merged 3 commits into
feature/issue-2032-compile-waitfrom
feature/issue-2032-attach-recovery

Conversation

@hatayama

@hatayama hatayama commented Jul 28, 2026

Copy link
Copy Markdown
Owner

Summary

  • After COMPILE_WAIT_TIMEOUT, a later uloop compile reattaches to the in-flight or completed compile instead of starting a new one that hits UNITY_SERVER_BUSY.
  • Timeout guidance now describes that reattach recovery path and the remaining result-retention window.

User Impact

  • Before: retrying uloop compile after a wait timeout started a new compile and was often rejected as busy while Unity was still compiling.
  • After: retry reuses the timed-out request id, waits for or returns its result, and clears the pending marker when done.

Changes

  • Persist .uloop/pending-compile-request.json on wait timeout (20-minute stale window aligned with Unity result retention).
  • Before sending a new compile, probe get-compile-status with up to 10s of retries, then attach/wait, return a stored result, or fall through per force-recompile / missing-result rules.
  • Rewrite COMPILE_WAIT_TIMEOUT NextActions for reattach; add attach vibe-log events and branch coverage tests.

Verification

  • scripts/check-go-cli.sh passed.
  • E2E with ULOOP_DEBUG=1 and the local dist binary:
    1. --compile-wait-timeout-seconds 1 --force-recompileCOMPILE_WAIT_TIMEOUT + pending record written
    2. Immediate plain uloop compile → not UNITY_SERVER_BUSY; attached and cleared pending record
    3. Timeout again, wait until idle, plain uloop compilecli_compile_attach_result with stored_result and no later cli_compile_request_prepared / cli_compile_request_send_result

Review in cubic

hatayama and others added 2 commits July 28, 2026 16:16
Store the timed-out RequestId under .uloop so a later uloop compile can
reattach instead of starting a conflicting new compile.

Co-authored-by: Cursor <cursoragent@cursor.com>
Probe get-compile-status with a short retry window, wait for or return the
stored result without sending a new compile request, and update timeout
NextActions to describe the reattach recovery path.

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

coderabbitai Bot commented Jul 28, 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: 20 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 Plus

Run ID: 9837e2a2-b535-4efe-bd6e-2a03666f5de9

📥 Commits

Reviewing files that changed from the base of the PR and between 3bbc7bd and ca62f45.

📒 Files selected for processing (8)
  • cli/project-runner/internal/projectrunner/compile_attach.go
  • cli/project-runner/internal/projectrunner/compile_attach_test.go
  • cli/project-runner/internal/projectrunner/compile_pending_record.go
  • cli/project-runner/internal/projectrunner/compile_pending_record_test.go
  • cli/project-runner/internal/projectrunner/compile_wait_deps.go
  • cli/project-runner/internal/projectrunner/compile_wait_test.go
  • cli/project-runner/internal/projectrunner/execution_errors.go
  • cli/project-runner/internal/projectrunner/run.go
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feature/issue-2032-attach-recovery

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.

Ready is editor-wide and unrelated to the pending RequestId, so prefer
HasResult, abandon attach after three Ready&&!HasResult observations,
and warn when --force-recompile is ignored during reattach.

Co-authored-by: Cursor <cursoragent@cursor.com>
@hatayama
hatayama merged commit ebe3330 into feature/issue-2032-compile-wait Jul 28, 2026
2 checks passed
@hatayama
hatayama deleted the feature/issue-2032-attach-recovery branch July 28, 2026 07:30
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