Repository navigation
fix(gateway): prevent mismatched core command payload types - #130241
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. |
|
Codex review: needs maintainer review before merge. Reviewed August 26, 2026, 1:46 PM ET / 17:46 UTC. ClawSweeper reviewWhat this changesAdds a schema-derived payload map and shared validator adapter for 19 selected core Gateway RPC handlers, replacing local post-validation payload casts. Merge readinessKeep open for maintainer-led landing: the PR introduces a coherent typed validation boundary not present on current main, but its closing reference would resolve a broader architecture issue while many core handlers remain outside this migration. Priority: P3 Review scores
Verification
Live VerificationCommand: Result: FAIL (partial) — step 2 Assertions:
How this fits togetherGateway RPC requests are authorized and dispatched through an open registry whose handlers receive generic request records. The new adapter validates selected core requests against protocol schemas before passing a statically typed payload to their handlers, while plugin methods remain dynamically registered. flowchart LR
A[Gateway RPC request] --> B[Authorization and dispatch]
B --> C[Open method registry]
C --> D[Core schema validator]
D --> E[Typed core handler]
C --> F[Dynamic plugin handler]
E --> G[Gateway response]
F --> G
Decision needed
Why: The patch is technically coherent for its selected methods, but only maintainers can decide whether that subset satisfies the architecture issue's intended scope. Before merge
Agent review detailsSecurityNone. PR surfaceSource +14, Tests +76, Other -4. Total +86 across 12 files. View PR surface stats
Review metrics
Root-cause clusterRelationship: Members:
Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything. Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Keep this adapter as the canonical pattern for the named methods, but retain #107499 for the remaining core-handler migration unless maintainers explicitly redefine that issue's scope. Do we have a high-confidence way to reproduce the issue? Yes, at source level: current main dispatches generic payload records and selected handlers validate then cast locally, so a method-validator mismatch can evade compile-time checking. Is this the best way to solve the issue? Yes for the listed handler families: a single validator adapter binds runtime validation and static payload ownership without changing the wire contract; its scope should not silently stand in for the broader migration request. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against f498727bbdad. LabelsLabel changes:
Label justifications:
EvidenceWhat I checked:
Likely related people:
Rank-up movesOptional improvements that raise the rating; they are not merge blockers.
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
|
|
Maintainer decision on the review's rank-up move: this PR should close #107499. It establishes the requested canonical schema-derived core-command typing boundary, rejects method/validator mismatches at compile time, and migrates 19 representative methods across board, conversations, commands, logs, portals, and UI. The public request envelope and dynamic plugin methods intentionally remain open, and agent/chat methods retain their owner-specific prevalidation and normalization ordering; converting every unrelated handler indiscriminately would weaken those contracts. Future compatible owner migrations can reuse this same canonical adapter without keeping the foundational architecture request open. The +14 production-line delta is justified by the required type-only protocol ownership map and shared adapter; the same change removes 18 grandfathered unsafe assertions. Exact-head CI passed, including the full Gateway-methods shard and the deterministic setup-admission cleanup fix. The bot's separate reported live-verification failure was its output-string assertion: its own attached terminal output shows the focused regression tests passing twice. |
|
Merged via squash.
|
…#130241) * fix(gateway): enforce schema-typed core request handlers * fix(gateway): preserve protocol and type safety guards * test(gateway): await setup admission owner settlement
Closes #107499
What Problem This Solves
Gateway core RPC handlers accepted broadly typed payload records, which let command names, validators, and handler payloads drift apart without a compile-time failure.
Why This Change Was Made
Add a type-only, schema-derived core method payload map and one canonical validated handler adapter. Migrate board, conversation, portal, command-listing, log, and UI-command methods to inferred payloads while preserving open request envelopes, dynamically registered plugin methods, existing validation order, and standard invalid-request responses. No protocol version, plugin SDK, or wire contract changes.
User Impact
Gateway and plugin behavior is unchanged; core protocol mistakes are caught during typechecking instead of being masked by unsafe assertions.
Evidence