Skip to content

fix(protocol): preserve gateway session attribution across node runs - #116792

Merged
vincentkoc merged 2 commits into
mainfrom
stack/passport-wiring-1-node-contract
Aug 7, 2026
Merged

fix(protocol): preserve gateway session attribution across node runs#116792
vincentkoc merged 2 commits into
mainfrom
stack/passport-wiring-1-node-contract

Conversation

@vincentkoc

@vincentkoc vincentkoc commented Jul 31, 2026

Copy link
Copy Markdown
Member

Related: #116528, #117034

Stack: 1 of 5. Next: #116793

What Problem This Solves

Node-invoked agent runs could lose the gateway-admitted session identity, especially across mixed gateway/node versions and reconnects.

Why This Change Was Made

Adds an additive, connection-negotiated node invocation envelope with value/null/omitted semantics. The gateway remains authoritative: nested node parameters cannot mint or replace attribution.

Relationship To Execution Identity Inspection

#117034 owns opt-in persisted execution-identity inspection under logging.audit.executionIdentity. This stack does not duplicate that config or public schema. PR1 only transports the gateway-owned session decision across node boundaries so later layers can build immutable private runtime attribution.

Native Windows companion: openclaw/openclaw-windows-node#1072

User Impact

Node-hosted runs preserve or explicitly clear the same admitted session identity as local runs. There is no new config, environment variable, credential shape, prompt field, model schema, or plugin SDK surface.

Evidence

  • Exact head: 6d37e1e9291, rebased conflict-free on f5add8197fa.
  • Patch-equivalent stack-focused proof: 1,005 tests across 10 shards, including the full gateway agent suite; all passed.
  • Mixed-version value/null/omitted, gateway overwrite, nested forgery, reconnect, immediate post-negotiation delivery, and receipt retry coverage is included.
  • Final-head native inventory verification is clean; the generated baseline now tracks the moved Android conditional exactly.
  • Final-head protocol, gateway registry, and node-host proof: 133 tests passed.
  • Final-head native protocol guard verifies the node floor in GatewayChannelSupport.swift and the role-specific connect payload in GatewayChannel.swift.
  • Patch-equivalent Testbox proof passed Plugin SDK API, all TSGo lanes, full build, and SDK surface gates: tbx_01kzahyvd5rjn6v83ebxrc5369, Actions 31068629967.
  • Core, extension, and script lint passed in isolated Testbox lanes on the preceding patch-identical stack; exact-head native checks remain owned by GitHub CI.

ClawSweeper Resolution

  • Gateway admission is the sole authority; negotiated null clears attribution; legacy omission preserves mixed-version compatibility.
  • Plugin-policy and node-registry paths canonicalize nested sessionKey and systemRunPlan.sessionKey so forged nested values cannot replace the gateway session.
  • Tests cover negotiated value/null/forgery, legacy object/scalar/unattributed commands, reconnects, and retry behavior.

AI-assisted: yes; implementation, review decisions, and verification are maintainer-directed.

@openclaw-barnacle openclaw-barnacle Bot added app: android App: android app: web-ui App: web-ui gateway Gateway runtime agents Agent runtime and tooling size: M maintainer Maintainer-authored PR labels Jul 31, 2026
@clawsweeper clawsweeper Bot added rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. P2 Normal backlog priority with limited blast radius. merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. merge-risk: 🚨 security-boundary 🚨 May affect sandboxing, authorization, credentials, or sensitive data. labels Jul 31, 2026
@clawsweeper

clawsweeper Bot commented Jul 31, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed August 6, 2026, 7:32 PM ET / 23:32 UTC.

ClawSweeper review

What this changes

Adds a connection-negotiated session-key envelope so gateway-admitted session attribution survives node invocations while legacy nodes retain compatible omission behavior.

Merge readiness

⚠️ Ready for maintainer review - 3 items remain

Keep open: current main still lacks the tri-state node session envelope, and the proposed gateway-owned boundary is appropriate. No actionable defect was established from the supplied patch, but exact-head blobs could not be hydrated locally; normal maintainer source/merge review remains needed. Likely related people: vincentkoc (medium confidence).

Priority: P1
Reviewed head: 6d37e1e92913e20fcffaa1d516b60d3560df501c

Review scores

Measure Result What it means
Overall readiness 🦐 gold shrimp (3/6) The design and supplied coverage are promising, but inaccessible exact-head source prevents a higher-confidence patch rating.
Proof confidence 🌊 off-meta tidepool Not applicable: This MEMBER-authored PR is not subject to the external-contributor proof gate; available CI and transport/process tests are useful but are not claimed as live proof.
Patch quality 🦐 gold shrimp (3/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Not applicable Not applicable: This MEMBER-authored PR is not subject to the external-contributor proof gate; available CI and transport/process tests are useful but are not claimed as live proof.
Evidence reviewed 5 items Current-main gap: Current main has no session-key field in the node invocation event schema; the registry only forwards a truthy top-level key and node-host coercion does not preserve an envelope.
Owner-boundary call path: Gateway node invocation reaches plugin policy before registry dispatch, so the admitted session decision must be carried at this boundary rather than trusted from nested command parameters.
Proposed repair shape: The supplied exact-head patch negotiates the feature per connection, sends explicit null only to capable nodes, and overwrites nested session fields from gateway admission.
Findings None None.
Security None None.

How this fits together

Gateway admission sends commands to connected node hosts. This change carries the admission-owned session decision through the node protocol into Android and macOS execution paths without allowing command parameters to redefine it.

flowchart LR
  A[Gateway command request] --> B[Gateway admission]
  B --> C[Connection feature negotiation]
  C --> D[Node invocation envelope]
  D --> E[Android or macOS node host]
  E --> F[Session-attributed execution]
Loading

Before merge

  • Resolve merge risk (P1) - The partial clone cannot hydrate exact-head file blobs because its promisor fetch fails DNS resolution, so the final source and generated native outputs were not independently read from the PR commit.
  • Resolve merge risk (P1) - The additive node wire contract relies on preserving omitted, null, and value semantics during mixed-version upgrades; current review should refresh against the actual merge tree before landing.
  • Complete next step (P2) - A maintainer should refresh exact-head source and merge-tree review; the protected maintainer-owned stack should not be auto-closed or sent to repair.
Agent review details

Security

None.

PR surface

Source +280, Tests +1038, Docs +1, Other +1865. Total +3184 across 56 files.

View PR surface stats
Area Files Added Removed Net
Source 15 303 23 +280
Tests 16 1057 19 +1038
Docs 1 1 0 +1
Config 0 0 0 0
Generated 0 0 0 0
Other 24 2438 573 +1865
Total 56 3799 615 +3184

Review metrics

None.

Stored data model

Persistent data-model change detected: serialized state: packages/gateway-protocol/src/schema/nodes.test.ts, serialized state: src/gateway/node-registry.test.ts, serialized state: src/node-host/invoke.test.ts. Confirm migration or upgrade compatibility proof before merge.

Root-cause cluster

Relationship: fixed_by_candidate
Canonical: #116528
Summary: This is the first implementation layer for the broader execution-attribution work tracked by the canonical issue.

Members:

Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything.

Merge-risk options

Maintainer options:

  1. Refresh exact-head transport review (recommended)
    Hydrate the PR head and clean merge tree, then verify value, explicit-null, and legacy omission at the gateway-to-node boundary before merge.
  2. Pause the stack
    Pause this first stack layer if the exact-head transport contract cannot be rechecked against the current merge result.
Copy recommended automerge instruction
@clawsweeper automerge

Special instructions:
Verify the hydrated merge tree preserves negotiated value/null/omitted session-envelope behavior across gateway, node host, Android, and macOS paths.

Technical review

Best possible solution:

Retain one gateway-owned negotiated envelope, then hydrate and review the exact merge tree before landing this first stack layer.

Do we have a high-confidence way to reproduce the issue?

Yes, from source: current main lacks the node-envelope schema and drops the explicit-null distinction across registry and node-host paths.

Is this the best way to solve the issue?

Unclear: the proposed gateway-owned negotiated envelope is the right repair location, but the complete exact-head implementation could not be independently read from this partial clone.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning high; reviewed against d64f5b6a0960.

Labels

Label justifications:

  • P1: The PR fixes session attribution for node-invoked agent runs, a broken agent workflow with real routing impact.
  • merge-risk: 🚨 compatibility: Mixed gateway/node versions must preserve legacy omission while newer nodes distinguish explicit clearing.
  • merge-risk: 🚨 session-state: A malformed or lost envelope can associate node work with the wrong session or fail to clear attribution.
  • merge-risk: 🚨 security-boundary: The gateway must remain the sole authority over session attribution and reject nested forged values.
  • rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🌊 off-meta tidepool and patch quality is 🦐 gold shrimp.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Not applicable: This MEMBER-authored PR is not subject to the external-contributor proof gate; available CI and transport/process tests are useful but are not claimed as live proof.

Evidence

What I checked:

  • Current-main gap: Current main has no session-key field in the node invocation event schema; the registry only forwards a truthy top-level key and node-host coercion does not preserve an envelope. (packages/gateway-protocol/src/schema/nodes.ts:228, d64f5b6a0960)
  • Owner-boundary call path: Gateway node invocation reaches plugin policy before registry dispatch, so the admitted session decision must be carried at this boundary rather than trusted from nested command parameters. (src/gateway/server-methods/nodes.invoke.ts:460, d64f5b6a0960)
  • Proposed repair shape: The supplied exact-head patch negotiates the feature per connection, sends explicit null only to capable nodes, and overwrites nested session fields from gateway admission. (src/gateway/node-registry.ts:144, 6d37e1e92913)
  • Implementation provenance: The implementation commit is the PR’s main code commit; current-main blame also associates the adjacent node-registry surface with vincentkoc. (src/gateway/node-registry.ts:1141, b15a450ee54d)
  • Main and release status: The PR head is not an ancestor of current main and no local release tag contains it; this work is neither implemented on main nor shipped. (6d37e1e92913)

Likely related people:

  • vincentkoc: Authored the two PR commits and is associated with the current node-registry transport surface in available history. (role: recent area contributor; confidence: medium; commits: b15a450ee54d, 6d37e1e92913; files: src/gateway/node-registry.ts, src/node-host/runner.ts)
  • Peter Steinberger: Sampled shared native gateway history indicates mixed ownership around the macOS transport boundary. (role: adjacent shared-runtime contributor; confidence: low; files: apps/shared/OpenClawKit/Sources/OpenClawKit/GatewayNodeSession.swift, apps/macos/Sources/OpenClaw/NodeMode/MacNodeHostWorker.swift)

Rank-up moves

Optional improvements that raise the rating; they are not merge blockers.

  • Hydrate the exact PR head and verify the final merge tree against the reviewed protocol and native boundaries.

Rating scale

Score Internal tier Crab rank Meaning
6/6 S 🦀 challenger crab Exceptional readiness
5/6 A 🦞 diamond lobster Very strong readiness
4/6 B 🐚 platinum hermit Good normal PR; ordinary maintainer review
3/6 C 🦐 gold shrimp Useful, but confidence is limited
2/6 D 🦪 silver shellfish Proof or implementation needs work
1/6 F 🧂 unranked krab Not merge-ready
N/A NA 🌊 off-meta tidepool Rating does not apply

Overall follows the weaker of proof and patch quality.
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics.

Workflow

  • ClawSweeper keeps one durable marker-backed review comment per issue or PR.
  • Re-runs edit this comment so the latest verdict, findings, and automation markers stay together instead of adding duplicate bot comments.
  • A fresh review can be triggered by eligible @clawsweeper re-review comments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.
  • PR/issue authors and users with repository write access can comment @clawsweeper re-review or @clawsweeper re-run on an open PR or issue to request a fresh review only.
  • Maintainers can also comment @clawsweeper review to request a fresh review only.
  • Fresh-review commands do not start repair, autofix, rebase, CI repair, or automerge.
  • Maintainer-only repair and merge flows require explicit commands such as @clawsweeper autofix, @clawsweeper automerge, @clawsweeper fix ci, or @clawsweeper address review.
  • Maintainers can comment @clawsweeper explain to ask for more context, or @clawsweeper stop to stop active automation.

History

Review history (33 earlier review cycles; latest 8 shown)
  • reviewed 2026-08-05T21:33:03.486Z sha 946d642 :: needs maintainer review before merge. :: none
  • reviewed 2026-08-05T22:51:28.628Z sha bbb5007 :: needs maintainer review before merge. :: none
  • reviewed 2026-08-06T00:30:54.489Z sha bbb5007 :: found issues before merge. :: [P1] Preserve attribution through plugin-policy dispatch
  • reviewed 2026-08-06T04:42:47.783Z sha 5d2c38b :: needs maintainer review before merge. :: none
  • reviewed 2026-08-06T05:33:21.646Z sha 5d2c38b :: needs maintainer review before merge. :: none
  • reviewed 2026-08-06T07:33:52.047Z sha 5d2c38b :: needs maintainer review before merge. :: none
  • reviewed 2026-08-06T14:32:08.629Z sha 6d37e1e :: needs maintainer review before merge. :: none
  • reviewed 2026-08-06T19:48:36.846Z sha 6d37e1e :: needs maintainer review before merge. :: none

@vincentkoc vincentkoc self-assigned this Jul 31, 2026
@vincentkoc
vincentkoc force-pushed the stack/passport-wiring-1-node-contract branch from d87d45f to 9e6a468 Compare July 31, 2026 16:48
@vincentkoc

Copy link
Copy Markdown
Member Author

@clawsweeper re-review

Maintainer decision and comment resolution for head 9e6a4684d3eaaa55cadcb34e4bb31ca966271710:

  • Approved internal authority boundary: gateway admission is the sole source of session attribution. Nodes may transport and normalize execution details, but cannot originate, replace, or redefine attribution. Node-prepared nested values are overwritten by the gateway envelope, and are cleared when the gateway has no attribution (src/agents/bash-tools.exec-host-node-phases.ts, src/agents/bash-tools.exec-host-node.test.ts, src/node-host/invoke.test.ts).
  • Approved mixed-version contract: unnegotiated/legacy connections omit the unattributed envelope; negotiated connections receive explicit null; only the exact unsupported-method response falls back to legacy behavior. Feature state is connection-scoped, stale connections cannot negotiate for replacements, and reconnect resets negotiation (src/gateway/node-registry.test.ts, src/node-host/runner.test.ts, src/node-host/invoke-payload.test.ts).
  • Attribution remains internal transport metadata, not caller authority or model/plugin input. Public forged ingress is discarded and public/plugin/model/event serialization guardrails remain green (src/agents/agent-command.live-model-switch.test.ts, src/agents/agent-execution-attribution-architecture.guardrail.test.ts, src/infra/agent-events.test.ts).
  • Stack rebased onto current origin/main 184c13d01ced6d89fd4f166564f6fa2c2dd43a87. Blacksmith Testbox tbx_01kywezf1332f9h509vkk2rycb / Actions 30645929540: focused 24-file matrix passed all 11 Vitest shards; full pnpm check:changed passed; full pnpm build passed.

The five PRs remain intentionally ordered and should be reviewed/landed 1 through 5.

@clawsweeper

clawsweeper Bot commented Jul 31, 2026

Copy link
Copy Markdown
Contributor

🦞🧹
ClawSweeper re-review requested.

I asked ClawSweeper to review this item again.
Action: item re-review queued (workflow sweep.yml, event repository_dispatch).
Result: when the review finishes, ClawSweeper will create the durable review comment if needed or update the existing comment in place.

Re-review progress:

@clawsweeper clawsweeper Bot added rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. and removed rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. merge-risk: 🚨 security-boundary 🚨 May affect sandboxing, authorization, credentials, or sensitive data. labels Jul 31, 2026
@vincentkoc
vincentkoc force-pushed the stack/passport-wiring-1-node-contract branch from 9e6a468 to 45dd17e Compare July 31, 2026 17:17
@clawsweeper clawsweeper Bot added P1 High-priority user-facing bug, regression, or broken workflow. merge-risk: 🚨 security-boundary 🚨 May affect sandboxing, authorization, credentials, or sensitive data. and removed P2 Normal backlog priority with limited blast radius. labels Jul 31, 2026
@vincentkoc

Copy link
Copy Markdown
Member Author

@clawsweeper re-review

Exact head: 153d564cd2a4e848ddcb8d70b00269e9969a555d.

The prior durable review found no defect but was incomplete because exact-head TypeScript and Swift blobs/checks were unavailable. Those sources are now retrievable, including src/node-host/runner.ts, src/node-host/invoke.ts, apps/macos/Sources/OpenClaw/NodeMode/MacNodeHostWorker.swift, apps/shared/OpenClawKit/Sources/OpenClawKit/GatewayNodeSession.swift, and the generated protocol model/tests. Current exact-head status is 96 passing checks, zero pending, zero failing, and GitHub reports the PR mergeable.

Please refresh the compatibility/security review against the accessible exact head and replace the stale missing-source decision gap.

@clawsweeper

clawsweeper Bot commented Aug 4, 2026

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper assist is taking a look at your question.

I queued a lightweight read-only assist pass. It will post a separate answer comment and will not edit the durable ClawSweeper review comment or trigger close, merge, repair, label, or branch changes.

Request: re-review\n\nFinal exact-head refresh at f258afd after CI identified and we fixed the generated native i18n inventory offsets. Runtime changes are unchanged; pnpm native:i18n:verify is clean on the full stack.

@vincentkoc

Copy link
Copy Markdown
Member Author

Maintainer exact-head source audit completed for the ClawSweeper environment gap; no actionable defect found.

Reviewed 153d564cd2a4e848ddcb8d70b00269e9969a555d:

  • packages/gateway-protocol/src/schema/nodes.ts:132-161 and :240-250 define the additive negotiated feature and the value/null/omitted wire contract.
  • src/gateway/node-registry.ts:1165-1179 sends non-empty attribution to every node, sends null only after feature negotiation, and otherwise preserves legacy omission.
  • src/node-host/invoke.ts:136-156 makes the Gateway envelope authoritative over nested caller-controlled sessionKey and systemRunPlan; src/node-host/runner.ts:350-375 charges negotiation time against the invoke deadline.
  • apps/shared/OpenClawKit/Sources/OpenClawKit/BridgeFrames.swift:3-12, GatewayNodeSession.swift:1313-1347 and :1426-1433, plus apps/macos/Sources/OpenClaw/NodeMode/MacNodeHostWorker.swift:120-149 preserve value/null/legacy through detached Swift hops and worker serialization.
  • apps/android/app/src/main/java/ai/openclaw/app/gateway/GatewaySession.kt:1788-1848 and apps/android/app/src/main/java/ai/openclaw/app/node/InvokeDispatcher.kt:25-41 and :124-134 preserve the same contract through coroutine context.

Exact-head coverage includes protocol validation, Gateway negotiation, nested forgery replacement, deadline charging, Swift value/null/omission forwarding, and Android value/null/omission dispatch. Hosted status remains 96 passing checks, zero pending, zero failing.

@vincentkoc

Copy link
Copy Markdown
Member Author

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Aug 5, 2026

Copy link
Copy Markdown
Contributor

🦞🧹
ClawSweeper re-review requested.

I asked ClawSweeper to review this item again.
Action: item re-review queued (workflow sweep.yml, event repository_dispatch).
Result: when the review finishes, ClawSweeper will create the durable review comment if needed or update the existing comment in place.

Re-review progress:

@vincentkoc

Copy link
Copy Markdown
Member Author

@clawsweeper re-review

Exact-head refresh for 946d642d63ac98693f0cf6bb7f2f3619349bac29.

Prior findings and rank-up moves are resolved:

  • maintainer approval is recorded for the permanent value/null/omitted mixed-version contract and gateway-only authority boundary;
  • nested forgery and gateway overwrite coverage remains;
  • immediate post-negotiation delivery, negotiation generation, and pre-dispatch timeout retry races are fixed;
  • final branch-wide P2 autoreview is clean;
  • exact-head pnpm check:changed passed on Testbox tbx_01kz9v9zhgwx0a062vrygp34nr / Actions 31046308734.

Please review this head against #117034 as the transport-only first layer of the private attribution stack.

@clawsweeper

clawsweeper Bot commented Aug 5, 2026

Copy link
Copy Markdown
Contributor

🦞🧹
ClawSweeper re-review requested.

I asked ClawSweeper to review this item again.
Action: item re-review queued (workflow sweep.yml, event repository_dispatch).
Result: when the review finishes, ClawSweeper will create the durable review comment if needed or update the existing comment in place.

Re-review progress:

@vincentkoc

Copy link
Copy Markdown
Member Author

@clawsweeper re-review

Current head: bbb50076516a954756458ac668b1c29d34f41361. Prior rank-up moves are addressed: mixed-version value/null/omitted authority is documented and maintainer-owned; gateway overwrite/forgery coverage remains; stage SDK/native baselines pass; Swift file-length lint is fixed; exact-checkout changed gate passed on Testbox tbx_01kz9y079pbyycn2x3ypaw5rk7.

@clawsweeper

clawsweeper Bot commented Aug 5, 2026

Copy link
Copy Markdown
Contributor

🦞🧹
ClawSweeper re-review requested.

I asked ClawSweeper to review this item again.
Action: item re-review queued (workflow sweep.yml, event repository_dispatch).
Result: when the review finishes, ClawSweeper will create the durable review comment if needed or update the existing comment in place.

Re-review progress:

@vincentkoc

Copy link
Copy Markdown
Member Author

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Aug 6, 2026

Copy link
Copy Markdown
Contributor

🦞🧹
ClawSweeper re-review requested.

I asked ClawSweeper to review this item again.
Action: item re-review queued (workflow sweep.yml, event repository_dispatch).
Result: when the review finishes, ClawSweeper will create the durable review comment if needed or update the existing comment in place.

Re-review progress:

@vincentkoc

Copy link
Copy Markdown
Member Author

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Aug 6, 2026

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

Command router queued. I will update this comment with the next step.

@vincentkoc

Copy link
Copy Markdown
Member Author

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Aug 6, 2026

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

Command router queued. I will update this comment with the next step.

@vincentkoc

Copy link
Copy Markdown
Member Author

@clawsweeper re-review

Exact reviewed head requested: 5d2c38b89fe69e6d386a3d6fe8fcd0a679cb8799. Please include findings, before-merge blockers, and rank-up moves against this SHA.

@clawsweeper

clawsweeper Bot commented Aug 6, 2026

Copy link
Copy Markdown
Contributor

🦞🧹
ClawSweeper re-review requested.

I asked ClawSweeper to review this item again.
Action: item re-review queued (workflow sweep.yml, event repository_dispatch).
Result: when the review finishes, ClawSweeper will create the durable review comment if needed or update the existing comment in place.

Re-review progress:

@vincentkoc

Copy link
Copy Markdown
Member Author

@clawsweeper re-review

Exact reviewed head remains 5d2c38b89fe69e6d386a3d6fe8fcd0a679cb8799.

The native detached-task proof gap is resolved by exact-head source and existing tests:

  • apps/shared/OpenClawKit/Sources/OpenClawKit/GatewayNodeSession.swift:1371-1383 captures the immutable envelope and explicitly rebinds it inside the final route-owned callback after detached timeout/receipt hops.
  • apps/shared/OpenClawKit/Tests/OpenClawKitTests/GatewayNodeSessionTests.swift:2457-2511 drives real node invoke requests with a nonzero 1000 ms timeout and proves authoritative value and explicit null survive detached dispatch.
  • apps/macos/Sources/OpenClaw/NodeMode/MacNodeHostWorker.swift:120-153 snapshots the rebound TaskLocal before crossing its DispatchQueue and serializes value/null/omitted correctly.
  • apps/macos/Tests/OpenClawIPCTests/MacNodeHostWorkerTests.swift:241-279 starts the real worker process and proves value, explicit null, and legacy omission reach its JSONL invocation frame.
  • Exact-head GitHub CI already passed the native Swift lanes; the branch is mergeable and the stack has no changed-file overlap with the then-current main refresh.

This composes the requested GatewayNodeSession-to-MacNodeHostWorker boundary without adding duplicate coverage. Please refresh findings, before-merge blockers, and rank-up moves against this SHA.

@clawsweeper

clawsweeper Bot commented Aug 6, 2026

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

Command router queued. I will update this comment with the next step.

@vincentkoc

Copy link
Copy Markdown
Member Author

@clawsweeper re-review exact head 5d2c38b after the prior lease expired. The requested nonzero-timeout macOS value/null/legacy boundary proof is at GatewayNodeSession.swift:1371-1383, GatewayNodeSessionTests.swift:2457-2511, MacNodeHostWorker.swift:120-153, and MacNodeHostWorkerTests.swift:241-279. Current main merge-tree is clean. Please publish a fresh durable review and reassess the prior rank-up moves.

@vincentkoc

Copy link
Copy Markdown
Member Author

Maintainer disposition for the current ClawSweeper rank-up moves at exact head 5d2c38b89fe69e6d386a3d6fe8fcd0a679cb8799:

  • The exact PR source is available and was inspected from the hydrated linked worktree, including the mixed-version native node paths (apps/shared/OpenClawKit/Sources/OpenClawKit/GatewayNodeSession.swift:1371, apps/macos/Sources/OpenClaw/NodeMode/MacNodeHostWorker.swift:120, and their focused tests).
  • Against current origin/main 874c63318b590a3567a49d36066d79d211f8be08, the full five-layer stack has a conflict-free merge tree 24d3619983c9f212b5d74e97b676f607f9867445.
  • A disposable linked worktree at that synthetic merge passed 160 focused tests across four Vitest shards. native:i18n:verify also passed with 5,393 entries and changed=false.
  • The branch remains intentionally unrebased because the current merge result is clean; another mechanical restack would only invalidate exact-head reviews while main continues moving.

The remaining item is normal maintainer acceptance of the negotiated protocol contract, not unresolved author work or a code defect.

@vincentkoc

Copy link
Copy Markdown
Member Author

Maintainer decision: accepted.

The authenticated operator.write nodes.invoke request is the intended gateway command-admission boundary for this transport. Its normalized top-level sessionKey is authoritative correlation for the admitted invoke; nested command params cannot replace it. For negotiated nodes, the gateway owns the explicit-null clear when no admitted session exists (src/gateway/server-methods/nodes.invoke.ts:583, src/gateway/node-registry.ts:1193, packages/gateway-protocol/src/schema/nodes.ts:240). This preserves the existing privilege boundary while preventing nested attribution forgery.

I also completed exact-head local source review; the earlier ClawSweeper hydration gap is not a remaining maintainer blocker.

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Aug 6, 2026

Copy link
Copy Markdown
Contributor

🦞🧹
ClawSweeper re-review requested.

I asked ClawSweeper to review this item again.
Action: item re-review queued (workflow sweep.yml, event repository_dispatch).
Result: when the review finishes, ClawSweeper will create the durable review comment if needed or update the existing comment in place.

Re-review progress:

@vincentkoc

Copy link
Copy Markdown
Member Author

@clawsweeper re-review

@vincentkoc

Copy link
Copy Markdown
Member Author

Merged via rebase.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agents Agent runtime and tooling app: android App: android app: macos App: macos app: web-ui App: web-ui gateway Gateway runtime maintainer Maintainer-authored PR merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. merge-risk: 🚨 security-boundary 🚨 May affect sandboxing, authorization, credentials, or sensitive data. merge-risk: 🚨 session-state 🚨 May lose, corrupt, stale, or mis-associate session, agent, or context state. P1 High-priority user-facing bug, regression, or broken workflow. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. scripts Repository scripts size: XL status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant