Summary
Abort cancellation for asynchronous context-source resolution is ignored unless timeoutMs is also provided.
Root cause
packages/core/src/context.ts, runSourceTask(), returns the source promise immediately when timeoutMs === undefined. The AbortSignal listener is only installed in the timeout branch.
A pending source resolved with { signal } but no timeout therefore remains pending after the caller aborts.
Proposed fix
Race against abort whenever a signal is supplied, independently of timeout handling. Remove abort listeners on every success/failure/timeout path.
Acceptance criteria
Summary
Abort cancellation for asynchronous context-source resolution is ignored unless
timeoutMsis also provided.Root cause
packages/core/src/context.ts,runSourceTask(), returns the source promise immediately whentimeoutMs === undefined. The AbortSignal listener is only installed in the timeout branch.A pending source resolved with
{ signal }but no timeout therefore remains pending after the caller aborts.Proposed fix
Race against abort whenever a signal is supplied, independently of timeout handling. Remove abort listeners on every success/failure/timeout path.
Acceptance criteria