Repository navigation
Split relay dispatcher layers - #17174
Conversation
Greptile SummaryThe PR reorganizes the monolithic relay dispatcher into focused layers while retaining a small
Confidence Score: 5/5The PR appears safe to merge. No blocking failure remains.
|
| Filename | Overview |
|---|---|
| src/relay/dispatcher.ts | Replaces the monolithic implementation with a small facade that re-exports the existing public types and extends the complete dispatcher layer chain. |
| src/relay/dispatcher-client-state.ts | Centralizes dispatcher state, initialization, registration APIs, and abstract contracts consumed by the extracted layers. |
| src/relay/dispatcher-client-lifecycle.ts | Extracts client attachment, replacement, invalidation, disposal, decoding, and keepalive behavior. |
| src/relay/dispatcher-rpc-routing.ts | Extracts relay-to-client requests and inbound JSON-RPC request, response, and notification routing. |
| src/relay/dispatcher-notification-publication.ts | Extracts notification publication, targeted control delivery, bulk serialization, and producer-drop diagnostics. |
| src/relay/dispatcher-producer-transport.ts | Extracts producer admission, publication leases, projection behavior, and bulk-capacity retry handling. |
| src/relay/dispatcher-pty-publication.ts | Extracts PTY data and exit publication methods without an established behavioral change. |
| config/max-lines-baseline.txt | Removes the no-longer-needed exemption for the now-small dispatcher facade. |
Class Diagram
%%{init: {'theme': 'neutral'}}%%
classDiagram
RelayDispatcher --|> RelayDispatcherNotificationPublication
RelayDispatcherNotificationPublication --|> RelayDispatcherPtyPublication
RelayDispatcherPtyPublication --|> RelayDispatcherProducerCapacity
RelayDispatcherProducerCapacity --|> RelayDispatcherProducerTransport
RelayDispatcherProducerTransport --|> RelayDispatcherRpcRouting
RelayDispatcherRpcRouting --|> RelayDispatcherFrameCodec
RelayDispatcherFrameCodec --|> RelayDispatcherCapacitySignals
RelayDispatcherCapacitySignals --|> RelayDispatcherClientLifecycle
RelayDispatcherClientLifecycle --|> RelayDispatcherClientState
Reviews (3): Last reviewed commit: "Merge remote-tracking branch 'origin/mai..." | Re-trigger Greptile
…om-3-mobile-browser
…-bottom-4-prune-resolved
…-bottom-5-pane-tree-ops
…bottom-6-mobile-troubleshoot
…lines-bottom-7-external-manager
…es-bottom-8-attach-services
…s-bottom-9-hosted-review-creation
…ax-lines-bottom-10-automation-dispatch-events
… ra/max-lines-bottom-11-settings-navigation
…-lines-bottom-12-daemon-init
…ottom-13-gitlab-item-dialog
…lines-bottom-14-relay-dispatcher
…4-relay-dispatcher # Conflicts: # src/renderer/src/hooks/automation-dispatch-completion.ts
|
Warning Review limit reachedNext included review available in 16 minutes. View limit detailsLimit details: You’ve used all 10 included reviews currently available. You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Review configuration: ⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (13)
ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (13)
📝 WalkthroughWalkthroughThe relay dispatcher is decomposed into contract, state, lifecycle, capacity, frame, RPC, transport, PTY publication, and notification publication classes. The ✨ Finishing Touches 💡 1🛠️ Fix failing CI checks 💡
📝 Generate docstrings
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. Comment |
* Split speech session lifecycle * Split terminal output scheduler pipeline * Split mobile browser pane modules * Prune resolved max-lines suppressions * Split pane tree equalization logic * Extract mobile troubleshoot screen styles * Split external automation manager * Split main window service attachments * Split hosted review creation checks * Split automation dispatch event handling * Split settings navigation metadata * Split daemon initialization lifecycle * Split GitLab item dialog * Split relay dispatcher layers * Fix F3-speech for stablyai#17123 * Fix F1-cycle for stablyai#17131 * Fix F4-navtest for stablyai#17157 * Fix F2-allowlist for stablyai#17161
Summary
RelayDispatcherinto focused client-lifecycle, capacity, framing, RPC-routing, and publication layers while keeping the public facade and method names intactsrc/relay/dispatcher.tsfrom the max-lines baseline, reducing the grandfathered count from 73 to 72admitsPtyDataPublicationdispatcher.tsis now 17 lines; the largest extracted implementation module is 261 lines.Stacked on #17165.
Validation
pnpm tcpnpm test src/relay— 147 files, 1,520 passed, 2 skippedpnpm run check:code-quality:changedpnpm check:max-lines-ratchetgit diff --checkORCA_CROSS_VERSION_BASELINE_REF=v1.4.190 pnpm exec vitest run --config config/vitest.config.ts tests/e2e/cross-version-wire/cross-version-terminal-wire.unit.test.tspnpm exec vitest run --config config/vitest.config.ts tests/e2e/cross-version-wire/cross-version-agent-session-wire.unit.test.tsThe unpinned terminal skew harness currently selects
v1.4.192, which now publishes terminal-mode metadata while this stack's older harness still asserts its absence. That pre-existing release-selection drift is already fixed in #17159 (test(wire): pin pre-metadata release coverage); this pure refactor does not duplicate the unrelated patch.