Repository navigation
[3765 by Claude Opus 5.5] Sprites runner pool with checkpoint reset and warm clones - #3795
Conversation
I've implemented #3765 by extending the existing `SpritePool` rather than replacing it. All the new and existing tests pass, but nothing has run against real Sprites yet. That matters most for warm clones. Shared, bounded pool (Redis leases) - `PROPR_SPRITES_MAX` (default 2) caps how many runners there are across every worker using the same Sprites token. It is never allowed above `PROPR_SPRITES_ORG_LIMIT` (default 3, the Free-plan limit); a larger value is lowered with a warning. - When every runner is busy, runs wait in a first-come, first-served queue. If the max is lowered, extra runners are deleted as they are released. - Lease holders send a heartbeat every 15 s and are treated as dead after 60 s of silence. Each worker can now reuse an idle runner another worker released. - A runner is health checked with one exec before each lease. If the check fails, or the restore after a run fails, it is destroyed and replaced in the same slot. - The pool logic is in `packages/core/src/agents/runtime/spritesPool.ts` and the `sprites/spritesPool*.ts` and `spritesRunnerPool.ts` files. Orphan reaping - Every runner is created with a `propr-pool` label and a per-pool label. - On startup a worker deletes its pool's labelled Sprites that have no lease record. It also deletes unlabelled `propr-<uuid>` Sprites from older versions once they are over 24 h old, and drops records whose Sprite no longer exists. - If a worker dies mid-run, its runner is deleted before that slot is reused. - A finished run that was never released is marked `retained` and is never deleted automatically, because it may hold the only copy of a result. It keeps its slot until someone recovers the result and deletes it by hand. Warm clones (`PROPR_SPRITES_WARM_CLONES=on`, off by default) - The clone transport script now accepts an optional root-owned reference repository, used as Git alternates. Only new objects are fetched, and the reference is refreshed from the fetch the script has already verified, before the agent starts. Symlinked or foreign-owned references are ignored. - On release, the reference is parked in `/tmp`, the clean checkpoint is restored, and the reference is put back and saved as a warm checkpoint. A later run of the same repository starts from it without a restore. A run of a different repository waits for a clean restore first. Status and run usage - `propr admission`, `GET /api/agent-run-admission` and the `get_agent_run_admission` MCP tool show a new `spritesPool` section. `propr remote-status`, `GET /api/status` and the Web UI system status menu show a one-line summary such as "2/2 busy · 1 queued". - Each run's compute usage now records `runnerPool`: queue wait, provisioning time, health check and restore timings. - I regenerated the OpenAPI spec and client types, and updated the docs, the configuration reference, `.env.example` and the changelog. Things to check before merging - Untested live: the warm-clone release path, labels on `createSprite`, and `listAllSprites` reaping. I tested the transport script locally with real git. - Queue wait counts toward the run's timeout. - Warm checkpoints pile up on each runner: the `@fly/sprites` 0.2.5 SDK has no call to delete a checkpoint. - Graceful shutdown only deletes the idle runners that worker last used; other workers' idle runners stay in the pool. - The `sprites` runtime now needs Redis at `REDIS_HOST`/`REDIS_PORT`. Tests - New: `test/spritesRunnerPool.test.ts` (shared pool across simulated workers) and `test/spritesPoolRedis.test.ts`. The Redis test runs 24 concurrent acquisitions across separate connections against a real Redis; it skips when no Redis is available. - I checked that the bound and Redis tests fail when I break the logic they cover. The first-come, first-served check made the queue test hang rather than fail, so I added timeouts. - Also added: a transport-script test, API, CLI and UI tests, and the existing Sprites tests updated. Lint and typecheck are clean. The preview screenshots caught the queued summary overflowing the status menu, so I shortened the label and text. The previews show the menu with the pool full and a run queued, and with an orphaned runner flagged. ProPR-Agent: claude/claude-opus-5-5
|
/ultrafix goal=8 max=10 |
|
🔄 Ultrafix loop started (goal: 8/10, max cycles: 10) First action:
|
|
✅ AI Code Review Complete requested by @propr-ultrafix Posted 1 review: |
🔍 AI Code Review — codex:gpt-6-astraOverall EvaluationThe PR implements shared Redis leases, bounded acquisition, warm clones, and useful status reporting. It needs significant corrections before merge, particularly around deletion bookkeeping and result preservation. ✅ Atomic acquisition transitions — Runner reservations are recorded before provisioning, and Redis WATCH/MULTI retries competing state changes. ✅ Useful operational visibility — Pool counts, waiting runs, restore timings, and retained results flow through API, CLI, MCP, and UI surfaces. ✅ Relevant coverage — Added tests exercise cross-worker reuse, queue cancellation, failed health checks, and concurrent Redis acquisitions. This review uses static traces of the supplied code; no commands or tests were run. Current checks show 31 passed, three pending, and no failures. Merge blockersEvery finding below was introduced by this PR and must be resolved before merging. F1: 🔴 Keep surplus runners counted until deletion succeeds
F2: 🔴 Reconcile manually deleted retained runners
F3: 🔴 Preserve legacy results during startup reaping
F4: 🔴 Validate compatibility before cross-worker reuse
SuggestionsThese are optional follow-ups and are not sent to S1: 🟢 Exercise the real warm-clone lifecycleThe fake implements the intended checkpoint and carry semantics directly, while the existing live test uses an empty listing and does not exercise warm-clone release. An opt-in live smoke test covering labels, discovery, carry/restore/install, and repeat-repository reuse would strengthen confidence in SDK integration. This is additional validation, not an independently demonstrated defect. ScoreThe implementation has substantial functional coverage, but deletion bookkeeping, legacy result preservation, recovery liveness, and cross-version reuse need correction. Passing checks do not cover these failure sequences. Score: 4/10 🤖 Review Details
Copy and edit to choose records from this review: 🤖 Review by ProPR |
|
✅ Applied the requested follow-up changes in commit 0f24857
Summary of ChangesAddressed F1–F4 in PR #3795.
Verification: 42 tests passed. Two Redis integration tests skipped because no Redis server was available. Core typechecking and lint passed. Provider behavior was tested with simulated Sprites. Review digestRisk-tiered paths
Diff size: 6 files changed, +359/−48 lines 🤖 Implementation Details
💡 ProPR Slash Commands
🤖 Generated by ProPR |
Addressed F1–F4 in PR #3795. - **F1** Surplus runners stay counted until deletion succeeds. A failed deletion leaves an orphaned record for retry, including when a health check is cancelled. - **F2** Queued workers periodically check retained Sprites. A confirmed 404 frees the slot if the record is still retained. Transient lookup failures preserve it. - **F3** Startup preserves untracked legacy Sprites of any age and logs their names for operator review. - **F4** Workers fingerprint the CLI pins and trusted setup files used to provision each runner. A missing or mismatched fingerprint triggers replacement within the existing counted slot. **Verification:** 42 tests passed. Two Redis integration tests skipped because no Redis server was available. Core typechecking and lint passed. Provider behavior was tested with simulated Sprites. PR: #3795 Comment by: @propr-ultrafix (ID: 0) Model: GPT-6.2 Astra ProPR-Agent: codex/gpt-6.2-astra
|
✅ AI Code Review Complete requested by @propr-ultrafix Posted 1 review: |
🔍 AI Code Review — codex:gpt-6-astraOverall EvaluationThe PR implements a shared Redis-backed runner pool, warm clone reuse, and status reporting across the API, CLI, and UI. It needs changes before merge because two coordination failures can undermine exclusive ownership or result preservation. ✅ Counted provisioning — Reservations precede Sprite creation, and ambiguous create failures keep the possible Sprite counted until reaping. ✅ Checkpoint compatibility — Reuse checks a fingerprint covering CLI pins and uploaded setup scripts, replacing incompatible runners within their reserved slot. ✅ Recovery coverage — Added tests cover cancellation, failed deletion, retained-result recovery, and ownership loss during setup. This review is based on static tracing of the supplied code; no commands were run. The authoritative checks show 29 passed, five pending, and no failures. Merge blockersEvery finding below was introduced by this PR and must be resolved before merging. F5: 🔴 Serialize configuration publication with lease transactions
F6: 🔴 Preserve finished state after Redis write failure
SuggestionsThese are optional follow-ups and are not sent to S2: 🟢 Exercise the real warm-clone lifecycleThe fake Sprite explicitly models checkpoint exclusion of ScoreThe implementation has substantial coverage and useful operational reporting, but exclusive leasing and preservation of unrecovered results still have verified failure paths. Both need localized corrections before merge. Score: 6/10 🤖 Review Details
Copy and edit to choose records from this review: 🤖 Review by ProPR |
|
✅ Applied the requested follow-up changes in commit 696abd7
Summary of ChangesF5 and F6 are fixed. Configuration publication now shares the lease transaction queue for each Redis connection, including when two stores wrap the same client. A competing worker’s acquisition therefore invalidates the stale lease attempt. A completed run now keeps its completion intent until release. If Redis rejects the initial write, subsequent heartbeats retry it while the same lease still owns the runner. Once persisted, the finished runner becomes retained on expiry. If the worker disappears before Redis accepts any completion write, that recovery window remains. All 48 focused tests passed, including the publication race against real Redis and completion retries during reset and lease takeover. The core TypeScript check passed. ESLint had no matching configuration for the changed files. Separate finding: I verified that Review digestRisk-tiered paths
Diff size: 4 files changed, +133/−6 lines 🤖 Implementation Details
💡 ProPR Slash Commands
🤖 Generated by ProPR |
**F5 and F6 are fixed.** Configuration publication now shares the lease transaction queue for each Redis connection, including when two stores wrap the same client. A competing worker’s acquisition therefore invalidates the stale lease attempt. A completed run now keeps its completion intent until release. If Redis rejects the initial write, subsequent heartbeats retry it while the same lease still owns the runner. Once persisted, the finished runner becomes retained on expiry. If the worker disappears before Redis accepts any completion write, that recovery window remains. All 48 focused tests passed, including the publication race against real Redis and completion retries during reset and lease takeover. The core TypeScript check passed. ESLint had no matching configuration for the changed files. **Separate finding:** I verified that `publishConfig` can report success when Redis returns a command-level error inside `EXEC`, such as `WRONGTYPE` on the pool scopes key. That error-handling issue is outside F5 and F6. PR: #3795 Comment by: @propr-ultrafix (ID: 0) Model: GPT-6.2 Astra ProPR-Agent: codex/gpt-6.2-astra
|
✅ AI Code Review Complete requested by @propr-ultrafix Posted 1 review: |
🔍 AI Code Review — codex:gpt-6-astraOverall EvaluationThe PR implements a shared Redis-backed runner pool, warm clone reuse, and consistent status reporting. It needs changes before merge because a failed completion write can still lead to deletion of an unrecovered result. ✅ Shared allocation — Runner reservations precede provisioning, and Redis transactions serialize competing acquisitions. ✅ Compatibility checks — Reused runners are checked against CLI pins and uploaded setup-script contents before handoff. ✅ Recovery coverage — Tests exercise failed deletions, ownership changes, ambiguous creates, and completion-write retries. This review used static analysis of the supplied code; no commands were run. The authoritative checks show 30 passed, four pending, and no failures. Merge blockersEvery finding below was introduced by this PR and must be resolved before merging. F7: 🔴 Preserve results after failed completion writes
SuggestionsThese are optional follow-ups and are not sent to S3: 🟢 Exercise warm reuse against SpritesThe fake provider models checkpoint exclusion of ScoreThe implementation has substantial targeted coverage and a coherent allocation design, but the remaining result-loss path prevents merge readiness. Pending checks alone do not reduce the score. Score: 6/10 🤖 Review Details
Copy and edit to choose records from this review: 🤖 Review by ProPR |
|
✅ Applied the requested follow-up changes in commit 7d625fa
Summary of ChangesFixed F7. Both startup and acquisition-driven reaping now inspect the Sprite before deleting an expired execution lease. They retain the runner when they find completion or result evidence, or when inspection is inconclusive. Both paths recheck lease ownership after inspection. All 50 runner-pool and runtime tests passed, including regressions showing that the only bundle survives a failed Redis completion write and worker loss before heartbeat repair. Core typecheck and lint passed. Verification used simulated Sprites and a local filesystem check. Review digestRisk-tiered paths
Diff size: 4 files changed, +119/−4 lines 🤖 Implementation Details
💡 ProPR Slash Commands
🤖 Generated by ProPR |
Fixed F7. Both startup and acquisition-driven reaping now inspect the Sprite before deleting an expired execution lease. They retain the runner when they find completion or result evidence, or when inspection is inconclusive. Both paths recheck lease ownership after inspection. All 50 runner-pool and runtime tests passed, including regressions showing that the only bundle survives a failed Redis completion write and worker loss before heartbeat repair. Core typecheck and lint passed. Verification used simulated Sprites and a local filesystem check. PR: #3795 Comment by: @propr-ultrafix (ID: 0) Model: GPT-6.2 Astra ProPR-Agent: codex/gpt-6.2-astra
|
✅ AI Code Review Complete requested by @propr-ultrafix Posted 1 review: |
|
🔀 Resolved merge conflicts from Conflicting Files
Resolution SummaryResolved all four file conflicts for PR #3795. A workspace-wide scan found no remaining merge conflict markers. Git still lists the files as conflicted in its index because the read-only filesystem prevented Git from creating
🤖 Resolution Details
System-triggered merge conflict resolution |
Automatically resolved merge conflicts after merging target branch into PR branch. Resolved conflicts in: - packages/core/src/agents/runtime/sprites/spritesProvisioning.ts - packages/core/src/agents/runtime/sprites/spritesRun.ts - packages/core/src/agents/runtime/spritesRuntime.ts - test/helpers/fakeSprites.ts PR: #3795 Model: GPT-6.2 Sol
|
CI failed: Validate Changes, Full Test Suite Shard 4/4, Run Full Test Suite Please investigate and fix these CI failures.
Failure evidence
Failure evidence
Depends on the failed job(s): Failure evidence
|
Checks FailedValidation failed during setup, tests, CLI packaging, linting, or build checks. View Logs |
|
❌ Failed to apply follow-up changes requested by @propr-dev[bot], @github-actions[bot] Push rejectedReason: Unknown ( The push failed for a reason ProPR could not classify. See the remote output below. Recovery: The commits were saved to the git bundle Remote outputComment IDs: 7147587253✓, 7147588157✓ |
|
Live finding for the pool (from runs on #3793 and #3796): the Sprites API sometimes answers |
|
✅ Applied the requested follow-up changes in commit b7527c5 Summary of ChangesOn Fake-Sprite tests cover recovery after a transient exec failure and replacement after a hung status request. All 52 pool and runtime tests passed. Core typechecking and linting of the changed runtime file passed. Live Sprites were not exercised. Review digestRisk-tiered paths
Diff size: 2 files changed, +80/−1 lines 🤖 Implementation Details
Undo Changes • View Task Execution 💡 ProPR Slash Commands
🤖 Generated by ProPR |
Fixed F10. Startup now counts pool-labelled and eligible legacy orphans before cleanup begins. Each orphan keeps its slot until deletion succeeds or the provider confirms it is gone. Cleanup rechecks ownership before deleting. A two-worker regression verifies that with `PROPR_SPRITES_MAX=2`, one undeleted orphan leaves room for exactly one new runner. Additional tests cover stalled deletion, inventory failures, and ownership changes during cleanup. 91 tests passed with simulated Sprites. Core typechecking and lint passed. Four Redis integration tests skipped because `redis-server` and a reachable Redis endpoint were unavailable. PR: #3795 Comment by: @propr-ultrafix (ID: 0) Model: GPT-6.2 Astra ProPR-Agent: codex/gpt-6.2-astra
|
✅ AI Code Review Complete requested by @propr-ultrafix Posted 1 review: |
🔍 AI Code Review — codex:gpt-6-astraOverall EvaluationThe PR implements a shared Redis-backed runner pool, warm-clone reuse, and status reporting, with extensive lifecycle tests. It needs a targeted correctness fix before merge. ✅ Shared capacity accounting — Reservations precede provisioning, and failed deletions remain counted until reconciliation. ✅ Ambiguous restart recovery — The reset path polls running status and verifies execution before proceeding, with bounded waits and dedicated tests. ✅ Result preservation — Expired execution leases are inspected for recoverable results, and retained runners remain unavailable for reuse. The supplied current-head status reports no failed checks and five pending checks. This review uses static tracing only; no commands were run. Merge blockersEvery finding below was introduced by this PR and must be resolved before merging. F11: 🔴 Definitively rejected late creates strand capacity
SuggestionsThese are optional follow-ups and are not sent to S10: 🟢 Remove generated test artifactsThe three newly committed S11: 🟢 Exercise warm clones liveThe fake Sprite tests verify lifecycle ordering but simulate filesystem movement and checkpoint restoration. A live test covering reference preservation across release and switching repositories would strengthen confidence in the optional warm-clone feature. This is additional integration evidence, not a demonstrated code defect. ScoreThe implementation has substantial coverage and useful recovery safeguards, but a late definitive creation rejection can permanently consume shared capacity. The correction is localized; current checks have no reported failures but remain incomplete. Score: 6/10 🤖 Review Details
Copy and edit to choose records from this review: 🤖 Review by ProPR |
|
✅ Applied the requested follow-up changes in commit 871474b
Summary of ChangesFixed F11. A definitive create rejection now releases the matching reservation, even after shutdown. Tests confirm that another worker can acquire a one-slot pool after either an initial create or a background replacement is rejected. Ambiguous late failures keep the slot reserved. 97 tests passed. Core typechecking and lint passed. Four Redis integration tests skipped because Redis was unavailable. Separate finding. I reproduced an immediate transport failure that clears Review digestRisk-tiered paths
Diff size: 2 files changed, +91/−58 lines 🤖 Implementation Details
💡 ProPR Slash Commands
🤖 Generated by ProPR |
Fixed F11. A definitive create rejection now releases the matching reservation, even after shutdown. Tests confirm that another worker can acquire a one-slot pool after either an initial create or a background replacement is rejected. Ambiguous late failures keep the slot reserved. 97 tests passed. Core typechecking and lint passed. Four Redis integration tests skipped because Redis was unavailable. **Separate finding.** I reproduced an immediate transport failure that clears `pendingCreate` while the provider may still finish creating the Sprite. A peer can then acquire the slot and exceed the pool limit. This remains outside F11. PR: #3795 Comment by: @propr-ultrafix (ID: 0) Model: GPT-6.2 Astra ProPR-Agent: codex/gpt-6.2-astra
|
✅ AI Code Review Complete requested by @propr-ultrafix Posted 1 review: |
🔍 AI Code Review — codex:gpt-6-astraOverall EvaluationThe PR implements shared Redis leases, runner reuse, warm clones, status reporting, and bounded recovery from ambiguous restarts. It needs changes before merge: a worker crash can permanently consume pool capacity, and the queue does not consistently preserve arrival order. ✅ Atomic pool transitions — Redis transactions serialize competing acquisitions, and the added integration tests exercise separate connections. ✅ Bounded restart recovery — Ambiguous restarts require both running status and a successful exec before reset continues, with tests covering recovery and a stalled lookup. This review used static analysis of the supplied code; no commands were run. Current checks report 29 passed, five pending, and no failures. Merge blockersEvery finding below was introduced by this PR and must be resolved before merging. F12: 🔴 Crashed create reservations can block forever
F13: 🔴 Equal timestamps break FIFO ordering
SuggestionsThese are optional follow-ups and are not sent to S12: 🟢 Remove generated test artifactsThe three S13: 🟢 Exercise warm clones liveThe fake filesystem models checkpoint restoration and ScoreThe implementation has substantial lifecycle coverage and useful operational reporting, but abandoned reservations can halt a pool and the queue violates its FIFO contract. Both need correction before merge. Score: 6/10 🤖 Review Details
Copy and edit to choose records from this review: 🤖 Review by ProPR |
|
✅ Applied the requested follow-up changes in commit aefbcb3
Summary of ChangesBoth findings are fixed, with regressions that fail on the previous code and pass now. No visual change, so no previews were created. F13, FIFO on equal timestamps (
F12, abandoned pending-create reservations
Verification
Not done: nothing from the two findings. I left the FIFO test in the Redis suite untouched since it only reads ordering by timestamp with well-separated joins. Review digestRisk-tiered paths
Diff size: 6 files changed, +189/−19 lines 🤖 Implementation Details
💡 ProPR Slash Commands
🤖 Generated by ProPR |
Both findings are fixed, with regressions that fail on the previous code and pass now. No visual change, so no previews were created. **F13, FIFO on equal timestamps** (`packages/core/src/agents/runtime/sprites/spritesPoolState.ts`) - Each waiter now gets an arrival number assigned inside the atomic enqueue transition, one above every request still queued. The queue sorts by that number first, then by timestamp and ID only as a fallback. - The Redis decoder accepts waiters written without the number and sorts them by timestamp, so a mixed deployment still orders. - Regression: two enqueues at the same clock value with oppositely ordered IDs. The old comparator served the second arrival first; the test now checks the first arrival leases and a newcomer never overtakes a queued request. **F12, abandoned pending-create reservations** - A lookup returning 404 for a pending create now reports `unsettled` instead of nothing. The new `resolveSpriteInventoryCheck` in the state module keeps the slot reserved while the reservation has been orphaned for less than the create deadline plus the lease timeout (22 minutes), then forgets the record and frees the slot, with a warning naming the Sprite. The reasoning: a live holder gives up its create at the 21-minute provisioning deadline and records the outcome itself, so a Sprite still absent that long after orphaning was never created. A Sprite that appears anyway is still released for reaping, never leaked. - The same path also resolves a sibling case I traced: a live worker whose late create callback ends in a non-definitive error (such as a 500) left the record orphaned with `pendingCreate` set forever too. - Startup inventory and queued acquisitions already ran this check periodically, so no new scheduling was needed. The 21-minute provisioning timeout is now a shared constant instead of a literal. - Docs in `agent-runtime.md` describe the automatic recovery and the manual clearance: confirm absence with the Sprites CLI, then remove the record from the pool's Redis runners hash. - Regressions: a worker that dies after committing the reservation and before the request reaches the provider (the slot stays reserved within the deadline, then a peer provisions into it); and a create that lands late after the deadline (the Sprite is deleted, not leaked). **Verification** - Runner pool suite: 68 pass. Sprites runtime suite: 32 pass. The Redis integration suite skipped for lack of a Redis server in this container. - Core typecheck and zero-warning lint pass on the changed files. **Not done**: nothing from the two findings. I left the FIFO test in the Redis suite untouched since it only reads ordering by timestamp with well-separated joins. PR: #3795 Comment by: @propr-ultrafix (ID: 0) Model: Claude Fable 5.1 ProPR-Agent: claude/claude-fable-5-1
|
✅ AI Code Review Complete requested by @propr-ultrafix Posted 1 review: |
🔍 AI Code Review — codex:gpt-6-astraOverall EvaluationThe PR implements a shared Redis-backed Sprites pool, warm-clone reuse, operational reporting, and bounded recovery from ambiguous restarts. The supplied code supports the effective objective; I found no verified merge blocker. Merge readiness is conditional on the five pending checks completing successfully. ✅ Counted resource lifecycle — Reservations precede Sprite creation, failed deletions remain counted, and replacement provisioning preserves the occupied slot. ✅ Result preservation — Finished leases become retained after expiry, while expired execution leases receive result inspection before deletion. Tests cover failed completion writes and ownership changes during inspection. ✅ Bounded restart recovery — Ambiguous restart responses trigger status polling and a successful trivial exec before reset continues, with tests covering recovery and a stalled status request. This was a static review of the supplied diff and caller context; no commands or tests were run. Merge blockersNo merge blockers. SuggestionsThese are optional follow-ups and are not sent to S14: 🟢 Remove generated test artifactsThe three added S15: 🟢 Exercise warm cloning liveThe fake Sprite tests cover the intended carry, restore, install, and checkpoint sequence, while the transport test exercises Git locally. A live test combining both would provide additional confidence that the separate ScoreThe implementation includes substantial lifecycle and failure-path coverage, with no verified blocker in the supplied code. Current checks report 29 passed, five pending, and no failures; live warm-clone integration remains less directly validated. Score: 8/10 🤖 Review Details
Copy and edit to choose records from this review: 🤖 Review by ProPR |
|
CI failed: Full Test Suite Shard 1/4, Run Full Test Suite Please investigate and fix these CI failures.
Failure evidence
Depends on the failed job(s): Failure evidence
|
|
✅ Applied the requested follow-up changes in commit c54822a Summary of ChangesFixed the flaky FIFO assertion in spritesPoolRedis.test.ts. Concurrent Redis transactions can commit in a different order from their request timestamps. The test now uses the stored enqueue sequence to identify which waiter should receive the released runner. I reproduced the CI failure locally before the fix. Afterward, all 72 Redis and runner-pool tests passed, and the Redis suite passed 10 consecutive runs. Verification covered the affected suites only. Review digestRisk-tiered paths
Diff size: 1 file changed, +2/−1 lines 🤖 Implementation Details
Undo Changes • View Task Execution 💡 ProPR Slash Commands
🤖 Generated by ProPR |
Fixed the flaky FIFO assertion in [spritesPoolRedis.test.ts](/home/node/workspace/test/spritesPoolRedis.test.ts:85). Concurrent Redis transactions can commit in a different order from their request timestamps. The test now uses the stored enqueue sequence to identify which waiter should receive the released runner. I reproduced the CI failure locally before the fix. Afterward, all 72 Redis and runner-pool tests passed, and the Redis suite passed 10 consecutive runs. Verification covered the affected suites only. PR: #3795 Comment by: @propr-dev[bot] (ID: 7152463984) Model: GPT-6.2 Astra ProPR-Agent: codex/gpt-6.2-astra
|
Pausing this PR; it stays open as a reference. The review loop stalled at 6/10 on orphan-cleanup edge cases. It is restarted as #3799 with a narrow scope: a Redis-backed shared cap with lease TTLs, deletion only of orphans that carry this deployment's marker and exceed an age limit, retry on |
|
ℹ️ Analyzed the follow-up request by @integry Analysis SummaryWork on #3795 is paused. It stays open as a reference. I made no changes, ran no tests, and generated no previews. #3799 carries the narrower scope of about 1,000 lines: a Redis-backed shared cap with lease TTLs, deletion only of orphans that carry this deployment’s marker and exceed the age limit, bounded retry on No code changes were necessary based on the current state of the branch. 🤖 Analysis Details
💡 ProPR Slash Commands
🤖 Generated by ProPR |
|
Maintainer decision: this PR reached 8/10 and passes the live Sprites test, but an independent review found that another worker can delete a live runner. That happens after a lost heartbeat (a Redis outage) or after a Redis flush, when the startup inventory reaps live runners. The PR also commits test leftovers ( |
|
ℹ️ Analyzed the follow-up request by @integry Analysis SummaryI left #3795 open as a reference and made no changes. The maintainer directed follow-up work to #3799, which already records both live-runner deletion risks—a lost heartbeat during a Redis outage and startup cleanup after a Redis flush—along with the tracked No code changes were necessary based on the current state of the branch. 🤖 Analysis Details
💡 ProPR Slash Commands
🤖 Generated by ProPR |
|
Superseded by #3800 (Sprites runner pool restart on a focused spec), which is merged into the epic after live verification on real Sprites. |
AI Implementation Summary
Closes #3765
Branch:
3765/claude-opus-5-5-sprites-runner-pool-with--20261124-2108-n3lCommits: ✅ Changes committed (3a5a18c)
AI Processing Completed
Execution Details:
Summary:
I've implemented #3765 by extending the existing
SpritePoolrather than replacing it. All the new and existing tests pass, but nothing has run against real Sprites yet. That matters most for warm clones.Shared, bounded pool (Redis leases)
PROPR_SPRITES_MAX(default 2) caps how many runners there are across every worker using the same Sprites token. It is never allowed abovePROPR_SPRITES_ORG_LIMIT(default 3, the Free-plan limit); a larger value is lowered with a warning.packages/core/src/agents/runtime/spritesPool.tsand thesprites/spritesPool*.tsandspritesRunnerPool.tsfiles.Orphan reaping
propr-poollabel and a per-pool label.propr-<uuid>Sprites from older versions once they are over 24 h old, and drops records whose Sprite no longer exists.retainedand is never deleted automatically, because it may hold the only copy of a result. It keeps its slot until someone recovers the result and deletes it by hand.Warm clones (
PROPR_SPRITES_WARM_CLONES=on, off by default)/tmp, the clean checkpoint is restored, and the reference is put back and saved as a warm checkpoint. A later run of the same repository starts from it without a restore. A run of a different repository waits for a clean restore first.Status and run usage
propr admission,GET /api/agent-run-admissionand theget_agent_run_admissionMCP tool show a newspritesPoolsection.propr remote-status,GET /api/statusand the Web UI system status menu show a one-line summary such as "2/2 busy · 1 queued".runnerPool: queue wait, provisioning time, health check and restore timings..env.exampleand the changelog.Things to check before merging
createSprite, andlistAllSpritesreaping. I tested the transport script locally with real git.@fly/sprites0.2.5 SDK has no call to delete a checkpoint.spritesruntime now needs Redis atREDIS_HOST/REDIS_PORT.Tests
test/spritesRunnerPool.test.ts(shared pool across simulated workers) andtest/spritesPoolRedis.test.ts. The Redis test runs 24 concurrent acquisitions across separate connections against a real Redis; it skips when no Redis is available.The preview screenshots caught the queued summary overflowing the status menu, so I shortened the label and text. The previews show the menu with the pool full and a run queued, and with an orphaned runner flagged.
Review digest
Risk-tiered paths
.env.example(+6/−0)packages/api/mcp/presentation.ts(+14/−1)packages/api/mcp/tools.ts(+2/−2)packages/api/mcp/toolsAdmission.ts(+2/−2)packages/api/openapi/routeDocsSystem.ts(+2/−2)packages/api/openapi/schemasAdmission.ts(+28/−0)packages/api/routes/agentRunAdmissionRoutes.ts(+1/−0)packages/api/routes/statusRoutes.ts(+36/−3)packages/api/services/agentRunAdmissionReport.ts(+22/−3)packages/cli/src/api/admission.ts(+16/−0)packages/cli/src/api/system.ts(+13/−0)packages/cli/src/commands/admissionCommands.ts(+23/−1)packages/cli/src/commands/systemCommands.ts(+14/−0)packages/client/src/generated/apiTypes.ts(+46/−0)packages/core/src/agents/runtime/computeUsage.ts(+50/−0)packages/core/src/agents/runtime/sprites/spritesPoolState.ts(added, +242/−0)packages/core/src/agents/runtime/sprites/spritesPoolStore.ts(added, +158/−0)packages/core/src/agents/runtime/sprites/spritesProvisioning.ts(+67/−75)packages/core/src/agents/runtime/sprites/spritesRun.ts(+5/−2)packages/core/src/agents/runtime/sprites/spritesRunnerPool.ts(added, +359/−0)packages/core/src/agents/runtime/spritesPool.ts(added, +172/−0)packages/core/src/agents/runtime/spritesRuntime.ts(+60/−15)packages/core/src/git/workspaceTransportScript.ts(+21/−0)packages/core/src/index.ts(+5/−0)propr-ui/src/api/proprTypes.ts(+11/−0)propr-ui/src/api/systemStatusApi.ts(+21/−1)propr-ui/src/components/GlobalHeaderComponents.tsx(+15/−0)propr-ui/src/components/MobileBottomNavigation.tsx(+1/−0)propr-ui/src/hooks/useHeaderStatsHelpers.ts(+4/−1)CHANGELOG.md(+18/−0)docs/docs/architecture/agent-runtime.md(+31/−3)docs/docs/operations/configuration-reference.md(+3/−0)docs/static/openapi/propr-api.yaml(+142/−2)packages/api/test/agentRunAdmissionRoutes.test.ts(+31/−1)packages/cli/src/commands/admissionCommands.test.ts(+17/−1)propr-ui/src/api/proprApi.status.test.ts(+13/−0)propr-ui/src/components/GlobalHeaderComponents.status.test.tsx(+16/−0)test/helpers/fakeSprites.ts(+49/−9)test/spritesPoolRedis.test.ts(added, +108/−0)test/spritesRunnerPool.test.ts(added, +297/−0)test/spritesRuntime.live.test.ts(+5/−1)test/spritesRuntime.test.ts(+2/−1)test/workspaceTransport.test.ts(+29/−0)Diff size: 43 files changed, +2,177/−126 lines
View task for the run's logs and conversation.
This PR was created automatically by ProPR after processing issue #3765.
💡 Need changes?
Comment on this PR to request refinements — the AI agent monitors comments and will update the implementation based on your feedback. Keep iterating until you're satisfied!
Visual preview
System status: Sprites runner needing attention
The same menu when a stopped worker left an orphaned runner: the row turns amber and explains that the runner will be deleted before its slot is reused.
Full-size original
System status: Sprites runner pool full, run queued
The header's system status menu at 1440px with both Sprites runners busy and one run queued (amber dot).
Full-size original