Skip to content

fix: suppress expected launch-time worker errors#1837

Merged
hatayama merged 2 commits into
v3-betafrom
fix/shared-worker-lifecycle-log-severity
Jul 18, 2026
Merged

fix: suppress expected launch-time worker errors#1837
hatayama merged 2 commits into
v3-betafrom
fix/shared-worker-lifecycle-log-severity

Conversation

@hatayama

@hatayama hatayama commented Jul 18, 2026

Copy link
Copy Markdown
Owner

Summary

  • Launch readiness no longer reports expected shared Roslyn worker lifecycle races as Unity Console errors.
  • Genuine shared worker failures retain their existing error severity.

User Impact

  • The readiness probe can race with Unity startup domain reload without producing misleading red Console entries.
  • One-shot compilation fallback remains available when the shared worker closes during the lifecycle transition.

Changes

  • Carry shared worker failure reasons through a dedicated compile outcome.
  • Suppress only lifecycle-closed failure and fallback diagnostics, with deduplicated informational telemetry.
  • Add regression coverage for lifecycle closure while preserving coverage for real worker failures.

Verification

  • dist/darwin-arm64/uloop compile --project-path <PROJECT_ROOT>: ErrorCount 0, WarningCount 0.
  • Targeted EditMode tests: 45 passed, 0 failed.
  • DynamicCodeToolTests: 226 passed, 1 unrelated pre-existing failure in FirstPartySchemaMetadataTests.
  • Three launch -r E2E runs: readiness succeeded each time, and get-logs --log-type Error returned TotalCount 0.

Carry shared worker failure reasons through compilation so the launch readiness
probe can fall back quietly when Unity advances its lifecycle generation.
Keep genuine worker failures on the existing error reporting path.
@coderabbitai

coderabbitai Bot commented Jul 18, 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: 21 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

Run ID: 4e42c368-19a7-4a37-83d3-ae691d70952f

📥 Commits

Reviewing files that changed from the base of the PR and between eff3666 and c388e5e.

📒 Files selected for processing (2)
  • Assets/Tests/Editor/DynamicCodeToolTests/SharedRoslynCompilerWorkerHostTests.cs
  • Packages/src/Editor/FirstPartyTools/ExecuteDynamicCode/Compilation/DynamicCompilationHealthMonitor.cs
📝 Walkthrough

Walkthrough

Shared Roslyn worker compilation now returns structured success or failure outcomes, distinguishes lifecycle closure from other failures, reports lifecycle closure informationally, and lets RoslynCompilerBackend fall back to one-shot compilation without error logs. Tests cover outcome metadata and startup fallback behavior.

Changes

Shared Roslyn lifecycle handling

Layer / File(s) Summary
Structured worker outcomes
Packages/src/Editor/FirstPartyTools/ExecuteDynamicCode/DynamicCompilation/SharedRoslynCompilerWorkerHostResults.cs
Adds shared failure-reason constants and SharedWorkerCompileOutcome, including compiler messages, failure metadata, success detection, and lifecycle-closed classification.
Worker failure reporting
Packages/src/Editor/FirstPartyTools/ExecuteDynamicCode/DynamicCompilation/SharedRoslynCompilerWorkerHost.cs, Packages/src/Editor/FirstPartyTools/ExecuteDynamicCode/Compilation/DynamicCompilationHealthMonitor.cs
Updates worker compilation and retry methods to return structured outcomes, report lifecycle closure separately, preserve failure context, and deduplicate informational logs.
Backend fallback validation
Packages/src/Editor/FirstPartyTools/ExecuteDynamicCode/DynamicCompilation/RoslynCompilerBackend.cs, Assets/Tests/Editor/DynamicCodeToolTests/*
Makes backend fallback reporting lifecycle-aware and adds tests for lifecycle-closed outcomes, worker-start failures, and successful one-shot compilation fallback.

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

Sequence Diagram(s)

sequenceDiagram
  participant RoslynCompilerBackend
  participant SharedRoslynCompilerWorkerHost
  participant DynamicCompilationHealthMonitor
  participant OneShotRoslyn
  RoslynCompilerBackend->>SharedRoslynCompilerWorkerHost: TryCompileAsync
  SharedRoslynCompilerWorkerHost->>DynamicCompilationHealthMonitor: ReportSharedWorkerLifecycleClosed
  SharedRoslynCompilerWorkerHost-->>RoslynCompilerBackend: Failed lifecycle-closed outcome
  RoslynCompilerBackend->>OneShotRoslyn: Compile with one-shot fallback
Loading

Possibly related PRs

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly summarizes the main change: suppressing expected worker errors during launch.
Description check ✅ Passed The description is directly related to the changeset and matches the stated 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 fix/shared-worker-lifecycle-log-severity

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.

@hatayama
hatayama merged commit 0be8528 into v3-beta Jul 18, 2026
10 checks passed
@hatayama
hatayama deleted the fix/shared-worker-lifecycle-log-severity branch July 18, 2026 18:15
@github-actions github-actions Bot mentioned this pull request Jul 18, 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