Repository navigation
refactor(gateway): extract socket-free kernel factory - #121981
Merged
Merged
Conversation
Contributor
|
🦞👀 Pull request received. I will update this pull request when review starts. |
steipete
marked this pull request as ready for review
August 11, 2026 09:42
Contributor
Author
|
@clawsweeper review |
Contributor
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
Contributor
Author
|
Land-ready proof:
This is phase-2 PR 4 of the Gateway kernel split. The design-verified resident inventory preceded this extraction; next is the resident-registry PR. |
Contributor
Author
|
Merged via squash.
|
obviyus
added a commit
that referenced
this pull request
Aug 11, 2026
…tion server (#112032) A 401 challenge pointing at new protected-resource metadata let the MCP SDK rediscover a different authorization server and POST the stored refresh token to it. Token issuer is now persisted with the tokens and disclosure is gated on exact issuer identity; legacy rows without recoverable issuer provenance fail closed to an explicit re-login. Admin-merged past checks-node-compact-small-1 by maintainer decision: five runs of attribution show the failure is src/gateway/server-kernel.test.ts (added in #121981) hanging at HTTP-listen under this merge ref's shard composition — unrelated to this diff and green on main. Evidence on the PR. Co-authored-by: yetval <[email protected]> Co-authored-by: Ayaan Zaidi <[email protected]>
github-actions Bot
pushed a commit
to Desicool/openclaw
that referenced
this pull request
Aug 12, 2026
github-actions Bot
pushed a commit
to Desicool/openclaw
that referenced
this pull request
Aug 12, 2026
…tion server (openclaw#112032) A 401 challenge pointing at new protected-resource metadata let the MCP SDK rediscover a different authorization server and POST the stored refresh token to it. Token issuer is now persisted with the tokens and disclosure is gated on exact issuer identity; legacy rows without recoverable issuer provenance fail closed to an explicit re-login. Admin-merged past checks-node-compact-small-1 by maintainer decision: five runs of attribution show the failure is src/gateway/server-kernel.test.ts (added in openclaw#121981) hanging at HTTP-listen under this merge ref's shard composition — unrelated to this diff and green on main. Evidence on the PR. Co-authored-by: yetval <[email protected]> Co-authored-by: Ayaan Zaidi <[email protected]>
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.
What Problem This Solves
Phase-2 PR 4 extracts the socket-free Gateway kernel factory after the landed connection/transport split (#121931) and dispatch ownership seam (#121961).
Why This Change Was Made
createGatewayKernel()now owns bootstrap, kernel-state preparation, lifecycle/live state, subscriptions and approval managers, the method registry, request-context construction, instance-runtime/facade wiring, and fallback context publication.startGatewayServerCore()composes that kernel with the HTTP transport and then starts transport-bound residents.A late-bound transport bridge supplies worker ingress and sandbox accessors to the kernel. Before attachment it preserves the existing fail-closed sandbox error and undefined post-bind endpoints. Normal shutdown retains the same WebSocket/HTTP order; kernel-construction failures can run the full non-transport teardown, including the previously pre-lifecycle TLS failure surface.
The original startup log order,
minimalTestGatewayshort-circuits, startup measure names, request-envelope/root-admission path, and 500ms post-ready barrier remain unchanged. There are no config, protocol, default, or user-visible behavior changes.Next is phase-2 PR 5: the ordered resident registry and named kernel setters for resident-owned live-state slots.
User Impact
No user-visible change. The Gateway kernel can now be constructed and used for internal dispatch without creating or listening on HTTP/WebSocket servers.
Evidence
server-kernel.test.ts: constructscreateGatewayKernel()without transport/listen, verifies the exact startup measure sequence, fail-closed sandbox access, in-processhealth, and a cached agent turn through the internal facade; also proves TLS construction failure performs teardown with the unchanged error — 2 passedserver.agent.*+server.chat.*suites — 7 files, 200 passednode scripts/check-changed.mjs -- <touched>— core/core-test tsgo, lint, guards, import cycles, and runtime architecture lanes passedpnpm build— passedClawSweeper review metrics: production
+493/-411(net+82) for the factory, late-bound transport boundary, and transport-optional teardown; tests+190/-0. AI-assisted; implementation and evidence were reviewed directly.