Skip to content

fix(gateway): report unsupported node events - #123719

Merged
steipete merged 1 commit into
mainfrom
fix/gateway-unsupported-node-event
Aug 14, 2026
Merged

steipete merged 1 commit into
mainfrom
fix/gateway-unsupported-node-event

Conversation

@steipete

Copy link
Copy Markdown
Contributor

Closes #123717

What Problem This Solves

Fixes an issue where paired node clients sending an unsupported node.event received only {ok:true}, making the event look handled even though no event owner accepted it.

Why This Change Was Made

The node-event dispatcher now records the intentional non-outcome at the owner boundary by returning the existing NodeEventResult shape with handled:false and reason:"unsupported_event". Supported event branches are unchanged, and there is no protocol, schema, or version change.

User Impact

Node clients can distinguish an unsupported event from a successfully handled one instead of receiving a misleading bare acknowledgement.

Evidence

  • Pre-fix paired-node WebSocket reproduction received exactly {ok:true} and failed the new assertion for the declared structured result.
  • Post-fix isolated Gateway proof: node scripts/run-vitest.mjs src/gateway/server-node-events.test.ts src/gateway/server.roles-allowlist-update.test.ts — 85/85 passed.
  • Post-rebase changed gate: node scripts/check-changed.mjs — passed core production/test typechecks, changed lint/format, dependency, architecture, database, and repository guards. Testbox routing reported no ready provider, so the repository wrapper used its documented trusted-source local fallback.
  • Final Codex autoreview on exact head 40c4b7f1569ffb1bf7aaa4d6f7900b722350530f — clean, no actionable findings, confidence 0.99.
  • Production LOC: +1/-1 (net 0). Tests: +14/-1.

AI-assisted: yes. The implementation, tests, and proof were reviewed by the maintainer before publication.

@clawsweeper

clawsweeper Bot commented Aug 14, 2026

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

Pull request received. I will update this pull request when review starts.

@openclaw-barnacle openclaw-barnacle Bot added the gateway Gateway runtime label Aug 14, 2026
@steipete steipete self-assigned this Aug 14, 2026
@steipete
steipete marked this pull request as ready for review August 14, 2026 15:56
@openclaw-barnacle openclaw-barnacle Bot added size: XS maintainer Maintainer-authored PR labels Aug 14, 2026
@clawsweeper clawsweeper Bot added P2 Normal backlog priority with limited blast radius. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. labels Aug 14, 2026
@clawsweeper

clawsweeper Bot commented Aug 14, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed August 14, 2026, 12:01 PM ET / 16:01 UTC.

ClawSweeper review

What this changes

The PR makes unsupported paired-node node.event requests return an explicit handled: false result and verifies it through a paired Gateway client.

Merge readiness

⚠️ Ready for maintainer review - 3 items remain

Keep open. Current main still turns an unsupported node event into a bare acknowledgement; this narrow dispatcher-boundary fix returns the already-declared intentional non-outcome and has a paired-node integration assertion. The maintainer label keeps final landing with its owner after exact-head checks finish.

Priority: P2
Reviewed head: 40c4b7f1569ffb1bf7aaa4d6f7900b722350530f
Owner decision: Required. See Decision needed.

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) The narrow patch follows the existing result contract and has direct paired-node integration coverage.
Proof confidence 🌊 off-meta tidepool Not applicable: This maintainer-authored PR is exempt from the external-contributor proof gate; its body nevertheless reports a paired-node Gateway before/after run.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Not applicable Not applicable: This maintainer-authored PR is exempt from the external-contributor proof gate; its body nevertheless reports a paired-node Gateway before/after run.
Evidence reviewed 5 items Current-main defect: Current main's dispatcher default returns undefined for an unknown event, so the caller falls back to { ok: true }.
Existing response contract: The protocol already defines a normalized node-event result with event, handled, and optional reason; this change uses that existing shape without changing its schema.
Owner-boundary fix and regression coverage: The branch changes only the dispatcher's default and asserts the resulting payload through a paired-node Gateway client; the assertion would fail against current main's bare acknowledgement.
Findings None None.
Security None None.

How this fits together

Paired node clients send node.event RPCs to the Gateway, which dispatches the event and returns an RPC payload. The dispatcher now distinguishes an unsupported event from a handled or asynchronously accepted event before the response is sent back to the node.

flowchart LR
  A[Paired node client] --> B[Gateway node event RPC]
  B --> C[Node event dispatcher]
  C --> D{Recognized event}
  D -->|Yes| E[Existing event handling]
  D -->|No| F[Unsupported event result]
  E --> G[Gateway RPC response]
  F --> G
Loading

Decision needed

Question Recommendation
After exact-head checks complete, should this maintainer-labeled Gateway response correction land? Land after checks: Merge the narrow existing-contract repair once the exact PR head is green.

Why: The patch is source-correct, but the protected maintainer workflow requires an owner to make the final landing decision.

Before merge

  • Resolve merge risk (P1) - Exact-head required checks were still in progress in the supplied PR state; merge only after the normal GitHub gate is green.
  • Complete next step (P2) - No mechanical repair remains; the maintainer label and pending exact-head checks leave final landing with the Gateway owner.
Agent review details

Security

None.

PR surface

Source 0, Tests +13. Total +13 across 2 files.

View PR surface stats
Area Files Added Removed Net
Source 1 1 1 0
Tests 1 14 1 +13
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 2 15 2 +13

Review metrics

Metric Value Why it matters
Production vs test LOC production +1/-1 (net 0); tests +14/-1 (net +13) The production change is a one-line owner-boundary replacement, while the added coverage exercises the real paired-node RPC path.

Root-cause cluster

Relationship: fixed_by_candidate
Canonical: #123717
Summary: This PR is the focused candidate fix for the linked unsupported node-event acknowledgement bug.

Members:

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

Merge-risk options

Maintainer options:

  1. Decide the mitigation before merge
    Land the dispatcher-default repair after exact-head checks complete, retaining bare acknowledgements for accepted asynchronous events while reporting unsupported events explicitly.
  2. Pause or close
    Do not merge this PR until maintainers decide whether the risk is worth taking.

Technical review

Best possible solution:

Land the dispatcher-default repair after exact-head checks complete, retaining bare acknowledgements for accepted asynchronous events while reporting unsupported events explicitly.

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

Yes, from source: current main returns undefined at the dispatcher default and the RPC adapter serializes that as {ok:true}; the paired-node assertion on this branch directly captures the resulting failure.

Is this the best way to solve the issue?

Yes. Returning the explicit non-outcome at the dispatcher default is the narrowest owner-boundary fix; changing the RPC adapter could not distinguish an unsupported event from existing intentional undefined results.

AGENTS.md: found and applied where relevant.

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

Labels

Label changes:

  • add P2: This is a bounded Gateway response-correctness fix for paired node clients, without evidence of data loss, security impact, or runtime unavailability.
  • add rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🌊 off-meta tidepool and patch quality is 🐚 platinum hermit.
  • add status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Not applicable: This maintainer-authored PR is exempt from the external-contributor proof gate; its body nevertheless reports a paired-node Gateway before/after run.

Label justifications:

  • P2: This is a bounded Gateway response-correctness fix for paired node clients, without evidence of data loss, security impact, or runtime unavailability.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🌊 off-meta tidepool and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Not applicable: This maintainer-authored PR is exempt from the external-contributor proof gate; its body nevertheless reports a paired-node Gateway before/after run.

Evidence

What I checked:

  • Current-main defect: Current main's dispatcher default returns undefined for an unknown event, so the caller falls back to { ok: true }. (src/gateway/server-node-events.ts:1224, 9386ac096632)
  • Existing response contract: The protocol already defines a normalized node-event result with event, handled, and optional reason; this change uses that existing shape without changing its schema. (packages/gateway-protocol/src/schema/nodes.ts:64, 9386ac096632)
  • Owner-boundary fix and regression coverage: The branch changes only the dispatcher's default and asserts the resulting payload through a paired-node Gateway client; the assertion would fail against current main's bare acknowledgement. (src/gateway/server.roles-allowlist-update.test.ts:374, 40c4b7f1569f)
  • Feature provenance: Blame attributes the current-main default return and local result shape to the dispatcher introduction commit, providing the relevant current-owner history. (src/gateway/server-node-events.ts:1224, 37a63fbf450e)
  • Current-main and release state: The PR head is not an ancestor of either current main or the supplied latest release, so this remains an open implementation path rather than an already-landed fix. (40c4b7f1569f)

Likely related people:

  • steipete: The current dispatcher and adjacent role-enforcement test trace to this contributor's current-main commit, and this PR continues that same owner boundary. (role: current Gateway node-event owner; confidence: high; commits: 37a63fbf450e, 40c4b7f1569f; files: src/gateway/server-node-events.ts, src/gateway/server.roles-allowlist-update.test.ts)

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.

@steipete

Copy link
Copy Markdown
Contributor Author

Land-ready verification for exact head 40c4b7f1569ffb1bf7aaa4d6f7900b722350530f:

  • Paired-node Gateway regression and owner siblings: node scripts/run-vitest.mjs src/gateway/server-node-events.test.ts src/gateway/server.roles-allowlist-update.test.ts — 85/85 passed.
  • Post-rebase changed gate: node scripts/check-changed.mjs — passed all selected core/core-test type, lint, formatting, dependency, architecture, database, and guard checks. Testbox routing reported no ready provider, so the repository wrapper used its documented trusted-source local fallback.
  • Final post-rebase Codex autoreview: clean, no actionable findings, confidence 0.99.
  • Exact-head CI: run 31816922171 — openclaw/ci-gate green.
  • Production LOC: +1/-1 (net 0). Tests: +14/-1.

ClawSweeper's remaining moves are satisfied: exact-head required checks are green, and the Gateway owner has made the explicit decision to land this narrow existing-contract correction. No code, protocol/schema/version, config, auth, persistence, release, or deployment follow-up remains in this PR.

@steipete
steipete merged commit 2b31cf1 into main Aug 14, 2026
245 checks passed
@steipete
steipete deleted the fix/gateway-unsupported-node-event branch August 14, 2026 16:13
@steipete

Copy link
Copy Markdown
Contributor Author

Merged via squash.

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

Labels

gateway Gateway runtime maintainer Maintainer-authored PR P2 Normal backlog priority with limited blast radius. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. size: XS 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.

[Bug]: Gateway acknowledges unsupported node events as handled

1 participant