Host the Hub broker on a foreign listener; drop the shelf endpoint (v1.56.0)#112
Merged
Conversation
omnydrive 1.12.2 is itself just the omnyhub ^1.3.0 bump. The previous ^1.12.1 constraint already resolved to it, so this only makes the constraint name the version OmnyShell is built and tested against. No behaviour change and no API change: the full suite passes unmodified (808 pass, 9 skipped). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…1.56.0) The Hub broker can now be hosted on a listener OmnyShell does not own, so another Hub — an OmnyServer Hub, say — can serve OmnyShell nodes on its own port, at its own path, beside its own surfaces. One Hub, one certificate, one port, two kinds of node. Nothing changes for a standalone OmnyShell Hub: OmnyShellHub's API and wire behaviour are unchanged, and its 808 existing tests pass untouched. Added: - OmnyShellHubService — the broker as an omnyhub Service. HubBroker was already transport-agnostic (driven by accept()ing connections), and FrameConnection already wraps an omnyhub Connection, so this is only an adapter: the whole integration is one method. Nodes need no change at all — they dial hubUri verbatim, so `omnyshell node start --hub wss://hub:8443/shell` already works. - NodeConfig.home overrides where a node persists its UID. The UID file is keyed by the machine, so two node runtimes in one process (an embedded shell node beside another agent) otherwise contend on ~/.omnyshell/node.uid and warn about the UID changing under them. Mirrors the existing gitCredentialsHome hatch. Changed: - OmnyShellHub is rebuilt on omnyhub's OmnyHub, hosting an OmnyShellHubService at '/' — which matches every path, exactly as the old listener did (it upgraded a WebSocket regardless of path), so existing clients are unaffected. - TLS is now an omnyhub TlsProvider: StaticTls for a securityContext, ReloadableFileTls for a tlsDirectory. Renewal still rebinds the listener gap-free, but omnyhub performs it and reports "TLS certificate renewed". - The hub's lifecycle/TLS/error messages are bridged into HubConfig.logger, which would otherwise have gone to omnyhub's default no-op logger and vanished. - Removed WsServerEndpoint, the last user of shelf: shelf and shelf_web_socket are dropped from the dependencies. - PemTlsSource is retained — tunnels are separate raw TCP listeners and still use it. 813 tests (up from 808); format/analyze/dependency_validator/doc green. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
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.
Why
The Hub broker can now be hosted on a listener OmnyShell does not own — so another Hub (an OmnyServer Hub) can serve OmnyShell nodes on its own port, at its own path, beside its own surfaces. One Hub, one certificate, one port, two kinds of node.
The integration is one method
Two things made this a wiring job rather than a rewrite:
HubBrokerwas already transport-agnostic — its entry point isvoid accept(OmnyShellConnection), it owns no listener, and its own doc says so. The only thing tying it to a socket was a 72-lineWsServerEndpoint.FrameConnection.wrap(omnyhub.Connection)already existed, and omnyhub'sService.handleConnectionhands over exactly that type.Nodes need no change at all.
NodeRuntimedialsconfig.hubUriverbatim, soomnyshell node start --hub wss://hub:8443/shell(andservice install node --hub …/shell) already work.ConnectionAuthenticator; one would consume the very frames the broker is waiting for. Note omnyhub treats a route'snullconnection authenticator as inherit the hub-wide one, not none. Documented on the class.Changed
OmnyShellHubis rebuilt on omnyhub'sOmnyHub, hosting the service at/— which matches every path, exactly as the old listener did (it upgraded a WebSocket regardless of path), so existing clients diallingwss://host:8443are unaffected. Its public API (start/stop/port/isRunning/nodes/sessions/audit) is unchanged.TlsProvider:StaticTlsfor asecurityContext,ReloadableFileTlsfor atlsDirectory. Renewal still rebinds the listener gap-free; omnyhub now performs it and reportsTLS certificate renewedrather than the old…rebound….Logger, which defaults toNoopLogger. Without a bridge, an OmnyShell Hub would have silently lost all lifecycle, TLS-renewal and unhandled-error logging.HubConfig.loggeris now wired into it.WsServerEndpointdeleted — it was the last user ofshelf, soshelfandshelf_web_socketare dropped from the dependencies.PemTlsSourceis retained: tunnels are separate raw TCP listeners and still use it.Added
NodeConfig.homeoverrides where a node persists its UID (<home>/.omnyshell/node.uid). The UID file is keyed by the machine, so two node runtimes in one process — an embedded shell node beside another agent — otherwise contend on it and warn about the UID changing under them. Mirrors the existinggitCredentialsHomehatch.Tests
813 (up from 808). The regression gate: the 808 existing tests pass unmodified, except one —
hub_tls_dir_testasserted on the log textrebound, which is now omnyhub'srenewed. The behaviour it really cares about (a fresh client round-trips on the renewed listener) is untouched.New
hub_service_mount_test.dartproves the premise directly: a bare omnyhub hub with the broker at/shelland another service at/other— a node registers, a client opens a session and runs a command through it, the host keeps its own surface on the same port, andNodeConfig.homeisolates the UID.format/analyze --fatal-infos --fatal-warnings/dependency_validator/dart doc/publish --dry-runall green.🤖 Generated with Claude Code