Skip to content

feat: add --compile-wait-timeout-seconds to uloop compile - #2033

Merged
hatayama merged 4 commits into
feature/issue-2032-compile-waitfrom
feature/issue-2032-wait-timeout-flag
Jul 28, 2026
Merged

feat: add --compile-wait-timeout-seconds to uloop compile#2033
hatayama merged 4 commits into
feature/issue-2032-compile-waitfrom
feature/issue-2032-wait-timeout-flag

Conversation

@hatayama

@hatayama hatayama commented Jul 28, 2026

Copy link
Copy Markdown
Owner

Summary

  • uloop compile now accepts --compile-wait-timeout-seconds (default 600) so large projects can wait longer than the previous hard-coded 10 minutes before COMPILE_WAIT_TIMEOUT.
  • Timeout error messages report the actual wait duration that was used.

User Impact

  • Before: compile wait always timed out after 10 minutes, with no way to extend it for large projects.
  • After: callers can set a longer (or shorter) wait. Values above 1200 seconds print a warning because they exceed Unity's 20-minute result retention window.

Changes

  • Added CompileWaitTimeoutSeconds to the compile tool schema, skill docs, and generated catalog/skill copies.
  • Project runner reads the param for the status-poll deadline and threads the duration into COMPILE_WAIT_TIMEOUT messaging.
  • Shared release input stamps updated for the cli/common catalog change.

Verification

  • scripts/check-go-cli.sh passed.
  • scripts/sync-tool-docs.sh --check passed.
  • dist/darwin-arm64/uloop compile --compile-wait-timeout-seconds 1 --force-recompile returned COMPILE_WAIT_TIMEOUT with timed out after 1000ms.
  • Plain dist/darwin-arm64/uloop compile succeeded afterward.

Review in cubic

hatayama and others added 2 commits July 28, 2026 15:48
Large projects can exceed the hard-coded 10-minute CLI wait. Expose the
timeout in the compile tool schema and skill docs so callers can set it.

Co-authored-by: Cursor <cursoragent@cursor.com>
Read CompileWaitTimeoutSeconds from tool params and use it as the
status-poll deadline so large compiles can wait longer than 10 minutes.

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

coderabbitai Bot commented Jul 28, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Warning

Review limit reached

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

Next review available in: 39 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: acda5049-8895-4952-8927-cf7f17bc84db

📥 Commits

Reviewing files that changed from the base of the PR and between e2dd346 and 594ac1f.

📒 Files selected for processing (3)
  • cli/project-runner/internal/projectrunner/compile_wait.go
  • cli/project-runner/internal/projectrunner/compile_wait_test.go
  • cli/project-runner/internal/projectrunner/run.go
📝 Walkthrough

Walkthrough

The compile CLI gains a configurable wait timeout with schema and documentation updates. The project runner validates the parameter, applies it to compile waiting, warns beyond Unity’s retention window, and reports the configured duration in timeout errors.

Changes

Configurable compile timeout

Layer / File(s) Summary
Timeout contract and tool exposure
Packages/src/Editor/FirstPartyTools/Compile/CompileSchema.cs, cli/common/tools/default-tools.json, .agents/skills/..., .claude/skills/..., Packages/src/Editor/FirstPartyTools/Compile/Skill/SKILL.md, cli/.../shared-inputs-stamp.json
The compile schema, tool definition, documentation, and input stamps add CompileWaitTimeoutSeconds with a default of 600 seconds and Unity retention guidance.
Parameter parsing and validation
cli/project-runner/internal/projectrunner/compile_wait.go, cli/project-runner/internal/projectrunner/compile_wait_test.go
Timeout parameters are parsed from supported numeric representations, default when absent, and rejected when non-positive or non-integral.
Compile wait execution and errors
cli/project-runner/internal/projectrunner/run.go, cli/project-runner/internal/projectrunner/execution_errors.go, cli/project-runner/internal/projectrunner/compile_wait_test.go
The configured timeout controls compilation waiting, triggers retention warnings above 20 minutes, and appears in timeout error guidance with corresponding tests.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Sequence Diagram(s)

sequenceDiagram
  participant CompileCommand
  participant TimeoutParser
  participant UnityCompileWait
  participant TimeoutError
  CompileCommand->>TimeoutParser: Read CompileWaitTimeoutSeconds
  TimeoutParser-->>CompileCommand: Return validated wait duration
  CompileCommand->>UnityCompileWait: Wait for compilation using duration
  UnityCompileWait-->>CompileCommand: Completion or timeout
  CompileCommand->>TimeoutError: Format configured timeout
Loading

Possibly related issues

  • Issue 2032 — Directly covers the configurable compile-wait timeout implemented by this change.

Possibly related PRs

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and concisely summarizes the main change: adding the compile wait timeout flag to uloop compile.
Description check ✅ Passed The description is directly related to the changeset and accurately summarizes the new timeout flag, behavior, and verification.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
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.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feature/issue-2032-wait-timeout-flag

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.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
cli/project-runner/internal/projectrunner/execution_errors.go (1)

23-30: 🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

Remove the fixed recovery-window promise.

The configured timeout now varies, but Line 28 still promises about 10 more minutes of result recovery. This contradicts the retention warning for values above 1200 seconds. Tell callers to retry promptly and state that recoverability depends on the configured wait, or calculate it dynamically.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@cli/project-runner/internal/projectrunner/execution_errors.go` around lines
23 - 30, Update the timeout recovery guidance in the NextActions list of
execution errors so it no longer promises a fixed 10-minute retrieval window. In
the retry instruction, tell callers to retry promptly and describe result
recoverability as dependent on the configured wait/retention settings; keep the
compile retry and fallback restart guidance unchanged.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@cli/project-runner/internal/projectrunner/compile_wait.go`:
- Around line 77-91: Update compileWaitTimeoutFromParams to parse the timeout as
int64 and reject values exceeding the maximum representable time.Duration in
seconds before multiplying by time.Second. Preserve the existing invalid-value
error behavior, and add a boundary test covering the maximum accepted value and
the first overflowing value.

In `@Packages/src/Editor/FirstPartyTools/Compile/Skill/SKILL.md`:
- Line 24: Add [--compile-wait-timeout-seconds <seconds>] to the uloop compile
usage synopsis in Packages/src/Editor/FirstPartyTools/Compile/Skill/SKILL.md,
then regenerate the copies in .agents/skills/uloop-compile/SKILL.md and
.claude/skills/uloop-compile/SKILL.md through the normal workflow; do not edit
the generated skill files directly.

---

Outside diff comments:
In `@cli/project-runner/internal/projectrunner/execution_errors.go`:
- Around line 23-30: Update the timeout recovery guidance in the NextActions
list of execution errors so it no longer promises a fixed 10-minute retrieval
window. In the retry instruction, tell callers to retry promptly and describe
result recoverability as dependent on the configured wait/retention settings;
keep the compile retry and fallback restart guidance unchanged.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: 8c4a72d2-d72c-4061-8fea-443d150d948f

📥 Commits

Reviewing files that changed from the base of the PR and between 5aa4ac7 and 8614ceb.

📒 Files selected for processing (11)
  • .agents/skills/uloop-compile/SKILL.md
  • .claude/skills/uloop-compile/SKILL.md
  • Packages/src/Editor/FirstPartyTools/Compile/CompileSchema.cs
  • Packages/src/Editor/FirstPartyTools/Compile/Skill/SKILL.md
  • cli/common/tools/default-tools.json
  • cli/dispatcher/shared-inputs-stamp.json
  • cli/project-runner/internal/projectrunner/compile_wait.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
  • cli/project-runner/shared-inputs-stamp.json

Comment thread cli/project-runner/internal/projectrunner/compile_wait.go
Comment thread Packages/src/Editor/FirstPartyTools/Compile/Skill/SKILL.md
Values above MaxInt64/time.Second wrap to a negative duration and look
like an immediate timeout. Also add the new flag to the compile usage line.

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

Copy link
Copy Markdown
Owner Author

Re: the outside-diff comment on execution_errors.go NextActions still promising “about 10 more minutes” — intentionally left unchanged in this PR. That copy is rewritten in the follow-up attach-recovery PR once pending-record recovery exists and the remaining retrievable window can be computed from the configured timeout. Changing it here would document behavior this PR does not implement yet.

cli_compile_request_prepared always recorded the default 600000ms even when
--compile-wait-timeout-seconds was set. Pass the resolved duration through,
and add runCompileWithDomainReloadWaitWithDeps tests that fail if that
wiring regresses to the package constant.

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