Repository navigation
[3799 by GPT-6.2 Astra] Sprites runner pool (restart, Astra): shared cap, conservative orphan cleanup, ambiguous restart - #3800
Conversation
Implemented #3799. Workers now share a Redis-backed Sprite cap, defaulting to two. At capacity, runs report “Waiting for a Sprite” and resume when a slot becomes available. Cleanup runs at startup and every five minutes. It checks deployment ownership, lease expiry, and orphan age, and retains the slot until deletion is confirmed. An ambiguous restart now gets up to 60 seconds of readiness probes before the pool discards the Sprite. Pool metrics are available in `propr status`, Web UI runtime settings, and MCP. Run compute usage now records provisioning and checkpoint restore times. Focused runtime, cleanup, API, MCP, and UI tests passed, along with type checks and OpenAPI validation. The live Sprites test was skipped because `PROPR_SPRITES_LIVE_TOKEN` was unavailable. ProPR-Agent: codex/gpt-6.2-astra
|
/ultrafix goal=8 max=8 Besides the review findings, make sure the design avoids the pitfalls listed in #3799 (comment) (found in the earlier attempt #3795): |
|
🔄 Ultrafix loop started (goal: 8/10, max cycles: 8) First action:
|
|
✅ AI Code Review Complete requested by @propr-ultrafix Posted 1 review: |
|
CI failed: Validate Changes Please investigate and fix this CI failure.
Failure evidence
|
Checks FailedValidation failed during setup, tests, CLI packaging, linting, or build checks. View Logs |
|
✅ Applied the requested follow-up changes in commit 5cb7b87 Summary of ChangesFixed the three ESLint warnings that caused Validate Changes to fail on PR #3800. I extracted Sprite initialization from worker startup, moved the pool-status subscription into a dedicated UI component, and grouped related inventory constructor parameters. The settings UI renders the same content. All three affected lint checks passed locally with zero warnings. The root and core builds, UI typecheck, 41 Sprite tests, and seven runtime settings tests also passed. Review digestRisk-tiered paths
Diff size: 3 files changed, +32/−13 lines 🤖 Implementation Details
Undo Changes • View Task Execution 💡 ProPR Slash Commands
🤖 Generated by ProPR |
Fixed the three ESLint warnings that caused **Validate Changes** to fail on PR #3800. I extracted Sprite initialization from worker startup, moved the pool-status subscription into a dedicated UI component, and grouped related inventory constructor parameters. The settings UI renders the same content. All three affected lint checks passed locally with zero warnings. The root and core builds, UI typecheck, 41 Sprite tests, and seven runtime settings tests also passed. PR: #3800 Comment by: @propr-dev[bot] (ID: 7155494539) Model: GPT-6.2 Astra ProPR-Agent: codex/gpt-6.2-astra
|
ℹ️ Analyzed the follow-up request by @github-actions[bot] Analysis SummaryCommit No code changes were necessary based on the current state of the branch. 🤖 Analysis Details
💡 ProPR Slash Commands
🤖 Generated by ProPR |
🔍 AI Code Review — codex:gpt-6-astraOverall EvaluationThe PR implements shared Sprite capacity, cleanup, status reporting, and timing persistence, but needs changes before merge: cleanup lacks the required provider-side active-run check, and compute wall time excludes queueing. ✅ Atomic capacity reservation — The Redis Lua script reserves capacity before creation and counts unresolved inventory entries against the cap. ✅ Confirmed deletion — An acknowledged delete that leaves a Sprite visible retains its capacity slot, with a focused regression test. ✅ Timeout separation — The execution timeout starts after acquisition and preparation, so waiting does not consume it. This review is a static analysis of the supplied code; no commands were run. Current checks show 29 passed, five pending, and no failures. Merge blockersEvery finding below was introduced by this PR and must be resolved before merging. F1: 🔴 Verify inactivity before orphan deletion
F2: 🔴 Include queueing in compute wall time
SuggestionsThese are optional follow-ups and are not sent to S1: 🟢 Exercise production Redis behaviorThe new tests use ScoreThe capacity and reporting implementation is substantial and focused, but automatic cleanup can delete active work, and the timing report misses an explicit requirement. These blockers remain despite the currently passing checks. Score: 5/10 🤖 Review Details
Copy and edit to choose records from this review: 🤖 Review by ProPR |
|
✅ Applied the requested follow-up changes in commit 758fb42
Summary of ChangesAddressed F1 and F2 in PR #3800.
Core typecheck and Review digestRisk-tiered paths
Diff size: 6 files changed, +133/−20 lines 🤖 Implementation Details
💡 ProPR Slash Commands
🤖 Generated by ProPR |
Addressed F1 and F2 in PR #3800. - **F1:** Orphan cleanup requires an empty session list from the Sprite and revalidates the cleaner lease before deletion. Active sessions and failed probes retain the slot for retry. Worker-side discard also rechecks ownership before deleting. - **F2:** Compute wall time includes queueing, provisioning, and restore, counting overlapping time once. The execution timeout still starts after checkout and setup. Core typecheck and `git diff --check` passed. All 55 focused tests passed. The live Sprite test was skipped because `PROPR_SPRITES_LIVE_TOKEN` was unavailable. No `.propr` files changed. PR: #3800 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: |
|
CI failed: Validate Changes Please investigate and fix this CI failure.
Failure evidence
|
Checks FailedValidation failed during setup, tests, CLI packaging, linting, or build checks. View Logs |
|
✅ Applied the requested follow-up changes in commit 13fffb3 Summary of ChangesFixed the I reproduced the CI lint error locally and verified that the full Review digestRisk-tiered paths
Diff size: 1 file changed, +1/−1 lines 🤖 Implementation Details
Undo Changes • View Task Execution 💡 ProPR Slash Commands
🤖 Generated by ProPR |
Fixed the `Validate Changes` failure by removing an unused `catch` binding from [spritesInventory.ts](/home/node/workspace/packages/core/src/agents/runtime/sprites/spritesInventory.ts:270). The orphan cleanup handler still logs the same warning and follows the same recovery path. I reproduced the CI lint error locally and verified that the full `@propr/core` lint check now passes with zero warnings. `git diff --check` also passed. PR: #3800 Comment by: @propr-dev[bot] (ID: 7156489893) Model: GPT-6.2 Astra ProPR-Agent: codex/gpt-6.2-astra
|
ℹ️ Analyzed the follow-up request by @github-actions[bot] Analysis SummaryCommit No code changes were necessary based on the current state of the branch. 🤖 Analysis Details
💡 ProPR Slash Commands
🤖 Generated by ProPR |
🔍 AI Code Review — codex:gpt-6-astraOverall EvaluationThe PR implements shared Sprite capacity, lease-aware cleanup, restart recovery, and pool reporting with focused tests. No merge-blocking defect was verified in the supplied code. Merge readiness is conditional on the five pending checks completing successfully. ✅ Atomic capacity reservation — Redis Lua reserves capacity before creation; ambiguous creates retain their inventory entries. ✅ Conservative orphan cleanup — Cleanup checks deployment ownership, provider creation time, session inactivity, and cleaner ownership. Capacity remains occupied until absence is confirmed. ✅ Separate execution timeout — Capacity waiting precedes the execution timeout, while compute wall time includes that wait and the applicable preparation time. This was a static review of the supplied diff and context; no commands were run. Merge blockersNo merge blockers. SuggestionsThese are optional follow-ups and are not sent to S2: 🟢 Exercise real service boundariesThe new tests cover useful failure sequences with ScoreThe implementation addresses the requested behavior with focused recovery tests and consistent API/UI reporting. Current checks show no failures, though five remain pending and live provider behavior was not independently verified here. Score: 8/10 🤖 Review Details
Copy and edit to choose records from this review: 🤖 Review by ProPR |
|
/ultrafix goal=8 max=5 Independent maintainer review at 13fffb3. Live results on real Sprites with a scratch Redis, all PASS (keep this behaviour):
Fix these:
|
|
🔄 Ultrafix loop started (goal: 8/10, max cycles: 5) First action:
|
|
✅ AI Code Review Complete requested by @integry Posted 1 review: |
🔍 AI Code Review — codex:gpt-6-astraOverall EvaluationThis PR adds shared Sprite capacity, lease-based cleanup, restart recovery, and pool visibility across API, CLI, and UI. It needs significant corrections before merge, particularly around Redis loss and ambiguous restart recovery. ✅ Conservative orphan cleanup — Cleanup checks deployment ownership, age, lease availability, and session inactivity, and retains capacity when deletion cannot be confirmed. ✅ Useful operational visibility — Pool counts reach status, settings, and MCP without exposing Sprite names through the admission report. ✅ Focused lifecycle coverage — Added tests cover competing workers, ownership loss, external deletion, and unconfirmed deletion. This review is a static analysis of the supplied code; no commands or tests were run. Current-head checks report 33 passed, one pending, and no failures. Merge blockersEvery finding below was introduced by this PR and must be resolved before merging. F3: 🔴 Redis inventory loss permanently breaks reservation
F4: 🔴 Redis loss changes deployment ownership
F5: 🔴 Local ownership expires after the Redis lease
F6: 🔴 Readiness does not prove restart completion
F7: 🔴 Phase failures strand newly provisioned capacity
SuggestionsThese are optional follow-ups and are not sent to S3: 🟢 Bound and coordinate capacity waiting
S4: 🟢 Separate startup from maintenance latency
S5: 🟢 Exercise ambiguous creation explicitlyThe current expiry test covers a reservation with no created machine, but not a timed-out create whose provider-side outcome remains unresolved. Add a regression covering delayed creation and temporary absence responses, and document which provider evidence establishes final absence. The supplied code and live results do not establish that a single post-expiry 404 is sufficiently authoritative to classify this separately as a verified blocker. ScoreThe implementation has useful coverage and operational integration, but five verified recovery and lifecycle defects prevent merging. Passing checks do not exercise the demonstrated failure paths. Score: 5/10 🤖 Review Details
Copy and edit to choose records from this review: 🤖 Review by ProPR |
|
✅ Applied the requested follow-up changes in commit 41bf418
Summary of ChangesImplemented F3–F7 for PR #3800. Reservation now rebuilds missing Redis inventory from provider listings and surviving leases before admitting capacity. Existing deployment markers migrate to the shared data directory. Local lease deadlines start at send time and include a 10-second cancellation margin. Sprite reuse now requires a changed boot ID. Reservation and phase transitions retry lost Redis replies with jittered backoff. If checkout or recycling still fails, the pool verifies ownership before deleting the Sprite. Verification: 64 focused tests passed. The live Sprites test skipped because Upgrade: Stop the previous workers together and retain Redis until a new worker persists the legacy marker. Separate finding: A credential export already in progress can still begin its read-back after lease loss. The export helper has no lease signal. Review digestRisk-tiered paths
Diff size: 8 files changed, +434/−67 lines 🤖 Implementation Details
💡 ProPR Slash Commands
🤖 Generated by ProPR |
|
✅ AI Code Review Complete requested by @propr-ultrafix Posted 1 review: |
|
CI failed: Validate Changes Please investigate and fix this CI failure.
Failure evidence
|
Checks FailedValidation failed during setup, tests, CLI packaging, linting, or build checks. View Logs |
|
✅ Applied the requested follow-up changes in commit b6a54cf Processed 2 comments:
Summary of ChangesFixed all three lint warnings in The changed file passed ESLint with zero warnings, the core package built successfully, and all 65 focused Sprite pool and runtime tests passed locally. Review digestRisk-tiered paths
Diff size: 1 file changed, +35/−30 lines 🤖 Implementation Details
Undo Changes • View Task Execution 💡 ProPR Slash Commands
🤖 Generated by ProPR |
Fixed all three lint warnings in `SpritePool.acquire()` by extracting the reservation and backoff logic into a helper. The refactor preserves queue deadlines, cancellation cleanup, and queue-time accounting. The changed file passed ESLint with zero warnings, the core package built successfully, and all 65 focused Sprite pool and runtime tests passed locally. PR: #3800 Comment by: @propr-dev[bot] (ID: 7160211916) Comment by: @github-actions[bot] (ID: 7160213189) Model: GPT-6.2 Astra ProPR-Agent: codex/gpt-6.2-astra
🔍 AI Code Review — codex:gpt-6-astraOverall EvaluationThe PR implements a deployment-wide Redis-backed Sprite cap, capacity waiting, orphan reconciliation, restart verification, and pool visibility across API, CLI, and UI. The supplied code is merge-ready within the reviewed scope, subject to normal current-head validation. ✅ Conservative capacity accounting — Reservations precede creation, and failed or unconfirmed deletion retains capacity until reconciliation establishes absence. ✅ Ownership-aware recovery — Redis mutations check lease ownership, local lease deadlines account for acknowledgement delay, and lease loss propagates to running executions. ✅ Focused regression coverage — Added tests exercise competing workers, lost Redis state, delayed acknowledgements, restart ambiguity, and result reads after lease expiry. This was a static review of the supplied diff and surrounding context; no commands were run. No current-head check results were reported, so historical lint failures were not treated as current failures. Merge blockersNo merge blockers. SuggestionsThese are optional follow-ups and are not sent to S13: 🟢 Exercise scripts against real RedisThe new pool tests use ScoreThe implementation addresses the stated objective with careful ownership and cleanup handling, and no merge-blocking defect was established from the supplied code. Current-head automated validation remains unreported. Score: 8/10 🤖 Review Details
Copy and edit to choose records from this review: 🤖 Review by ProPR |
Maintainer review (independent, at b6a54cf)The earlier items are fixed: background startup sweep, generation-tolerant sweep, slot release when no create was sent, no full-keyspace SCAN, queueMs recorded, withRetry. 👍 Below are the remaining items that affect normal operation. The rarer Redis-flush edge cases are filed separately so this PR can converge.
Keep the size budget. |
|
✅ Applied the requested follow-up changes in commit 0497392 Summary of ChangesApplied the maintainer’s follow-up changes to PR #3800. Concurrent reservations can fill a healthy empty pool without listing provider Sprites. The queue deadline covers the first reservation, an acknowledged success is kept, and a failed checkout cleans up its slot under the ownership fence. Each restart request now has its own 60-second timeout and 60-second verification window. A transient error triggers boot ID or uptime verification, and the pool retries once before discarding the Sprite. Queue time is visible in the compute chip, cost exports, and MCP results. Startup sweep failures log their cause, and inventory retries stop on timeout or lease expiry. Verification: 88 focused tests passed across the runtime, API, MCP, and UI. Core, API, and UI type checks passed. The live provider test was skipped because Review digestRisk-tiered paths
Diff size: 13 files changed, +139/−64 lines Visual previewQueue time in the run summaryThe Consumption group shows 18 seconds queued alongside Sprite wall time and token usage, using fixture data. 🤖 Implementation Details
Undo Changes • View Task Execution 💡 ProPR Slash Commands
🤖 Generated by ProPR |
Applied the maintainer’s follow-up changes to PR #3800. Concurrent reservations can fill a healthy empty pool without listing provider Sprites. The queue deadline covers the first reservation, an acknowledged success is kept, and a failed checkout cleans up its slot under the ownership fence. Each restart request now has its own 60-second timeout and 60-second verification window. A transient error triggers boot ID or uptime verification, and the pool retries once before discarding the Sprite. Queue time is visible in the compute chip, cost exports, and MCP results. Startup sweep failures log their cause, and inventory retries stop on timeout or lease expiry. **Verification:** 88 focused tests passed across the runtime, API, MCP, and UI. Core, API, and UI type checks passed. The live provider test was skipped because `PROPR_SPRITES_LIVE_TOKEN` was unavailable. The PR remains within budget at 990 added non-test lines, including the lockfile. PR: #3800 Comment by: @integry (ID: 7160589782) Model: GPT-6.2 Astra ProPR-Agent: codex/gpt-6.2-astra
|
/ultrafix goal=8 max=5 |
|
🔄 Ultrafix loop started (goal: 8/10, max cycles: 5) First action:
|
|
✅ AI Code Review Complete requested by @integry Posted 1 review: |
|
CI failed: Full Test Suite Shard 3/4, Full Test Suite Shard 4/4, Full Test Suite Shard 1/4, Full Test Suite Native Electron (hosted), Run Full Test Suite, Connect Discovery and Darwin ACL (Node 22) Please investigate and fix these CI failures.
Failure evidence
Failure evidence
Failure evidence
Failure evidence
Depends on the failed job(s): Failure evidence
Failure evidence
|
Full Test Suite ResultsValidation failed during: Workspace build (docs job), Workspace build (shard 1), Workspace build (shard 2), Workspace build (shard 3), Workspace build (shard 4), Shard coverage verification, Hosted native Electron units.
View shard 1/4 outputView shard 2/4 outputView shard 3/4 outputView shard 4/4 output |
🔍 AI Code Review — codex:gpt-6-astraOverall EvaluationThe PR implements shared Sprite capacity, ownership-aware cleanup, restart verification, and pool observability. The supplied diff appears merge-ready within the reviewed scope; no merge blocker was verified. ✅ Capacity stays reserved — Redis reservations precede creation, and failed or unconfirmed deletion keeps machines counted against the cap. ✅ Ownership loss propagates — Local lease deadlines abort execution, prevent checkout and release, and suppress file results returned after lease loss. ✅ Useful operational visibility — Pool counts reach CLI, UI, and MCP; queue time is recorded separately from provisioning and execution. This was a static review only, as requested. Current-head checks show three skipped checks and no passed, pending, or failed checks; historical failures were not treated as current failures. Merge blockersNo merge blockers. SuggestionsThese are optional follow-ups and are not sent to S14: 🟢 Exercise real Redis recoveryThe recovery tests in S15: 🟢 Validate provider restart behaviorA live test covering ambiguous restart responses and subsequent checkpoint restoration would complement the fake-provider tests. The supplied context says live testing lacked credentials, so actual provider behavior remains unverified; this is a useful follow-up rather than a demonstrated code defect. ScoreThe implementation has substantial failure-path coverage and no verified blocker in the supplied code. Confidence is limited by static-only review and the absence of successful current-head checks. Score: 8/10 🤖 Review Details
Copy and edit to choose records from this review: 🤖 Review by ProPR |
|
✅ Applied the requested follow-up changes in commit 0178301 Processed 2 comments:
Summary of ChangesFixed the TypeScript error that blocked all four shards during the workspace build. The CI workspace build passed locally, the exact Fly call from the PR merge build type-checked, and all 189 focused retry and Sprite tests passed. The hosted shards still need a CI rerun. Review digestRisk-tiered paths
Diff size: 1 file changed, +4/−1 lines 🤖 Implementation Details
Undo Changes • View Task Execution 💡 ProPR Slash Commands
🤖 Generated by ProPR |
Fixed the TypeScript error that blocked all four shards during the workspace build. `calculateDelay` now accepts both Fly’s full retry configuration and Sprite queueing’s delay-only configuration. The delay calculation itself is unchanged. The CI workspace build passed locally, the exact Fly call from the PR merge build type-checked, and all 189 focused retry and Sprite tests passed. The hosted shards still need a CI rerun. PR: #3800 Comment by: @propr-dev[bot] (ID: 7160857325) Comment by: @github-actions[bot] (ID: 7160876955) Model: GPT-6.2 Astra ProPR-Agent: codex/gpt-6.2-astra
|
/review |
|
✅ AI Code Review Complete requested by @integry Posted 1 review: |
🔍 AI Code Review — codex:gpt-6-astraOverall EvaluationThe PR implements shared Sprite capacity, lease-aware cleanup, restart verification, and pool observability with substantial regression coverage. It is merge-ready within the reviewed scope, conditional on the pending checks completing successfully. ✅ Atomic capacity reservations — Redis scripts reserve slots before creation and count ambiguous creates against the cap. ✅ Conservative orphan cleanup — Cleanup checks deployment ownership, provider creation time, active sessions, and cleaner ownership before deletion; capacity is retained until absence is confirmed. ✅ Bounded admission and restart recovery — Capacity waits have a configurable deadline and jittered backoff. Restart recovery uses bounded probes to verify an actual reboot. This assessment is a static review of the supplied diff and surrounding context. No commands were run. The authoritative current-head status reports no failures and nine pending checks; historical failures are not treated as current blockers. Merge blockersNo merge blockers. SuggestionsThese are optional follow-ups and are not sent to S16: 🟢 Exercise scripts against real RedisThe new pool tests extensively exercise concurrency and recovery using ScoreThe implementation addresses the scoped behavior with explicit ownership safeguards and focused regression tests. Remaining checks are pending, and this review did not independently execute tests. Score: 8/10 🤖 Review Details
Copy and edit to choose records from this review: 🤖 Review by ProPR |

AI Implementation Summary
Closes #3799
Branch:
3799/gpt-6.2-astra-sprites-runner-pool-resta-20261125-0640-bjhCommits: ✅ Changes committed (2ba82f2)
AI Processing Completed
Execution Details:
Summary:
Implemented #3799. Workers now share a Redis-backed Sprite cap, defaulting to two. At capacity, runs report “Waiting for a Sprite” and resume when a slot becomes available.
Cleanup runs at startup and every five minutes. It checks deployment ownership, lease expiry, and orphan age, and retains the slot until deletion is confirmed. An ambiguous restart now gets up to 60 seconds of readiness probes before the pool discards the Sprite.
Pool metrics are available in
propr status, Web UI runtime settings, and MCP. Run compute usage now records provisioning and checkpoint restore times.Focused runtime, cleanup, API, MCP, and UI tests passed, along with type checks and OpenAPI validation. The live Sprites test was skipped because
PROPR_SPRITES_LIVE_TOKENwas unavailable.Review digest
Risk-tiered paths
package-lock.json(+89/−11): lockfilepackage.json(+4/−3): dependency manifestpackages/core/src/db/migrations/20261125000000_add_sprite_pool_timings.js(added, +17/−0): database migration.env.example(+3/−0)packages/api/mcp/toolsAdmission.ts(+1/−1)packages/api/openapi/schemasAdmission.ts(+1/−0)packages/api/routes/statusRoutes.ts(+5/−2)packages/api/services/agentRunAdmissionReport.ts(+5/−2)packages/api/services/spritePoolStatus.ts(added, +21/−0)packages/api/services/systemHealthWatcher.ts(+1/−0)packages/cli/src/api/system.ts(+2/−0)packages/cli/src/commands/systemCommands.ts(+5/−0)packages/client/src/generated/apiTypes.ts(+8/−0)packages/core/src/agents/runtime/computeUsage.ts(+4/−0)packages/core/src/agents/runtime/sprites/spritesInventory.ts(added, +249/−0)packages/core/src/agents/runtime/sprites/spritesProvisioning.ts(+109/−30)packages/core/src/agents/runtime/spritesRuntime.ts(+48/−12)packages/core/src/utils/llmExecutionColumns.ts(+2/−0)packages/core/src/webhook/checkRunHelpers.ts(+13/−13)packages/shared/src/index.ts(+1/−1)packages/shared/src/statusKeys.ts(+27/−0)propr-ui/src/api/proprTypes.ts(+3/−0)propr-ui/src/api/systemStatusApi.ts(+1/−0)propr-ui/src/components/TaskDetails/types.ts(+2/−0)propr-ui/src/pages/SettingsPage/AgentRuntimePackagesSection.tsx(+18/−0)src/worker.ts(+5/−1)docs/docs/architecture/agent-runtime.md(+5/−0)docs/static/openapi/propr-api.yaml(+29/−0)packages/api/test/agentRunAdmissionRoutes.test.ts(+3/−0)test/helpers/fakeSprites.ts(+12/−0)test/llmMetricsRecording.test.ts(+2/−2)test/spritesPool.test.ts(added, +158/−0)test/spritesRuntime.test.ts(+24/−1)New dependencies (1):
ioredis-mockinpackage.jsonDiff size: 33 files changed, +877/−79 lines
View task for the run's logs and conversation.
This PR was created automatically by ProPR after processing issue #3799.
💡 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
Sprite pool in runtime settings
The runtime settings component showing one active and one idle Sprite in a two-slot pool, using fixture data.
Full-size original