Repository navigation
Done
Labels
Description
Restart of #3765 (Sprites runner pool). The first attempt, #3795, grew to about 4,600 lines, and its review loop stalled at 6/10 on orphan-cleanup edge cases. Build it fresh from the epic branch with the narrow scope below. You may read #3795 for ideas, but follow THIS spec.
What already exists (do not rebuild it)
packages/core/src/agents/runtime/sprites/spritesProvisioning.ts SpritePool: an in-process idle pool. Each Sprite is provisioned once with a clean checkpoint and reset on release (restart, wipe /tmp, restore checkpoint, then clear the network policy). A Sprite whose reset fails is destroyed, and the pool closes on worker shutdown. Extend it.
Scope (only this)
- Shared cap across workers. A Redis-backed counter and lease limit the number of Sprites that exist at once to
PROPR_SPRITES_MAX(default 2; document that the Free plan allows 3). It counts every Sprite this deployment created that has not been confirmed deleted. Each lease has a TTL that its worker renews; a worker that crashes loses its leases when they expire. When the cap is reached, the run waits in admission or the queue with a clear "waiting for a Sprite" status and does not fail. - Conservative orphan cleanup. Name or tag every Sprite with a deployment marker (for example
propr-<deploymentId>-<uuid>). At worker start and every N minutes, list Sprites with this deployment's marker that have no live lease and are older thanPROPR_SPRITES_ORPHAN_AGE(default 30 min), and delete them. Never touch Sprites without this marker. Before deleting, release any cap slot whose Sprite is confirmed gone. No result-recovery logic for orphans: an orphan's run already failed. - Ambiguous restart. The Sprites API sometimes answers
restart()withrestart outcome unknown(seen live on about 2 of 5 releases). Treat that as "maybe": poll until a trivialexecFile('true')succeeds (bounded, for example 60 s), then continue the reset. Destroy the Sprite only if it never comes back. - Status. Show the pool (cap, in use, idle, provisioning, orphans deleted) in
propr status, the Web UI runtime panel and MCP (existing runtime or status tools). Record restore and provisioning timings in run compute usage.
Out of scope: per-repo warm-clone checkpoints, multi-region, and anything else not listed above.
Acceptance
- Fake-Sprites and fake-Redis tests:
- the cap is held across two pools;
- a crashed worker's lease expires and its slot is freed;
- an orphan with our marker is deleted only when older than the age limit;
- foreign Sprites are never touched;
- an ambiguous restart recovers, and a restart that never comes back leads to destroy;
- an at-cap run waits instead of failing.
- About 1,000 lines of non-test code.
test/spritesRuntime.live.test.tsstill passes. A maintainer will run it before merge.
Activity
propr-dev commentedon Nov 25, 2026
🤖 AI processing has started for this issue using codex agent with gpt-6.2-astra model.
I'll analyze the problem and work on a solution. This may take a few minutes.
Processing Details:
codexgpt-6.2-astra3799/gpt-6.2-astra-sprites-runner-pool-resta-20261125-0640-bjh3758-epic-runtime-abstraction-sc0issue-3799-20261125-0640-gpt-6.2-astra-bjh🔍 Track Task Execution
integry commentedon Nov 25, 2026
Pitfalls found in the #3795 review. The restart must avoid them by design; please add a test for each.
running). A holder whose heartbeat finds its lease gone must stop the run and report it, not keep executing..propr/*TAP output or SQLite files). Make sure tests write to an ignored temp dir.refactor: add shared Sprite cap and conservative orphan cleanup
integry commentedon Nov 25, 2026
Done via #3800 (Sprites runner pool restart), merged into the epic after live verification on real Sprites: orphan cleanup, Redis flush, and the Sprites runtime live test.