mirror of
https://github.com/bitbaum/openclaw.git
synced 2026-12-05 00:27:38 +01:00
* feat(portals): expose portals to sessions on node-backed cloud workers Worker-turn sessions placed on cloud workers (bundled Crabbox) can now open portals. The portal tool joins the closed worker session-tool catalog and executes on the Gateway, which mints a single-use ticket per proxied connection; the enrolled node redeems it over a TLS-pinned WebSocket via the new private worker.portal.stream.v1 command and splices to the worker's loopback port. The desktop stream broker is generalized with discriminated desktop/portal tickets, and shared node stream transport is extracted from the desktop stream command. Portal availability is negotiated via a new gateway hello capability plus the node's reconnect-scoped workerHost.portalStream declaration, so old node bundles simply do not receive the tool. Environment teardown and owner-epoch replacement close a worker's portals; node disconnects destroy live streams while the listener keeps serving the waiting page. Live-proven on a Crabbox AWS worker: agent opened a portal over the worker protocol, python3 -m http.server on the box served through the Gateway portal URL with token auth intact. * fix(portals): break portal proxy/service type cycle; regenerate Swift protocol models * fix(portals): drop dead PortalTarget re-export; fix test import * fix(portals): only tear down turn-created portals on post-open authority loss ClawSweeper finding: a revoked turn's duplicate open could close the live portal a still-authorized predecessor established, because service.open returns the existing same-environment portal and the executor's error path closed whatever id it received. portal.open now reports created-vs-reused; the executor tears down only portals it created and closes its redundant carrier handle whenever an existing portal is reused. * feat(portals): fence portal reuse behind the caller's live-authority assert Rank-up move from review: portal.open revalidates the caller inside the serialized operation before a reuse can mutate a live portal's metadata, mirroring close(assertCurrent). Regression test proves a lapsed caller cannot rewrite a reused portal's title. * test(portals): expect assertCurrent in worker portal open call * refactor(gateway): extract worker request dispatch into its own module worker-connection.ts crossed the 700-line ratchet after rebasing onto current main; dispatchWorkerRequest and its rejection helper move to worker-connection-dispatch.ts unchanged (434 + 329 lines).