Problem
The per-actor stash capacity is a hardcoded 1024 with no way to change it. _stashCapacity is declared readonly with an initializer and is never assigned from the blueprint, and ActorOptions has no field for it. There is no config key either.
1024 is a reasonable default and a poor ceiling. It is reachable in ordinary use — a PersistentActor stashes every command while recovering, so a slow journal plus a busy entity hits it — and when it is hit the failure is a StashOverflowError thrown from inside the user's handler, which supervision then turns into a restart whose cause is 1024 messages away from the thing that actually went wrong.
Evidence
src/internal/ActorCell.ts:71
const DEFAULT_STASH_CAPACITY = 1024;
src/internal/ActorCell.ts:108
private readonly _stashCapacity: number = DEFAULT_STASH_CAPACITY;
The field is read at src/internal/ActorCell.ts:539-540 and written nowhere:
src/internal/ActorCell.ts:539-540
if (this._stashBuffer.length >= this._stashCapacity) {
throw new StashOverflowError(this._stashCapacity);
src/ActorOptions.ts:29-76 declares supervisorStrategy, dispatcher, mailboxCapacity, mailbox, internal, displayName and entity — no stash field.
Proposal
Add stashCapacity to ActorOptions, wire it through the blueprint next to mailboxCapacity, and give it a config key alongside the default-mailbox block tracked in #862. The naming lockstep the repo uses elsewhere applies: builder withStashCapacity ⇔ field stashCapacity ⇔ HOCON leaf stash-capacity.
Related: #795 covers the typed Behaviors.withStash capacity not being validated; this is the untyped path having no capacity option at all.
Acceptance sketch
Verification status
Found in the ten-lens production-readiness review of 2026-08-05 (v0.13.0) and re-verified before filing: confirmed by reading — _stashCapacity has exactly one declaration and one read, both cited, and ActorOptions.ts was read in full.
Part of the production-readiness review batch — tracked in #913.
Problem
The per-actor stash capacity is a hardcoded 1024 with no way to change it.
_stashCapacityis declaredreadonlywith an initializer and is never assigned from the blueprint, andActorOptionshas no field for it. There is no config key either.1024 is a reasonable default and a poor ceiling. It is reachable in ordinary use — a
PersistentActorstashes every command while recovering, so a slow journal plus a busy entity hits it — and when it is hit the failure is aStashOverflowErrorthrown from inside the user's handler, which supervision then turns into a restart whose cause is 1024 messages away from the thing that actually went wrong.Evidence
The field is read at
src/internal/ActorCell.ts:539-540and written nowhere:src/ActorOptions.ts:29-76declaressupervisorStrategy,dispatcher,mailboxCapacity,mailbox,internal,displayNameandentity— no stash field.Proposal
Add
stashCapacitytoActorOptions, wire it through the blueprint next tomailboxCapacity, and give it a config key alongside the default-mailbox block tracked in #862. The naming lockstep the repo uses elsewhere applies: builderwithStashCapacity⇔ fieldstashCapacity⇔ HOCON leafstash-capacity.Related: #795 covers the typed
Behaviors.withStashcapacity not being validated; this is the untyped path having no capacity option at all.Acceptance sketch
ActorOptionsexposesstashCapacity, honoured by the cell.PersistentActorwith a long recovery can be given headroom without forking the framework.Verification status
Found in the ten-lens production-readiness review of 2026-08-05 (
v0.13.0) and re-verified before filing: confirmed by reading —_stashCapacityhas exactly one declaration and one read, both cited, andActorOptions.tswas read in full.Part of the production-readiness review batch — tracked in #913.