Repository navigation
Let a custom transport work without socket paths, and document it - #124
Open
bensheldon wants to merge 2 commits into
Open
bensheldon wants to merge 2 commits into
bensheldon wants to merge 2 commits into
Conversation
A transport's call now takes kind: (:work or :control) instead of socket:, so a transport that doesn't use the cell's UNIX sockets doesn't need their paths. Transport::Socket turns the kind into the path, and still accepts socket: directly. The client passes timeout: on every call, so the contract is the same for work and control. A cell with its own transport is enabled without HotCell.root or dir:, because the transport decides where its requests go. docs/client-api.md documents transport: under "Use your own transport". Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01UxJkbuJebUB5t8dzBy1Dy9
There was a problem hiding this comment.
🟢 Approved
The implementation has no identified blocking defects; remaining feedback is limited to documentation clarification and regression-test hardening.
2 open issues
What changed in this PR
This PR lets custom client transports reach cells without socket directories and documents the transport interface as public API.
Changes:
- Enables cells with custom transports without
HotCell.rootordir:. - Passes explicit
kind:andtimeout:keywords, while preserving directsocket:support in the socket transport. - Updates documentation, migration guidance, and test transports.
[!TIP]
If you aren't ready for review, convert to a draft PR.
Click "Convert to draft" or rungh pr ready --undo.
Click "Ready for review" or rungh pr readyto reengage.
| File | Description |
|---|---|
yabeda-hotcell/test/test_helper.rb |
Updates test transports to accept kind:. |
hotcell-client/test/registration_test.rb |
Covers custom transports without directories. |
hotcell-client/test/diagnosis_test.rb |
Records request kinds instead of socket paths. |
hotcell-client/test/control_timeout_test.rb |
Distinguishes work and control calls by kind. |
hotcell-client/test/classification_test.rb |
Updates transport argument recording. |
hotcell-client/lib/hot_cell/transport.rb |
Maps request kinds to sockets and describes the interface. |
hotcell-client/lib/hot_cell/client.rb |
Explicitly forwards work kind and timeout. |
hotcell-client/lib/hot_cell/cell.rb |
Enables custom transports and forwards control kind. |
docs/client-api.md |
Documents registration and the custom transport contract. |
CHANGELOG.md |
Records the breaking change and upgrade steps. |
activestorage-hotcell-client/test/test_helper.rb |
Updates the test transport signature. |
Review effort: Balanced
Comment on lines
+90
to
+91
| # Deliver line and the inputs' bytes, write each output's bytes into its descriptor's `io`, and return | ||
| # HotCell::Response.parse(response_line). |
Comment on lines
+15
to
+17
| # The timeout's default is Transport::Socket's own, so this records what a caller overrode rather than what | ||
| # it passed. The work path doesn't override it. | ||
| def call(cell, line, descriptors, kind:, timeout: cell.timeout) |
…eive a timeout The client measures each output's size on disk after the transport returns, so a transport that writes through a buffered IO without flushing reports a successful request as unavailable. The docs now say to flush each output before returning success. The recording transport in control_timeout_test.rb takes timeout: without a default, so the test fails if the client stops forwarding it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01UxJkbuJebUB5t8dzBy1Dy9
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

This makes the
transport:option ofHotCell.registerusable without a socket directory, and documents its contract as public API.1. A cell with its own transport is enabled without a directory
Cell#enabled?now returnstruewhen the cell has atransport:other thanHotCell::Transport::Socket, even withoutHotCell.rootordir:.2. Transports can receive a
kind:and make socket optionalkind: :workis an operation;kind: :controlisdescribeormetrics.HotCell::Transport::Socketturns the kind into the socket path, and still acceptssocket:to name a path directly.timeout:on every call, for work as well as control, so the contract is the same for both.3. Documentation
docs/client-api.mdhas a new Use your own transport section, with:callreceives;The register options table also lists
transport:.Why
transport:as the way to reach a cell without passing descriptors over its UNIX socket, and offers to document its contract.transport:to run Hot Cell as a network service. Its transport sends Hot Cell's request line and the inputs over HTTP, and a gateway next to the cell calls it withHotCell::Transport::Socket. Both problems above came up there:dir:that's never opened;socket:argument against that placeholder's paths to tell work from control.Compatibility
Warning
The
socket:→kind:change breaks custom transports. The changelog lists it under Breaking and adds an Upgrading step.transport:wasn't documented before, and the transports in this repository's own tests are updated here.I dunno if I should worry about this given the current early state of the gem.