Skip to content

fix(gateway): keep N-1 nodes manageable during upgrades#101109

Merged
steipete merged 2 commits into
mainfrom
codex/android-protocol-skew
Jul 6, 2026
Merged

fix(gateway): keep N-1 nodes manageable during upgrades#101109
steipete merged 2 commits into
mainfrom
codex/android-protocol-skew

Conversation

@steipete

@steipete steipete commented Jul 6, 2026

Copy link
Copy Markdown
Contributor

Closes #83736

AI-assisted: yes

What Problem This Solves

Fixes an issue where staged Gateway upgrades could strand subordinate nodes when the node still spoke the immediately previous Gateway protocol. The Gateway rejected those nodes before pairing, status, update, restart, or other approved maintenance paths became available.

Why This Change Was Made

The Gateway now accepts an exact N-1 window for authenticated role: "node" / client.mode: "node" clients and lightweight probes, while operator and UI clients remain pinned to the current protocol. Device authentication, pairing, scopes, node command policy, and exec approvals remain mandatory. Because protocol v3 predates plugin-hosted surfaces, legacy sessions hide plugin-owned capabilities and commands until upgrade; a session ceiling keeps that restriction intact across later pairing approvals without changing the durable pairing declaration.

The N-1 constants and guard force a deliberate compatibility decision at the next protocol bump. Public Gateway and node docs now define the supported window and safe upgrade order.

User Impact

Operators can upgrade a Gateway first and then upgrade protocol N-1 nodes without losing the Gateway-managed maintenance path. Nodes older than N-1 remain rejected, and N-1 nodes expose only the stable core surface until they upgrade.

Evidence

  • Blacksmith Testbox: tbx_01kww83sbts5xrapfbaebncfsj; warmup run https://github.com/openclaw/openclaw/actions/runs/28811054190
  • Post-rebase focused tests: 192 passed across 10 Gateway project shards plus 4 protocol guard tests
  • pnpm build: passed on the post-rebase exact tree
  • pnpm protocol:check: generated protocol schema and Swift models remained clean
  • pnpm check:changed: core/test typechecks, full core lint, import-cycle, database/storage, webhook, and pairing guards passed
  • Behavior contract covered: authenticated v3 node registers and is manageable; v3 probe connects; v3 operator/UI is rejected; invalid node auth is rejected; v2 node is rejected; plugin-owned features stay suppressed after pairing approval; current-capable 3–4 ranges use v4
  • Fresh autoreview after all fixes: no accepted or actionable findings

@steipete
steipete requested a review from a team as a code owner July 6, 2026 18:35
@openclaw-barnacle openclaw-barnacle Bot added docs Improvements or additions to documentation app: web-ui App: web-ui gateway Gateway runtime plugin: file-transfer size: M maintainer Maintainer-authored PR labels Jul 6, 2026
@steipete
steipete force-pushed the codex/android-protocol-skew branch from 2db2e19 to e43dc98 Compare July 6, 2026 18:39

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 2db2e19ede

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

...registry.nodeHostCommands.map((entry) => entry.pluginId),
...registry.nodeInvokePolicies.map((entry) => entry.pluginId),
]);
const pluginCaps = new Set([...params.pluginSurfaces, ...pluginIds]);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Strip node-host caps from legacy sessions

When a plugin node-host command advertises a cap that differs from the plugin id or hosted surface, this legacy filter removes the plugin commands but leaves the cap visible. For example, file-transfer registers file.* commands with cap file, so an N-1 node still advertises file in node/environment capability lists even though the corresponding commands were withheld for the session; cap-based callers and users then see an unusable plugin surface until invocation fails. Include nodeHostCommands' command.cap values in this set before filtering caps.

Useful? React with 👍 / 👎.

@steipete
steipete force-pushed the codex/android-protocol-skew branch from e43dc98 to a407227 Compare July 6, 2026 18:44
@steipete

steipete commented Jul 6, 2026

Copy link
Copy Markdown
Contributor Author

Land-ready on exact head a40722704e6f51b93ee41c05b64479f67226ba3f.

What was verified:

  • Exact-head CI passed: https://github.com/openclaw/openclaw/actions/runs/28815078145
  • Blacksmith Testbox tbx_01kww83sbts5xrapfbaebncfsj: 192 Gateway tests across 10 project shards plus 4 protocol guard tests passed on the final head.
  • pnpm build passed after the protocol implementation rebase; the exact-head hosted build-artifacts job also passed.
  • pnpm protocol:check passed on the final head.
  • Full docs gate passed after refreshing docs/docs_map.md: 682 formatting inputs clean, 698 MDX files valid, 5,854 internal links checked with zero broken links, generated map current.
  • Exact-head QA Smoke, production/test type checks, lint, dependency/architecture/boundary guards, security scans, and all Node shards passed.
  • Behavior contract covered: authenticated v3 node registration; v3 probe; v3 operator rejection; invalid-auth rejection; v2 rejection; legacy plugin surface suppression across pairing approval; current-capable 3-4 range behavior.
  • Fresh autoreview after the implementation repairs found no accepted or actionable findings.

Known proof gaps: none.

@steipete
steipete merged commit 912af0a into main Jul 6, 2026
97 checks passed
@steipete
steipete deleted the codex/android-protocol-skew branch July 6, 2026 19:01
@steipete

steipete commented Jul 6, 2026

Copy link
Copy Markdown
Contributor Author

Merged via squash.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Jul 7, 2026
)

* fix(gateway): allow N-1 node protocol maintenance

* docs: refresh generated map for node upgrade guide
giodl73-repo pushed a commit to giodl73-repo/openclaw that referenced this pull request Jul 8, 2026
)

* fix(gateway): allow N-1 node protocol maintenance

* docs: refresh generated map for node upgrade guide
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

app: web-ui App: web-ui docs Improvements or additions to documentation gateway Gateway runtime maintainer Maintainer-authored PR plugin: file-transfer size: M

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: Gateway should tolerate minor node version skew during subordinate node upgrades

1 participant