Skip to content

chore: isolate project IPC response framing - #1640

Merged
hatayama merged 1 commit into
v3-betafrom
refactor/hatayama/extract-bridge-response-writer
Jul 8, 2026
Merged

hatayama merged 1 commit into
v3-betafrom
refactor/hatayama/extract-bridge-response-writer

Conversation

@hatayama

@hatayama hatayama commented Jul 8, 2026 •

Copy link
Copy Markdown
Owner

Summary

  • Isolate project IPC Content-Length framing and response writes behind one stateless writer.
  • Keep the bridge server focused on request and connection orchestration without changing emitted bytes.

User Impact

  • There is no intended user-visible behavior change.
  • CLI request acceptance, heartbeat delivery, final responses, cancellation, and connection handling remain unchanged.

Changes

  • Move Content-Length frame construction, raw stream writes, and per-connection locked writes into UnityCliLoopBridgeResponseWriter.
  • Keep ProcessRequestFrameAsync in the server and preserve its control flow.
  • Update exactly three writer callers: the dispatch-accepted response, heartbeat callback, and final response.
  • Keep the per-connection SemaphoreSlim, heartbeat lifecycle, disconnect monitor, request token source, and JSON generation in their existing owners.

Verification

  • Passed the related EditMode baseline before editing (139/139).
  • Confirmed the three new frame tests fail before implementation with three CS0103 errors, then pass after implementation (3/3).
  • Covered empty output, exact ASCII framing, and UTF-8 multibyte byte length.
  • Compared the three moved method bodies after normalizing required visibility/static changes; framing, guards, write parameters, lock handling, and try/finally behavior are unchanged.
  • Passed the response writer, bridge shutdown, reassembler, heartbeat, cancellation policy, response serializer, client connection, architecture, and static facade guard fixtures (142/142).
  • Compiled the Unity package with 0 errors and 0 warnings.

Compatibility

  • The emitted frame remains Content-Length: <UTF-8 byte count>\r\n\r\n<JSON>.
  • Dispatch-accepted, heartbeat, and final JSON shapes are still owned by JsonRpcRequestProcessor; their order is unchanged.
  • No IPC contract changed, so the protocol version remains unchanged.

Follow-up

  • R2-35 remains open. The next stage will move client stream/task ownership and per-client session processing into a dedicated session manager after separate plan review.

Review in cubic

Isolate Content-Length framing and serialized stream writes so the bridge server keeps request handshake orchestration separate from byte emission. Preserve the accepted, heartbeat, and final response call order while fixing the frame contract with UTF-8 byte-length tests.
@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: 19 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: b69d44bb-1d5c-4498-ad87-0d2df3c19524

📥 Commits

Reviewing files that changed from the base of the PR and between b47a227 and 1923431.

⛔ Files ignored due to path filters (2)
  • Assets/Tests/Editor/UnityCliLoopBridgeResponseWriterTests.cs.meta is excluded by none and included by none
  • Packages/src/Editor/Infrastructure/UnityCliLoopBridgeResponseWriter.cs.meta is excluded by none and included by none
📒 Files selected for processing (3)
  • Assets/Tests/Editor/UnityCliLoopBridgeResponseWriterTests.cs
  • Packages/src/Editor/Infrastructure/UnityCliLoopBridgeResponseWriter.cs
  • Packages/src/Editor/Infrastructure/UnityCliLoopBridgeServer.cs
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch refactor/hatayama/extract-bridge-response-writer

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 5758724 into v3-beta Jul 8, 2026
10 checks passed
@hatayama
hatayama deleted the refactor/hatayama/extract-bridge-response-writer branch July 8, 2026 22:36
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