Repository navigation
fix: restore protocol declaration builds - #135360
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. |
|
Codex review: needs maintainer review before merge. Reviewed September 1, 2026, 12:56 PM ET / 16:56 UTC. ClawSweeper reviewWhat this changesThe PR explicitly types the public Gateway protocol schema registry and updates its structural guard to verify that the annotation exactly matches the ordered runtime fragments. Merge readinessKeep open. The patch preserves the registry’s runtime composition while naming its exact fragment intersection for declaration emission; no concrete correctness or security defect was found. This is a member-authored, maintainer-labeled PR, so automated closure is not appropriate. Priority: P2 Review scores
Verification
How this fits togetherGateway protocol fragments form one registry consumed by declaration generation and native/schema generators. The registry guard validates its fixed composition before generated protocol artifacts are checked. flowchart LR
A[Protocol schema fragments] --> B[Public schema registry]
B --> C[Declaration build]
B --> D[Registry consistency guard]
B --> E[Schema and native generators]
D --> F[Protocol check pipeline]
Before merge
Agent review detailsSecurityNone. PR surfaceSource +16, Other +11. Total +27 across 2 files. View PR surface stats
Review metrics
Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Merge the explicit exact-intersection annotation with its paired guard, retaining the composer as the sole runtime composition owner and the existing protocol-check pipeline as the regression boundary. Do we have a high-confidence way to reproduce the issue? No direct reproduction was run because this read-only review prohibits builds. The PR evidence reports TS7056 before the change, and current source confirms the public declaration-emitting registry path. Is this the best way to solve the issue? Yes. The annotation preserves the composer’s exact intersection rather than widening the public registry, and the updated guard prevents its type list from drifting from runtime composition. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 83e75f5e3101. LabelsLabel changes:
Label justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
|
|
Merged via squash.
|
* fix(build): preserve protocol schema references in declarations * build: validate typed protocol registry fragments
* fix(build): preserve protocol schema references in declarations * build: validate typed protocol registry fragments
Replay onto current origin/main. Take main generated metadata, then pnpm config:channels:gen. Keep ReplyToModeSchema.optional(). Skip protocol restore already on main via openclaw#135360. Signed-off-by: Sebastien Tardif <[email protected]>
What Problem This Solves
Resolves a problem where developers building OpenClaw from current source encounter TS7056 during protocol declaration generation and cannot complete the build.
Why This Change Was Made
The public protocol registry's inferred type exceeds TypeScript's declaration serialization limit. Annotate that export with the exact intersection of its existing named fragment types. The composer remains the runtime owner, with identical fragment order, schema objects, and duplicate-key rejection.
Update the existing registry guard to recognize the annotated declaration and require its type fragments to match the composed fragments in order. This also prevents future edits from silently narrowing the exported registry type. No new parser or runtime path is introduced.
User Impact
Source builds complete while preserving the registry's closed keys and exact property types. There are no wire-schema, protocol-version, configuration, or persistence changes.
Evidence
pnpm buildpass. The guard-only follow-up was then checked through the completepnpm protocol:checkpipeline; Swift and Kotlin generated sources remain unchanged.Production declaration source: +16 lines. Tooling: +11 lines. Tests/generated files: unchanged. The named type boundary preserves precise public types without widening them to an open record. This is a build repair; no memory or latency improvement is claimed.
The review's coupling concern is addressed by landing the exact annotation and its matching guard together. The existing required protocol-check pipeline enforces that correspondence; the ten actual CLI fixtures cover drift and malformed declarations. The composer remains the sole runtime owner. Exact-head CI is now green.