Repository navigation
fix(gateway-client): build pending stop without Promise.withResolvers - #165479
Conversation
#165340 introduced Promise.withResolvers in the gateway-client package. The package declaration build compiles against the repository's ES2023 lib, so tsdown-packages fails with TS2550 and pnpm build (the Team deployer) aborts before cutover. Create the pending-stop promise explicitly again.
|
🦞👀 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: needs maintainer review before merge. Reviewed October 5, 2026, 5:38 AM ET / 09:38 UTC (Revision 2). ClawSweeper reviewWhat this changesThe PR constructs the Gateway client's shutdown promise explicitly so its package declarations can compile against ES2023. Regression provenancePossible regression — probable (reviewed change; failure trace). No predecessor PR is attributed. Merge readiness✅ Ready for maintainer review This remains a necessary, focused build repair: current main still uses an API absent from its declared ES2023 library. No introduced correctness defect was found. Priority: P1 Review scores
Verification
How this fits togetherThe Gateway client connects OpenClaw consumers to the Gateway over WebSocket. Its shutdown promise coordinates socket cleanup, and its source feeds the published package declaration build. flowchart TD
A[Shutdown request] --> B[Gateway client]
B --> C[Create shutdown promise]
C --> D[Socket closes or termination timer fires]
D --> E[Resolve shutdown wait]
C --> F[ES2023 declaration build]
F --> G[Published client package]
Before mergeNone. Agent review detailsSecurityNone. PR surfaceSource +4. Total +4 across 1 file. View PR surface stats
Review metricsNone. Technical reviewBest possible solution: Keep explicit promise construction in the existing shutdown owner, preserving ES2023 compilation and socket-settlement behavior. Do we have a high-confidence way to reproduce the issue? Yes, from source: the declaration build includes Promise.withResolvers under the ES2023 library, matching the supplied TS2550 trace. This read-only review did not execute the build. Is this the best way to solve the issue? Yes. Explicit promise construction removes the compiler-contract mismatch without raising the language-library target or changing shutdown semantics. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 13c1d87f6df4. 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
HistoryReview history (1 earlier review cycle)
|
|
Build proof on the rig node (openclaw-node-01, same
|
…openclaw#165479) openclaw#165340 introduced Promise.withResolvers in the gateway-client package. The package declaration build compiles against the repository's ES2023 lib, so tsdown-packages fails with TS2550 and pnpm build (the Team deployer) aborts before cutover. Create the pending-stop promise explicitly again.
The packages/ai declaration program compiles observeAsyncIterator under the ES2023 library, so Promise.withResolvers fails `pnpm build` with TS2550. Capture the queued resolvers locally, as openclaw#165479 and openclaw#181806 did. PR CI could not see this class of failure: tsgo:core admits the `/// <reference lib="es2024.promise" />` directives in worker-runtime for every package, and the ciArtifacts profile skipped the package declaration producers. Run tsdown-ai and tsdown-packages in ciArtifacts ahead of the runtime pass, with declarations forced on. Co-Authored-By: Claude Opus 5.5 <[email protected]>
…85050) The packages/ai declaration program compiles observeAsyncIterator under the ES2023 library, so Promise.withResolvers fails `pnpm build` with TS2550. Capture the queued resolvers locally, as #165479 and #181806 did. PR CI could not see this class of failure: tsgo:core admits the `/// <reference lib="es2024.promise" />` directives in worker-runtime for every package, and the ciArtifacts profile skipped the package declaration producers. Run tsdown-ai and tsdown-packages in ciArtifacts ahead of the runtime pass, with declarations forced on.
…enclaw#185050) The packages/ai declaration program compiles observeAsyncIterator under the ES2023 library, so Promise.withResolvers fails `pnpm build` with TS2550. Capture the queued resolvers locally, as openclaw#165479 and openclaw#181806 did. PR CI could not see this class of failure: tsgo:core admits the `/// <reference lib="es2024.promise" />` directives in worker-runtime for every package, and the ciArtifacts profile skipped the package declaration producers. Run tsdown-ai and tsdown-packages in ciArtifacts ahead of the runtime pass, with declarations forced on.
What Problem This Solves
#165340 replaced the gateway-client pending-stop helper with
Promise.withResolvers. That is the first production use of it in the repository: the workspace package declaration build (tsdown-packages, rolldown dts) compiles against the roottsconfig.jsonlibES2023, which has nowithResolvers, sopnpm buildfails on current main:The Team deployer (
openclaw-release-deploy) builds every candidate withpnpm build, so every deployment of current main aborts before cutover (round 50, 2026-10-05 09:22Z, unitteam-round50-deploy-20261005-091920). PR CI did not catch it because the package dts build is not part of the PR lanes.User Impact
pnpm buildand every release or deployment built from main work again. No runtime behavior change: the pending-stop contract (ws,promise,resolve,terminateTimer) is unchanged.Why This Change Was Made
Creating the promise explicitly (the shape used before #165340, kept inline) is the smallest change that compiles against the ES2023 lib the package build uses. Lifting the root lib to
ES2024(Node 22 already haswithResolvers) or adding the package dts build to a PR lane are reasonable follow-ups, but both are toolchain changes that should land on their own.Evidence
pnpm buildof this branch on the rig node (the same command the deployer runs) is linked in a comment once it finishes.