Skip to content

chore: Simplify shared Roslyn worker internals - #1625

Merged
hatayama merged 2 commits into
v3-betafrom
refactor/hatayama/extract-shared-roslyn-worker-protocol
Jul 8, 2026
Merged

hatayama merged 2 commits into
v3-betafrom
refactor/hatayama/extract-shared-roslyn-worker-protocol

Conversation

@hatayama

@hatayama hatayama commented Jul 8, 2026 •

Copy link
Copy Markdown
Owner

Summary

  • Separate shared Roslyn worker wire framing and template rendering from process lifecycle orchestration.
  • Keep dynamic-code compilation behavior and worker protocol bytes unchanged.

User Impact

  • Execute-dynamic-code compilation, retry, timeout, cancellation, and fallback behavior remain unchanged.
  • The smaller worker host makes later lifecycle and assembly-build refactors easier to review independently.

Changes

  • Add SharedRoslynCompilerWorkerProtocol to own request encoding, response header parsing, diagnostic framing, protocol read timeout, quit marker, and worker program template token replacement.
  • Retarget existing command/template tests directly to the new owner and remove six host test wrappers.
  • Add characterization coverage for valid response headers, invalid prefixes, and non-numeric exit codes before extraction.
  • Reduce SharedRoslynCompilerWorkerHost from 988 to 865 lines while leaving retry, process lifecycle, assembly build, and shutdown state in the host.
  • The only non-move production change is passing the current worker StandardOutput reader into ReadDiagnosticLines; all compile calls run under SharedCompilerWorkerLock, and Process.StandardOutput returns the same reader instance used for the response header.
  • Preserve the existing double Path.GetFullPath application, blocking read behavior, strings, markers, timeout values, and out int exitCode contract.

Verification

  • dist/darwin-arm64/uloop compile --project-path "$(git rev-parse --show-toplevel)" (0 errors, 0 warnings)
  • SharedRoslynCompilerWorkerHostTests (10 passed)
  • ExternalCompilerPathResolverTests (15 passed, including worker-build fallback)
  • StaticFacadeStateGuardTests (20 passed)
  • Confirmed that removed host wrappers have zero references and the protocol has no reverse dependency on the host.
  • No IPC wire shape, CLI/package protocol version, or release input changes.

Review in cubic

hatayama added 2 commits July 9, 2026 00:53
Cover valid result headers and both invalid-header classifications before moving protocol parsing out of the worker host.
Move request framing, response parsing, protocol reads, and worker template
rendering out of the process host. Pass the locked worker output reader
explicitly so the protocol layer remains independent of host lifecycle state.
@coderabbitai

coderabbitai Bot commented Jul 8, 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: 17 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: a00b5f31-916f-4453-a6f3-ee2f9c905f7c

📥 Commits

Reviewing files that changed from the base of the PR and between 829e84f and 48d8191.

⛔ Files ignored due to path filters (1)
  • Packages/src/Editor/FirstPartyTools/ExecuteDynamicCode/DynamicCompilation/SharedRoslynCompilerWorkerProtocol.cs.meta is excluded by none and included by none
📒 Files selected for processing (3)
  • Assets/Tests/Editor/DynamicCodeToolTests/SharedRoslynCompilerWorkerHostTests.cs
  • Packages/src/Editor/FirstPartyTools/ExecuteDynamicCode/DynamicCompilation/SharedRoslynCompilerWorkerHost.cs
  • Packages/src/Editor/FirstPartyTools/ExecuteDynamicCode/DynamicCompilation/SharedRoslynCompilerWorkerProtocol.cs
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch refactor/hatayama/extract-shared-roslyn-worker-protocol

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.

@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 4 files

You’re at about 92% of the monthly reviewed-line limit. You may want to disable incremental reviews to conserve quota. Reviews will continue until that limit is exceeded. If you need help avoiding interruptions, please contact contact@cubic.dev.

Re-trigger cubic

@hatayama
hatayama merged commit 164021f into v3-beta Jul 8, 2026
10 checks passed
@hatayama
hatayama deleted the refactor/hatayama/extract-shared-roslyn-worker-protocol branch July 8, 2026 16:06
RyanXie123 pushed a commit to RyanXie123/unity-cli-loop that referenced this pull request Sep 22, 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