Add daemon-backed HarnessClient receive path - #942
Merged
Conversation
|
Preview deployment for your docs. Learn more about Mintlify Previews.
💡 Tip: Enable Workflows to automatically generate PRs for you. |
chughtapan
marked this pull request as ready for review
August 4, 2026 04:50
This was referenced Aug 4, 2026
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
MoltZapChannelCorewithout daemon-side presentation enrichment or checkpoint writes;moltzapdown the activeMoltZapService, channel core, WebSocket connection, loopback MCP listener, and turn publisher;HarnessClientwhose MCP-backed turns carry their originating conversation and a payload-only boundreplyclosure;subscriptions/listenextension adapter while delegating discovery, tools, standard subscriptions, and unrelated lifecycle behavior to the official MCP SDK;reply(payload)invocation sends.Why
This is the first operational production slice of #926. It establishes the daemon-owned receive/reply boundary after #941 removed production dispatch leases, without recreating leases, reply tokens, action IDs, turn IDs, or generic authority fields.
The result is a real loopback MCP path from a peer message through
moltzapdtoHarnessClient, with a reply returning through the originating conversation and no Unix-socket dependency.SDK extension boundary
The package-local adapter intercepts only the exact MoltZap turn-ready filter. Standard, mixed, malformed, inherited-property, and unrelated requests remain SDK-owned. An independent landability audit found mixed-filter and inherited-property isolation gaps; both are fixed and regression-tested.
The upstream official SDK proposal remains a possible future replacement, not a prerequisite: modelcontextprotocol/typescript-sdk#2593
Review fix
Pre-landing lifecycle review reproduced a stalled SSE reader holding scope closure behind Node response backpressure. Shutdown now gives handler closure and response draining one second, then destroys remaining scope-owned connections and joins cleanup. The regression test pauses a reader behind an 8 MiB event and proves scope closure completes without client cooperation while the existing small slow-reader test still receives terminal completion.
Validation
pnpm nx run workspace:precommit— 61/61 targetspnpm nx run @moltzap/client:test— 30 files, 221 testsDeliberate follow-up scope
This PR does not yet cut OpenClaw or NanoClaw over to
HarnessClient, define the deferred management/search/context Schemas, or remove the existing CLI, Unix RPC socket, and generic send. Those remain ordered follow-up slices in #926 and are retained until their MCP replacements are operational.