Repository navigation
test(gateway): keep display-consumer test support out of the prod type program - #178306
Conversation
…e program Move the replay helper under test/helpers/gateway so its Control UI imports stay outside the Node production type program. Preserve both real-Gateway tests and all display assertions. Refs a2332ca.
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review completeClawSweeper finished reviewing this revision. The review result is being finalized. |
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
Codex review: needs maintainer review before merge. What this changesThis PR moves the Gateway display-replay helper into test/helpers/gateway and updates its two test callers. Example: A developer runs pnpm tsgo:prod after the display-consumer tests were added.
Review scores
ProductKind: Maintenance · Worth it: Yes · Fix scope: Complete Regression provenancePossible regression — suspected (reviewed change). No predecessor PR is attributed. Merge readiness✅ Ready for maintainer review Keep open: this maintainer-authored PR fixes the production type-program boundary with a minimal relocation, preserves existing coverage, and has no actionable findings; broad CI remains pending. Priority: P2 Before mergeNone. FindingsNone. Agent review detailsHow this fits togetherGateway integration tests collect chat and session.message frames and replay them through existing Control UI consumers to compare displayed replies with persisted history. flowchart LR
A[Gateway integration tests] --> B[Chat and session message frames]
B --> C[Shared test replay helper]
C --> D[Existing Control UI consumers]
D --> E[Display and history assertions]
F[Core production type program] --> G[Node production sources]
Technical reviewBest possible solution: Keep the unchanged replay helper at the existing shared-test boundary without weakening compiler settings or removing display assertions. Do we have a high-confidence way to reproduce the issue? The included helper's UI imports and DOM-free compiler configuration establish the failure path, corroborated by the reported baseline diagnostics; this read-only review ran no target code. Is this the best way to solve the issue? The relocation is the smallest complete fix: it uses the existing excluded test directory, migrates every reference, and preserves compiler strictness and consumer coverage. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 6a2e9a1f9ea0. Provenance checked
TestingProof path: in-process harness. SecurityNone. EvidenceWhat I checked:
Likely related people:
PR surfaceTests +6. Total +6 across 3 files. Added test files: 0. View PR surface stats
LabelsLabel changes:
Label justifications:
Rating scale6/6 🦀 challenger crab · 5/6 🦞 diamond lobster · 4/6 🐚 platinum hermit · 3/6 🦐 gold shrimp · 2/6 🦪 silver shellfish · 1/6 🧂 unranked krab. Overall follows the weaker of proof and patch quality; ✨ marks media proof (a screenshot, video, or linked artifact) that directly shows the changed behavior. WorkflowClawSweeper edits this one comment on every review. Comment Reviewed October 20, 2026, 5:37 AM ET / 09:37 UTC. |
…e program (openclaw#178306) Fixes main check-prod-types red since 6b28ddf: the Gateway display-consumer test helper lived under src/ and pulled Control UI DOM types into the production tsgo program (809 diagnostics). Moved it to test/helpers/gateway/ and updated both callers; logic and assertions unchanged.
What Problem This Solves
Restores the production typecheck after the recovered-reply display tests pulled browser-only types into the Node production program.
Refs a2332ca.
User Impact
No runtime behavior changes. Production typechecking works again, and the real-Gateway tests retain their display-consumer assertions.
Why This Change Was Made
tsconfig.core.jsonincludessrc/**/*and does not exclude*.test-support.ts. The new Gateway replay helper imported Control UI consumers from that included source tree, reintroducing browser globals and TSX into the DOM-free core program.Move the helper to the existing
test/helpers/gateway/boundary, which the production config already excludes, and update both callers. Its replay logic and every assertion remain unchanged. No compiler settings or production code change.Production LOC: +0/-0. Test-only diff: +13/-7 across three files, including relocation of the 36-line helper; only import paths and their formatting change.
Evidence
TS2304: Cannot find name 'HTMLElement'insrc/plugin-sdk/control-ui-components.tsand browser/TSX errors from the UI import graph. After: the same command exits 0.pnpm tsgo:prodlane passes: core, UI, and extensions.chat.send, persistence, publication, recovery, and display replay, and clean up their own processes. The runner starts with isolatedHOMEandOPENCLAW_STATE_DIR.git diff --check, and madge all pass. Madge reports 0 cycles. Independent Codex P0–P2 review is clean.check:changedwas not run under the campaign's local gate budget; its slow SQLite inventory was skipped. The explicit production lane and targeted checks above were run instead; PR CI provides broad proof.Commands for the reproduced failure and passing proof (all runtime/test commands used isolated state):
Timing: Node's Vitest duration was 132.50 s (runner wall time 227.98 s, including a 69.2 s source-runtime build); Bun's was 147.49 s (runner wall time 175.17 s). The existing 16-scenario xAI test took 67.887 s on Node and 66.907 s on Bun. It already shares one real Gateway across sequential rejection/recovery cases; cold Gateway initialization and actual provider retry paths contribute to that cost. No timeout, retry, assertion, or coverage changes were made. Compiler preparation took 25.962 s on Node and 23.156 s on Bun. No flaky failures or reruns were encountered.