Quality pass: IPC communication layer#90
Merged
dhilgaertner merged 2 commits intomainfrom Apr 6, 2026
Merged
Conversation
Fix correctness issues in the Unix socket IPC layer and add comprehensive test coverage for the CrowIPC package. Fixes: - Handle partial writes in SocketServer and SocketClient (write loop) - Add 30s read timeout to SocketClient via SO_RCVTIMEO - Add 1MB response size limit to SocketClient matching server's request limit - Fix 3 RPC handlers returning errors in result dict instead of proper JSON-RPC error responses (get-session, close-terminal) Improvements: - Add RPCErrorCoded protocol for typed error codes in CommandRouter - Conform RPCError to RPCErrorCoded with correct code mapping - Add missing doubleValue accessor, internalError code, Hashable on JSONValue - Add doc comments to all public types - Add new SocketError cases (writeFailed, readFailed, timeout, responseTooLarge) Tests (32 passing): - ProtocolTests: JSONValue round-trips, accessors, factories, error codes - CommandRouterTests: routing, unknown methods, error propagation - SocketRoundTripTests: real socket round-trips, large payloads, timeouts, oversized requests, permissions, invalid JSON Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
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.
Summary
RPCErrorCodedprotocol for typed error codes, doc comments, and missingJSONValueaccessorsCloses #65
Test plan
make buildcompiles cleanlyswift test --package-path Packages/CrowIPC— 32 tests passcrow list-sessionsto confirm IPC workscrow get-session --session <bad-uuid>returns proper RPC error🤖 Generated with Claude Code