Problem
TypedActor.handleSupervise calls supervise.strategy.decider(err) and, on Restart, immediately re-resolves supervise.child (src/typed/TypedActor.ts:161-179). SupervisorStrategy.maxRetries / withinTimeRangeMs (src/Supervision.ts:16-23) are never consulted — so Behaviors.supervise(b).onFailure(new OneForOneStrategy(…, { maxRetries: 3 })) restarts forever. The OO path honors the budget (ActorCell.registerRestart, src/internal/ActorCell.ts:1034-1043).
Additionally, activeSupervise (line 50) is a single field set as a side effect of resolve() and never cleared: a nested or second supervise silently replaces the outer one, and a behavior transition out of the supervised subtree keeps the stale strategy.
Proposed behaviour
Reuse the same sliding-window restart budget as ActorCell.registerRestart; escalate (rethrow) past the limit. Define and implement nesting semantics for supervise.
Acceptance criteria
- A supervised behavior that always throws stops after
maxRetries restarts within the window.
- Nested
supervise has documented, tested semantics.
Related: #533 (typed API surface)
Problem
TypedActor.handleSupervisecallssupervise.strategy.decider(err)and, onRestart, immediately re-resolvessupervise.child(src/typed/TypedActor.ts:161-179).SupervisorStrategy.maxRetries/withinTimeRangeMs(src/Supervision.ts:16-23) are never consulted — soBehaviors.supervise(b).onFailure(new OneForOneStrategy(…, { maxRetries: 3 }))restarts forever. The OO path honors the budget (ActorCell.registerRestart,src/internal/ActorCell.ts:1034-1043).Additionally,
activeSupervise(line 50) is a single field set as a side effect ofresolve()and never cleared: a nested or secondsupervisesilently replaces the outer one, and a behavior transition out of the supervised subtree keeps the stale strategy.Proposed behaviour
Reuse the same sliding-window restart budget as
ActorCell.registerRestart; escalate (rethrow) past the limit. Define and implement nesting semantics forsupervise.Acceptance criteria
maxRetriesrestarts within the window.supervisehas documented, tested semantics.Related: #533 (typed API surface)