Skip to content

fix(agent-core): build package declarations without Promise.withResolvers - #181806

Merged
steipete merged 1 commit into
mainfrom
steipete/fix-agent-core-with-resolvers
Oct 23, 2026
Merged

steipete merged 1 commit into
mainfrom
steipete/fix-agent-core-with-resolvers

Conversation

@steipete

Copy link
Copy Markdown
Contributor

What Problem This Solves

Fixes: pnpm build fails on main since #181576 with packages/agent-core/src/agent-loop-tool-execution.ts: error TS2550: Property 'withResolvers' does not exist on type 'PromiseConstructor', so no build artifacts (and no Gateway) can be produced from current main.

User Impact

User impact: main builds again. No runtime behavior change.

Why This Change Was Made

#181576 (697b23a59bd, "fix(postgres): explain connection loss and canceled queries") added Promise.withResolvers<void>() to agent-core's tool-batch launcher. src/ code can use it, but the agent-core package's declaration build compiles against the repo's ES2023 lib, where withResolvers (ES2024) does not exist. Only resolve is used, so the call is replaced with a plain promise whose resolver is captured synchronously; this is behavior-identical and avoids widening the package lib target for one call.

Evidence

  • Reproduced on main c3b57f74833: pnpm build fails in tsdown-packages with TS2550 after ~30 s.
  • With this change: pnpm build passes (7m 33s full build) and the isolated test rig Gateway starts from the result.
  • agent-core tool-execution tests: see follow-up comment.
  • oxfmt --check clean.

…vers

#181576 used Promise.withResolvers in agent-core, but the package declaration build targets ES2023, so pnpm build fails with TS2550 on main. Capture the resolver from a plain promise instead; behavior is identical.
@clawsweeper

clawsweeper Bot commented Oct 23, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

Pull request received. I will update this pull request when review starts.

ClawSweeper review complete

ClawSweeper finished reviewing this revision. The review result is being finalized.

View the workflow run.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 23, 2026 •

Copy link
Copy Markdown
Contributor

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-23T17:57:27.829913Z c8366c3 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@clawsweeper clawsweeper Bot added clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-environment Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. labels Oct 23, 2026
@steipete
steipete merged commit 1eae4fc into main Oct 23, 2026
102 checks passed
@steipete
steipete deleted the steipete/fix-agent-core-with-resolvers branch October 23, 2026 18:07
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Oct 24, 2026
…vers (openclaw#181806)

openclaw#181576 used Promise.withResolvers in agent-core's tool-batch launcher, but the package declaration build compiles against the repo's ES2023 lib, so pnpm build failed on main with TS2550 and produced no artifacts. Capture the resolver from a plain promise instead (the executor runs synchronously, and only resolve is used); behavior is identical and the package lib target stays unchanged.
fuller-stack-dev added a commit to fuller-stack-dev/openclaw that referenced this pull request Oct 26, 2026
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]>
fuller-stack-dev added a commit that referenced this pull request Oct 26, 2026
…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.
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Oct 27, 2026
…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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-environment Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. size: XS

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant