feat(chat): add safe correlated OpenClaw Gateway dispatch#3905
Merged
CompleteDotTech merged 27 commits intoJul 26, 2026
Conversation
CompleteDotTech
force-pushed
the
agent/openclaw-gateway-tool-activity-3865
branch
from
July 26, 2026 16:14
590eb23 to
a466a60
Compare
This was
linked to
issues
Jul 26, 2026
CompleteDotTech
force-pushed
the
agent/openclaw-gateway-tool-activity-3865
branch
5 times, most recently
from
July 26, 2026 19:44
6299357 to
58e0fdf
Compare
CompleteDotTech
force-pushed
the
agent/openclaw-gateway-tool-activity-3865
branch
from
July 26, 2026 20:32
a296e1e to
f55039c
Compare
CompleteDotTech
marked this pull request as ready for review
July 26, 2026 21:07
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.
DO NOT MERGE - INCOMPLETE DRAFT
Scope and pinned compatibility profile
This PR adds a chat-only, fail-closed direct OpenClaw Gateway dispatch foundation. It pins official published packages:
@openclaw/gateway-client@2026.7.2-beta.4@openclaw/gateway-protocol@2026.7.2-beta.4typebox@1.3.6The dispatcher validates published
HelloOkSchemaandChatEventSchema, exact v4 negotiation,operatorrole,operator.read/operator.write,chat.send,chat.abort,sessions.messages.subscribe, the versionedchatevent, andGATEWAY_SERVER_CAPS.CHAT_SEND_ROUTING_CONTRACT. A frame is accepted only when its exact(sessionKey, agentId, runId)matches the run returned bychat.send.Completed and evidenced
runIdis the GatewayidempotencyKey; callers without one safely retain CLI/plain-chat.chat.sendis indeterminate and never starts a replacement CLI turn; compatibility, auth, client-construction/startup, and subscription failures before dispatch retain fallback.chat.abort; late terminal frames cannot overwrite cancelled state.OPENCLAW_GATEWAY_*settings and Vault/allow-list restoration paths.Deliberate security boundary / unresolved acceptance criteria
This PR does not complete #3865 and must remain a draft.
2026.7.2-beta.4protocol tarball contains no versionedsession.toolevent/payload validator. Cave ignores tool-shaped frames and emits no Gateway tool cards.GatewayClientHostDepsrequires host-owned identity creation, challenge signing, and token load/store/rotation/clear. The direct path therefore fails closed before client construction; Gateway env tokens, passwords, bootstrap/device tokens, private keys, and signing values cannot activate it.No plaintext credential storage,
.envactivation, unencrypted config, or credential logging is added. CLI/plain-chat remains the fallback.Review, CI, and local validation
58e0fdf68fee448ac7444670e2ad32c27f355eabdrops them because they lack transport-generation provenance. Commitf55039c938a28aaa2b223a9a9a34d8f61e76221badditionally converts synchronous Gateway construction/start failures into pre-dispatch unavailability, stops a partially started client, and retains CLI fallback.origin/main@147809878f3fc29d691323421c9bb9ab2cc9e59c; branch head isf55039c938a28aaa2b223a9a9a34d8f61e76221b.pnpm check:tests-wired(1254),pnpm exec tsc --noEmit --pretty false,pnpm lint, andgit diff --check.pnpm test:apireaches a native-Windows failure in unchangedscripts/dev-app-teardown.test.mjsbefore affected tests: fake dev-server bind timeout (branch port 58033). Currentorigin/main@147809878f3fc29d691323421c9bb9ab2cc9e59cfails in the same unchanged test after a frozen install (Windows EPERM removing its temporary fixture), so it is not attributable.30217506119(including Frontend full app/API/mobile/build, E2E, cross-environment, Rust, and sidecar jobs) and CodeQL30217506126passed for58e0fdf68fee448ac7444670e2ad32c27f355eab. The rebase cancelled the prior in-flight run; fresh CI is queued forf55039c938a28aaa2b223a9a9a34d8f61e76221b.Keep this PR draft and do not close #3865 until both external blockers are resolved.