Merge branch 'cranky-moth'

This commit is contained in:
Mohamed Boudra
2026-01-24 21:26:55 +07:00
@@ -2233,12 +2233,15 @@ export class DaemonClientV2 {
} }
} }
// Capture stack trace at call site, not inside setTimeout
const timeoutError = new Error(`Timeout waiting for message (${timeout}ms)`);
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
const timeoutHandle = const timeoutHandle =
timeout > 0 timeout > 0
? setTimeout(() => { ? setTimeout(() => {
this.waiters.delete(waiter); this.waiters.delete(waiter);
reject(new Error(`Timeout waiting for message (${timeout}ms)`)); reject(timeoutError);
}, timeout) }, timeout)
: null; : null;