Skip to content

refactor(gateway): share closed TypeBox objects - #106441

Merged
steipete merged 2 commits into
mainfrom
codex/share-closed-typebox-object
Jul 13, 2026
Merged

steipete merged 2 commits into
mainfrom
codex/share-closed-typebox-object

Conversation

@steipete

Copy link
Copy Markdown
Contributor

What Problem This Solves

Closes #106433.

Gateway protocol schemas repeated the exact TypeBox call for a closed object 575 times across 37 modules, leaving 1,500+ lines of duplicate policy and formatting.

Why This Change Was Made

  • Add one internal closedObject(properties) helper that delegates to TypeBox's existing Type.Object API with additionalProperties: false.
  • Mechanically migrate only exact closed-object calls.
  • Keep specialized worker const-generic helpers so their public declaration inference remains unchanged.
  • Leave open objects and objects with extra schema options on direct Type.Object calls.

User Impact

No wire, validation, or public type behavior changes. The gateway protocol implementation loses 1,549 production lines and gains one canonical closed-object construction path.

Evidence

  • Built package declarations: byte-identical SHA-256 inventory before/after.
  • 559 exported runtime schema values: byte-identical sorted JSON serialization before/after.
  • pnpm --filter @openclaw/gateway-protocol build
  • pnpm test packages/gateway-protocol/src (24 files, 206 tests)
  • Fresh structured autoreview across four bounded bundles: clean, no accepted/actionable findings.
  • git diff --check

@steipete
steipete requested a review from a team as a code owner July 13, 2026 14:06
@openclaw-barnacle openclaw-barnacle Bot added app: web-ui App: web-ui gateway Gateway runtime size: XL maintainer Maintainer-authored PR labels Jul 13, 2026
@steipete

Copy link
Copy Markdown
Contributor Author

Land-ready proof:

@steipete
steipete merged commit 76796d7 into main Jul 13, 2026
103 checks passed
@steipete
steipete deleted the codex/share-closed-typebox-object branch July 13, 2026 14:22
@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

app: web-ui App: web-ui gateway Gateway runtime maintainer Maintainer-authored PR size: XL

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Reduce gateway TypeBox closed-object duplication

1 participant