refactor(envd): make MultiplexedChannel.Fork return a receive-only channel - #3257
Conversation
PR SummaryLow Risk Overview Reviewed by Cursor Bugbot for commit 564c3f8. Bugbot is set up for automated code reviews on this repo. Configure here. |
There was a problem hiding this comment.
Code Review
This pull request updates the Fork method of MultiplexedChannel in multiplex.go to return a receive-only channel (<-chan T) instead of a bidirectional channel (chan T), removing outdated comments regarding backwards compatibility. There are no review comments, so I have no feedback to provide.
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
❌ 1 Tests Failed:
View the top 3 failed test(s) by shortest run time
View the full list of 1 ❄️ flaky test(s)
To view more test analytics, go to the Test Analytics Dashboard |
There was a problem hiding this comment.
Type signature tightening — trivially safe refactor.
Extended reasoning...
Overview
Single-file refactor to packages/envd/internal/services/process/handler/multiplex.go changing Fork()'s return type from chan T to <-chan T. The PR description explains the bidirectional return was a legacy accommodation for start.go writing a bootstrap event into the fork channel, which was removed in the prior commit (04317f8, PR #3256).
Security risks
None. This is a compile-time type refinement; no runtime behavior changes.
Level of scrutiny
Very low. I verified all call sites (connect.go, start.go, and the test file) only read from the returned channel — none send into it — so the tighter type will compile cleanly. The stale doc comment about backwards compat is also correctly removed.
Other factors
No outstanding reviewer comments, no bugs surfaced by the hunter, mechanical change with obvious intent.
The bidirectional return type existed only so start.go could write a bootstrap event directly into its fork channel; that hack was removed in 04317f8 ("fix(envd): avoid Start deadlock after request cancellation (#3256)"), so let the compiler enforce that subscribers never send.