Priority: P1
Problem
Retry APIs have no AbortSignal and RetryEngine waits for backoff unconditionally. A cancelled request can remain queued and execute more attempts after its caller has ended.
Evidence
packages/retry-core/src/libs/RetryTemplate.ts and RetryOrchestrator.ts expose no signal; RetryEngine.ts:30-92 only stops through hooks and waits through the backoff policy.
Desired outcome
Retry work stops promptly and deterministically on caller cancellation.
Implementation path
- Add optional signal to template, orchestrator, engine, and decorator paths where applicable.
- Check cancellation before attempts and during backoff with an abortable wait.
- Emit a stable RetryAbortedProblem with safe context.
- Test before-first-attempt, during-backoff, listener cleanup, and no-further-attempt behavior.
Acceptance criteria
- Cancellation prevents subsequent attempts.
- Backoff does not outlive an aborted signal.
- Existing retry behavior is unchanged when no signal is supplied.
Validation
pnpm --filter @croco/retry-core test
Scope boundaries
Does not redesign retry classification or backoff algorithms.
Priority: P1
Problem
Retry APIs have no AbortSignal and RetryEngine waits for backoff unconditionally. A cancelled request can remain queued and execute more attempts after its caller has ended.
Evidence
packages/retry-core/src/libs/RetryTemplate.tsandRetryOrchestrator.tsexpose no signal;RetryEngine.ts:30-92only stops through hooks and waits through the backoff policy.Desired outcome
Retry work stops promptly and deterministically on caller cancellation.
Implementation path
Acceptance criteria
Validation
pnpm --filter @croco/retry-core testScope boundaries
Does not redesign retry classification or backoff algorithms.