-
-
Notifications
You must be signed in to change notification settings - Fork 52.9k
Description
gh issue create --repo openclaw/openclaw
--title "bug: AbortSignal.any() fails when signal is not instanceof AbortSignal"
--body "## Description
`combineAbortSignals()` in `src/agents/pi-tools.abort.ts` passes objects to `AbortSignal.any()` without verifying they are actual `AbortSignal` instances, causing runtime errors.
Error Message
```
The "signals[0]" argument must be an instance of AbortSignal. Received an instance of Object
```
Steps to Reproduce
- Run OpenClaw from source on Node.js 22
- Trigger any exec tool call
- Error occurs at `AbortSignal.any([a as AbortSignal, b as AbortSignal])`
Root Cause
`src/agents/pi-tools.abort.ts:25-26` uses type assertion `as AbortSignal` but doesn't verify the actual runtime type before calling `AbortSignal.any()`.
Suggested Fix
Add `instanceof AbortSignal` check before calling `AbortSignal.any()`:
```typescript
if (
typeof AbortSignal.any === "function" &&
a instanceof AbortSignal &&
b instanceof AbortSignal
) {
return AbortSignal.any([a, b]);
}
```
Environment
- Node.js: 22.22.0
- OpenClaw: 2026.2.1 (main branch)
- OS: macOS 14.7.3"