Repository navigation
[3764 by Claude Opus 5.5] SpritesRuntime: run agents on Fly Sprites - #3786
propr-dev[bot] wants to merge 13 commits into
Conversation
I've implemented `SpritesRuntime` (`packages/core/src/agents/runtime/spritesRuntime.ts`): selecting `sprites` now runs Claude Code and Codex agents on Fly Sprites. It has not been run against a real Sprite, because no Sprites token was available here. Everything was tested against a mocked SDK, and the generated bash scripts were run locally with real bash. Tested - 14 new unit tests with a fake SDK pass. They cover the first run, a later run that restores the checkpoint, a dropped connection resuming without lost or repeated output, a Sprite going cold, the timeout, stop, reattaching after a restart, and skipping a busy Sprite. Breaking the resume offset on purpose makes the reconnect test fail. - The root launcher script ran with real bash in a sandbox: environment isolation, prompt on stdin, separate logs, exit status, refreshed-token return, workspace result copy and credential cleanup all worked. The output-following script resumed correctly, including across multi-byte UTF-8. - The neighbouring runtime, credential, image-preparation and worktree-sweep suites, the settings UI tests (398), the new browser test, lint and typecheck all pass. - The live test is `test/spritesRuntime.live.test.ts`. It is skipped unless `PROPR_SPRITES_LIVE_TOKEN` is set; with a token it provisions a real Sprite, runs the pinned `claude --version` through the entrypoint, and prints the startup timings. How a run works - Sprites: each worker keeps its own pool, `<prefix>-<worker>-<slot>`, with one run per Sprite. A Sprite is created on first use, set up once, checkpointed, and restored to that clean checkpoint before every later run. - Command mapping: a Sprite can't boot the `propr/agent` image, so `scripts/sprites-agent-setup.sh` rebuilds what the entrypoints need. It creates a `node` user (not in sudoers), adds the privilege-drop tools, installs the existing entrypoint scripts, and pins the CLI versions read from `Dockerfile.agent`. That covers Claude Code, Codex and Antigravity (`agy`) 1.5.15, so a Sprite runs the same CLIs as the image. - Launch: a root launcher runs the run's existing entrypoint, setup wrapper, clone wrapper and CLI arguments unchanged, as `docker run --user 0:0` would. - Workspace and credentials: runs always use the clone transport. The credential broker uploads only each provider's credential files over the filesystem API (mode 0600), installs them under `/home/node` (the Sprite's own `~/.claude` and `~/.codex` are never touched), writes refreshed tokens back under the store lock, and deletes the copies after the run. - Output: the SDK's detachable sessions are forced into TTY mode, which would mix stdout and stderr. So the session only hosts the launcher, and output is followed with two separate `tail` processes that resume from the bytes already received after a dropped connection. - Keep-awake and cold pause: the open connections plus a periodic renewal keep the Sprite awake. If the Sprite goes cold, the run fails with `SpritesRunInterruptedError`; nothing can hang. Timeouts, cancellation, the spend cap and the watchdog stop the run through the launcher (TERM, then KILL). - Startup overhead: each run logs one `Sprites run startup overhead` line with queue, wake/create, setup, restore, credential sync, clone and total times. The fields are documented in `agent-runtime.md`. - Settings: `PROPR_SPRITES_TOKEN`, name prefix, region and the other options are documented in `agent-runtime.md` and `.env.example`. `SPRITES_CLIENT_SIGNALS=0` is set unless the operator set it. Agents get a `runtime` field, validated by the API, and the Web UI agent dialog has a Runtime selector (Instance default / Docker / Fly Sprites). - Issue comment 2: when no enabled agent uses Docker, the worker now skips agent image preparation, the image checks, and the Docker part of the worktree sweep. Limits and assumptions - The SDK (0.2.5) has no Tasks/keep-awake API, so keep-awake is a cheap command on the Sprite every 30 s. How checkpoint restore behaves is assumed from the SDK, not observed. - The Sprite needs passwordless `sudo` for its default user. The setup script fails clearly without it. - `attach()` can follow a run after a worker restart, but nothing in the worker calls it yet. - The task-state reconciler still checks liveness through Docker. - Docker's agent-slot admission doesn't count Sprites runs; the spend cap and watchdog do apply. - Restricted network mode is refused on Sprites rather than enforced, and native goal sessions still need Docker. - Antigravity is pinned by the setup script but not yet runnable on Sprites. - Several ProPR processes on one host should each set `PROPR_SPRITES_WORKER_ID`. As a safeguard, a Sprite already running another process's launcher is skipped. `@fly/[email protected]` is a new `@propr/core` dependency. It declares Node ≥24 but works on Node 22, and the app image now includes the setup script. I added an e2e test for the selector, and the previews of the dialog are ready for the PR. 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: |
Live test against real Sprites (2026-11-24, head
|
| Run | wake | setup / restore | credential sync | total |
|---|---|---|---|---|
| First (provisions the Sprite) | 5.7 s | setup 21.5 s | 2.6 s | 30.3 s |
| Warm | 0.8 s | checkpoint restore 3.5 s | 2.6 s | 7.5 s |
Exit code 0, pinned Claude Code version confirmed, and the Switching to node user entrypoint contract holds. The SQLite glibc error in the local test output comes from this test host's glibc 2.31 and is unrelated to Sprites.
Next I'm running real tasks with Claude, Codex and Antigravity on a Sprite, including credential write-back. Results will follow here.
|
✅ Applied the requested follow-up changes in commit 3ac7138 Summary of ChangesI've fixed both provisioning bugs from your live run in 1. No 2. npm 12 blocking the Claude Code postinstall. Two differences from your patch:
Tests: the new
All 3 new tests pass, and so do the existing 14 in I also added a sentence on both points to the Setup step in Review digestRisk-tiered paths
Diff size: 3 files changed, +148/−14 lines 🤖 Implementation Details
Undo Changes • View Task Execution 💡 ProPR Slash Commands
🤖 Generated by ProPR |
I've fixed both provisioning bugs from your live run in `scripts/sprites-agent-setup.sh` and added fake-Sprite coverage. I haven't re-run the live test against a real Sprite after these changes, so your rerun is the real check. **1. No `node` when setup runs as root.** I used your symlink approach rather than `sudo -n env PATH=...`, because the links in `/usr/local/bin` also give the `node` user and the entrypoints a `node`. A new function, `link_sprite_node`, runs before the required-tool check. If `node` is missing and `/.sprite/bin/node` exists, it asks the shim for `process.execPath` and links the real `node`, `npm` and `npx` into `/usr/local/bin`. That directory is in sudo's `secure_path`. It does nothing if `node` is already on the PATH or there is no shim, so in that case setup still stops with the clear "required tool node is missing" error. **2. npm 12 blocking the Claude Code postinstall.** `pin_npm_cli` now passes `--allow-scripts="$package"`, as in your patch. It only allows the pinned package's own scripts. **Two differences from your patch:** - **Script layout:** both functions are now defined at the top of the script. When the script is sourced rather than run, it returns right after defining them, so the tests can call them without root. Running it normally works as before. - **Error handling:** I replaced the `[ -e ] && ln` loop with an explicit `if`, so a missing `npx` can't trip `set -e`. **Tests:** the new `test/spritesAgentSetup.test.ts` runs the functions with real bash against a fake Sprite layout: - **PATH without `node`:** `link_sprite_node` resolves the shim's real bin directory, links all three tools, and `node`, `npm` and `npx` then run. - **No changes needed:** nothing is linked when `node` is already present or there is no shim. - **`--allow-scripts`:** a fake `npm` records its arguments and shows `pin_npm_cli` passes `--allow-scripts=@anthropic-ai/claude-code`, the pinned package, the prefix, and links the binary. All 3 new tests pass, and so do the existing 14 in `test/spritesRuntime.test.ts`. When I removed the flag and the linking, the first and third tests failed, so they do catch both bugs. I also added a sentence on both points to the Setup step in `docs/docs/architecture/agent-runtime.md`. Since the setup revision hashes the setup files, existing Sprites will be provisioned again on their next run and pick up the fix. PR: #3786 Comment by: @integry (ID: 7130049805) Model: Claude Opus 5.5 ProPR-Agent: claude/claude-opus-5-5
Live E2E: Claude Code, Codex and Antigravity on a real SpriteAll three ran end to end through the real path:
The credential stores pointed at copies. Hashes were unchanged after the runs, so no token rotated, nothing was written back, and no Claude or Codex credential files were left on the Sprite. Findings
|
|
✅ Applied the requested follow-up changes in commit 3b2883e Summary of ChangesI fixed findings 1 and 2. All of this was tested against the fake Sprite only, not a real one. Finding 3 (batching the credential sync) is not done. 1. Antigravity runs on Sprites
2. Run data no longer stays on the Sprite after
Results
The docs ( Review digestRisk-tiered paths
Diff size: 12 files changed, +271/−31 lines Visual previewAntigravity agent dialog with Fly SpritesAdd-agent dialog (Antigravity) at desktop width with the Runtime selector set to Fly Sprites and no unsupported-agent warning Fly Sprites runtime for AntigravityRuntime selector of a new Antigravity agent with Fly Sprites selected; it was previously disabled for Antigravity 🤖 Implementation Details
Undo Changes • View Task Execution 💡 ProPR Slash Commands
🤖 Generated by ProPR |
I fixed findings 1 and 2. All of this was tested against the fake Sprite only, not a real one. Finding 3 (batching the credential sync) is not done. **1. Antigravity runs on Sprites** - `antigravity` is now in `SPRITES_SUPPORTED_AGENTS` (`spritesCommand.ts`). - The Web UI had its own Claude/Codex-only list, so the agent dialog blocked Fly Sprites for Antigravity too. That list and its message now include Antigravity. The API never filtered by agent type, so it needed no change. - New test: an Antigravity run goes through the runtime with its credential store at `/home/node/.gemini-source`, runs `antigravity-entrypoint.sh` → `agy`, and returns `result.bundle`. The UI test now checks Fly Sprites is enabled for Antigravity and still disabled for Vibe. **2. Run data no longer stays on the Sprite after `release()`** - **Restore at release:** I took your suggested fix. `release()` now restores the clean checkpoint, which removes the clone workspace with `.git`, `/tmp/propr-workspace-result` with `result.bundle`, `/tmp/propr-antigravity-home` with the OAuth token, and the run directory. - **Next run skips its restore:** after restoring, the worker writes a marker in `/tmp/propr-sprite-runs`, which the `node` user can't write to. The next run removes the marker before it uses the Sprite, and if it finds one it starts without restoring, so the ~3 s comes off warm startup. With no marker (a worker crash, or a restore that failed), the run restores before it starts, as it did before. - **Removal when restore isn't possible:** with `PROPR_SPRITES_RESTORE_CHECKPOINT=false`, or if the restore fails, release removes those three paths and every credential target as root instead (`sudo rm -rf`). The Sprite is then left unmarked. - **One exception:** a run directory holding a refreshed token that couldn't be written back is still kept, and that Sprite is not restored at release. The other paths are still removed. - **Tests:** the fake Sprite's checkpoints now save and restore its whole filesystem. The new tests check that: - after `release()`, nothing outside the checkpoint is left except the marker. - the next run skips the restore. - with restore turned off, none of the three paths survive. - a failed restore falls back to removing them and leaves the Sprite unmarked. With the old release code, these tests and the updated main-flow test fail. **Results** - `test/spritesRuntime.test.ts`: 17 pass. - The neighbouring runtime registry, native-goal and agent validation suites pass: 48 tests. - The `AgentConfigModal` UI tests pass: 10 tests. - The runtime-selector Playwright spec passes. - Lint and typecheck pass for core and the UI. The docs (`agent-runtime.md`, `coding-agent-integration.md`) and `.env.example` now describe the restore at release, the `restoreMs` field (it only appears when no restore happened at release), and Antigravity support. I captured a preview of the agent dialog with an Antigravity agent set to Fly Sprites. PR: #3786 Comment by: @integry (ID: 7130238140) Model: Claude Opus 5.5 ProPR-Agent: claude/claude-opus-5-5
|
CI failed: Full Test Suite Shard 2/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 07225e2 Summary of ChangesI fixed the Shard 2/4 failure. Only one test file failed: Cause: that test replaces Fix: I added Checked:
There's nothing visual in this change, so I made no previews. Review digestRisk-tiered paths
Diff size: 1 file changed, +1/−0 lines 🤖 Implementation Details
Undo Changes • View Task Execution 💡 ProPR Slash Commands
🤖 Generated by ProPR |
Full Test Suite ResultsValidation failed during: Test shard (shard 2).
View shard 2/4 outputDetails truncated; see the uploaded artifacts for complete failure rows and logs. |
I fixed the Shard 2/4 failure. Only one test file failed: `test/reviewContextSettings.test.ts`, and it crashed while loading rather than failing an assertion: ``` SyntaxError: The requested module '@propr/core' does not provide an export named 'registeredAgentRuntimes' ``` **Cause:** that test replaces `@propr/core` with a mock that lists each export by name. This PR made `packages/api/routes/configAgentValidation.ts` import `registeredAgentRuntimes` from `@propr/core` to check the new agent `runtime` field. The settings route the test loads pulls in that file, and the mock didn't provide the new export, so the module couldn't load. **Fix:** I added `registeredAgentRuntimes: () => ['docker', 'sprites']` to the mock's exports in `test/reviewContextSettings.test.ts`. No production code changed. **Checked:** - Run with module mocking enabled, the test file as it was at HEAD hits the same `SyntaxError` (0 pass, 1 fail). With the fix, all 10 tests pass. - The only other test that mocks `@propr/core` with a similar export list is `test/planIssueImplementationTrigger.test.ts`. It doesn't load the validation module, so it isn't affected. - I didn't re-run the whole shard locally. There's nothing visual in this change, so I made no previews. PR: #3786 Comment by: @propr-dev[bot] (ID: 7130904004) Model: Claude Opus 5.5 ProPR-Agent: claude/claude-opus-5-5
|
ℹ️ Analyzed the follow-up request by @github-actions[bot] Analysis SummaryThe current branch already fixes this failure, so I made no changes. Why it failed: Why it's already fixed: this report came from a run before the latest commit. Its timestamps are around 12:02 UTC, and the current head What I ran on the current head, using the CI runner
Shard 2 should pass once the full suite reruns on the current head. I didn't create a visual preview, because nothing in the UI changed. 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 EvaluationThis PR adds a substantial Sprites runtime with credential transfer, checkpoint reuse, output recovery, and UI configuration. It needs significant corrections before merge: cleanup can affect another run, retained credentials can be destroyed, deadlines do not cover preparation, and forced termination can leave descendants running. ✅ Output recovery — Separate logs, byte offsets, and persistent UTF-8 decoders support reconnecting without replaying received output. ✅ Restricted-network refusal — Sprites explicitly declines restricted networking through the existing capability checks. ✅ Current validation — All 24 authoritative current-head checks passed; the historical shard failure is resolved. This review uses static analysis of the supplied code. No commands were run. Merge blockersEvery finding below was introduced by this PR and must be resolved before merging. F1: 🔴 Retained credentials disappear on reuse
F2: 🔴 Failed preparation releases cleanup authority twice
F3: 🔴 Deadlines exclude queueing and preparation
F4: 🔴 Forced stop leaves descendant processes alive
SuggestionsThese are optional follow-ups and are not sent to S1: 🟢 Expand the live smoke testThe opt-in live test runs ScoreThe implementation has useful coverage and green current checks, but the verified lifecycle defects can destroy recovery data or disrupt other runs. These need correction before merge. 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 e4a9fba
Summary of ChangesAll four findings are fixed in the Sprites runtime. The Sprites suite passes (23 tests, 6 of them new), as do the neighbouring runtime registry and native-goal suites, lint and core typecheck. None of this has run against a real Sprite: the runtime tests use the fake SDK, and only the process-killing scripts ran with real bash and real processes in this container. F1 – retained credentials survive reuse. When write-back fails, the run now writes a
F2 – cleanup runs once. A failed launch and F3 – the deadline covers the whole run. It now starts when the run is requested, so waiting for a Sprite, first-time setup, provisioning and upload all count against it. It is checked again just before the session is created. A run that expires before starting returns the normal timeout result and never starts a session. If setup is still running at that point, the run settles on time but the Sprite is freed only after setup ends and the cleanup above has run. F4 – a stop kills the whole process tree.
The new tests fail against the original code: the F1 and F2 tests fail outright, and the F3 tests hang, since a queued run never settled. The real-process test fails against the original scripts. Limits you should know about:
One unrelated thing I noticed: this agent container's init doesn't reap orphaned processes, so killed processes linger as zombies. The scripts now treat zombies as dead, which on a real Sprite only matters if its init behaves the same way. There's nothing visible to preview. Review digestRisk-tiered paths
Diff size: 8 files changed, +554/−88 lines 🤖 Implementation Details
💡 ProPR Slash Commands
🤖 Generated by ProPR |
All four findings are fixed in the Sprites runtime. The Sprites suite passes (23 tests, 6 of them new), as do the neighbouring runtime registry and native-goal suites, lint and core typecheck. None of this has run against a real Sprite: the runtime tests use the fake SDK, and only the process-killing scripts ran with real bash and real processes in this container. **F1 – retained credentials survive reuse.** When write-back fails, the run now writes a `credentials-retained` marker into the run directory it keeps on the Sprite. That marker quarantines the Sprite for every worker process: - A new run skips the Sprite, so it is never restored or reused. A Sprite that can't be checked is skipped too. - Release won't restore it either, whichever run (including a reattached one) is being released. - Deleting the run directory after recovering the token lifts the quarantine. That is what the existing log message already tells the operator to do. - If the marker can't be written, this worker keeps the Sprite out of use until it restarts. **F2 – cleanup runs once.** A failed launch and `release()` now share one cleanup, which also frees the Sprite. The early second release in the failure path is gone. If preparation was abandoned midway, cleanup waits for it to finish before touching the Sprite. **F3 – the deadline covers the whole run.** It now starts when the run is requested, so waiting for a Sprite, first-time setup, provisioning and upload all count against it. It is checked again just before the session is created. A run that expires before starting returns the normal timeout result and never starts a session. If setup is still running at that point, the run settles on time but the Sprite is freed only after setup ends and the cleanup above has run. **F4 – a stop kills the whole process tree.** - The command now runs in its own session (`setsid`), and every process it starts inherits `PROPR_SPRITES_RUN=<run dir>`. That catches processes that start a session of their own. - `TERM` is forwarded to the whole session. `KILL` kills everything in the session, its process group, or carrying the tag, and reports failure if anything survives. - When the command exits normally, the launcher kills anything it left running, the way a container's processes die with it. - Before a release cleans or frees the Sprite, it now kills the run's processes and checks none are left. If some survive, the Sprite stays out of use until the worker restarts. The new tests fail against the original code: the F1 and F2 tests fail outright, and the F3 tests hang, since a queued run never settled. The real-process test fails against the original scripts. Limits you should know about: - A process that both starts its own session and clears its environment would escape the kill. Sprites give no container-style boundary that would catch it. - I couldn't confirm whether the SDK throws on a non-zero exit; the kill check handles either case. - The launcher now fails clearly on a Sprite without `setsid`; I left the setup script alone so existing Sprites don't get set up again. - `persistRecoveryObligation` and the Sprite-acquisition loop moved into a new file, `sprites/spritesRunLifecycle.ts`, to keep `spritesRuntime.ts` under the 400-line lint limit. - I updated the run lifecycle in `agent-runtime.md` to match. One unrelated thing I noticed: this agent container's init doesn't reap orphaned processes, so killed processes linger as zombies. The scripts now treat zombies as dead, which on a real Sprite only matters if its init behaves the same way. There's nothing visible to preview. PR: #3786 Comment by: @propr-ultrafix (ID: 0) Model: Claude Opus 5.5 ProPR-Agent: claude/claude-opus-5-5
|
✅ AI Code Review Complete requested by @propr-ultrafix Posted 1 review: |
🔍 AI Code Review — codex:gpt-6-astraOverall EvaluationThis PR adds a substantial Sprites runtime with provisioning, credential transfer, resumable output, cleanup, and settings integration. It needs changes before merge: setup can fail under the intended privilege shim, credential recovery can lose refreshed tokens, and process/checkpoint cleanup does not fully preserve isolation. ✅ Resumable output — Separate log followers track byte offsets and use ✅ Preparation ownership — Aborted preparation retains its Sprite slot until preparation and cleanup finish; the added tests explicitly cover delayed setup and subsequent reuse. ✅ Explicit capability refusal — Unsupported bind mounts and restricted networking are refused through the runtime capability checks. The supplied current-head status has no failures and one pending shard. This review is a static trace of the supplied code; no commands or tests were run. Merge blockersEvery finding below was introduced by this PR and must be resolved before merging. F5: 🔴 Setup uses the wrong Git home
F6: 🔴 Interruption can discard rotated credentials
F7: 🔴 Clearing the environment escapes process cleanup
F8: 🔴 Setup upgrades checkpoint previous run data
SuggestionsThese are optional follow-ups and are not sent to S2: 🟢 Expand the live smoke testThe live test checks S3: 🟢 Align Docker sweep documentation
ScoreThe implementation has useful lifecycle tests and clear runtime integration, but the verified setup, credential-loss, and isolation defects prevent merging. Current 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 88287d3
Summary of ChangesI fixed F5–F8. The Sprites suites and the neighbouring runtime suites pass (78 tests), and typecheck and the zero-warning lint pass on the changed files. Every new regression test fails when its fix is disabled. Nothing here was run against a real Sprite: as before, it was tested with the fake SDK and real bash. F5 – setup used the wrong Git home (
F6 – an interrupted run could lose a rotated token
F7 – a process could escape cleanup by clearing its environment
F8 – a setup upgrade could checkpoint the previous run's data (
Other changes
Limits and trade-offs
No previews: nothing in the UI changed. Review digestRisk-tiered paths
Diff size: 11 files changed, +499/−75 lines 🤖 Implementation Details
💡 ProPR Slash Commands
🤖 Generated by ProPR |
I fixed F5–F8. The Sprites suites and the neighbouring runtime suites pass (78 tests), and typecheck and the zero-warning lint pass on the changed files. Every new regression test fails when its fix is disabled. Nothing here was run against a real Sprite: as before, it was tested with the fake SDK and real bash. **F5 – setup used the wrong Git home** (`scripts/sprites-agent-setup.sh`) - The four `git config --global` calls now go through `configure_agent_git node /home/node`, which sets `HOME` explicitly. - Same root cause elsewhere: `agent-entrypoint.sh` runs `gosu node`, and on a Sprite without su-exec or gosu that goes through the same `setpriv` shim, which also left `HOME=/root`. The shim now sets `HOME` to the user's home, as su-exec and gosu do. - Tests: the shim run with an inherited root `HOME`, and the git setup run through the shim against a read-only root home. **F6 – an interrupted run could lose a rotated token** - Write-back now waits until the launcher has recorded its exit status, which it only does after returning the tokens. After a grace period it kills the run's processes so the launcher can finish, then checks once more. - If the export still can't be confirmed (for example the Sprite went cold), nothing is written back. The live credential copies under `/home/node` are left in place, and the Sprite is quarantined with an `export-unconfirmed` marker. - The worker now writes the recovery marker when it uploads the credentials, and removes it only after a successful write-back. This closes the gap F8 points out: a worker that crashes mid-run leaves the Sprite quarantined, instead of restorable over the new token. - Tests: output lost while the launcher is still stopping (the rotated token reaches the store), a cold Sprite (live copy kept, Sprite quarantined), and the marker staying in place from upload until write-back. **F7 – a process could escape cleanup by clearing its environment** - Run membership now also covers every process running as the `node` user, checked on all four of its user IDs. `node` is used only by runs, and a Sprite hosts one run at a time. - Both the launcher's cleanup and the KILL path use this. The launcher also kills leftover `node` processes before it installs a new run's credentials, and refuses to start the run if any survive. - Tests: a process started with `setsid env -i` is recognised as a member through its user ID, and is missed without that check. The existing real-process launcher test now uses an unused user ID, because the test user in this container *is* `node`. **F8 – a setup upgrade could checkpoint the previous run's data** (`prepareSprite`) - A Sprite set up for an earlier revision is first restored to that revision's clean checkpoint, unless the last release already did. - A used Sprite with no clean checkpoint is deleted and created again instead of being set up as it is. That includes the old "current revision but checkpoint missing" case, which used to re-run setup on the filesystem as it was. - A failed setup-stamp read now raises an error instead of counting as "never set up". - Tests: an upgrade over a run that was never released, and the delete-and-recreate path for both cases. **Other changes** - `deleteSprite` was added to the SDK interface (the real SDK has it). - The fake SDK gained `deleteSprite`, and a cold Sprite no longer reports a running launcher. A closed follower now stops polling; before, its timer kept the test process alive after the run. - The architecture doc now describes the new behaviour. - To stay under the 400-line lint limit, the credential-finishing and setup-or-replace steps moved into `spritesRunLifecycle.ts`. **Limits and trade-offs** - There is no root here, so the user-ID check is only tested by listing processes, not by actually killing them. - Quarantine now happens more often: after any worker crash or unconfirmed export on a run with credentials. Each case needs an operator to recover the token and delete the run directory. - One race can't be closed: if the marker can't be written because the Sprite can't be reached, only the current worker knows to keep the Sprite out of use. No previews: nothing in the UI changed. PR: #3786 Comment by: @propr-ultrafix (ID: 0) Model: Claude Opus 5.5 ProPR-Agent: claude/claude-opus-5-5
|
✅ AI Code Review Complete requested by @propr-ultrafix Posted 1 review: |
🔍 AI Code Review — codex:gpt-6-astraOverall EvaluationThis PR adds a substantial Sprites runtime with provisioning, credential transfer, reconnectable output, cleanup, and per-agent selection. It needs changes before merge because privilege isolation, credential export, and timeout settlement have gaps. ✅ Resumable output — Separate stdout/stderr followers track byte offsets and retain UTF-8 decoder state across reconnections. ✅ Credential recovery — Durable recovery markers prevent normal acquisition and checkpoint restoration from overwriting credentials awaiting write-back. ✅ Focused regression coverage — Added tests cover provisioning, reconnects, cancellation during preparation, quarantine, and process cleanup. The supplied current-head status reports all four test shards passing; Validate Changes remains pending. This assessment is a static review of the supplied code; no commands or tests were run. Merge blockersEvery finding below was introduced by this PR and must be resolved before merging. F9: 🔴 Keep root-executed entrypoints outside agent control
F10: 🔴 Treat credential export failures as recovery obligations
F11: 🔴 Bound settlement after failed stop requests
F12: 🔴 Honor configured CLI versions on Sprites
SuggestionsThese are optional follow-ups and are not sent to S4: 🟢 Expand live integration coverageThe live test checks Claude's version through a synthetic wrapper, while the fake SDK emulates credential installation and result export. A live authenticated clone-and-return test would help validate the real SDK, filesystem permissions, and checkpoint behavior together. This is additional confidence-building coverage, rather than a separate merge requirement. S5: 🟢 Clarify Docker-free sweep selection
ScoreThe implementation has substantial lifecycle coverage and passing current test shards, but the privilege-boundary and credential-loss defects require correction, alongside timeout settlement and version selection. Score: 4/10 🤖 Review Details
Copy and edit to choose records from this review: 🤖 Review by ProPR |
|
✅ AI Code Review Complete requested by @propr-ultrafix Posted 1 review: |
🔍 AI Code Review — codex:gpt-6-astraOverall EvaluationThe PR adds a substantial Sprites runtime with provisioning, credential transfer, resumable output, cleanup, and UI selection. It needs changes before merge because session restoration and forced-stop credential recovery have correctness gaps. ✅ Credential recovery tracking — Persisted baselines and recovery markers protect returned credentials across worker restarts and failed write-back. ✅ Output continuity — Separate stdout/stderr followers track byte offsets and use persistent UTF-8 decoders across reconnects. ✅ Explicit capability refusals — Restricted networking and incompatible CLI versions are refused before launch. This review is a static trace of the supplied code; no commands or tests were run. Current checks show no failures and three pending checks. Merge blockersEvery finding below was introduced by this PR and must be resolved before merging. F16: 🔴 Preserve or refuse provider session resumes
F17: 🔴 Recover Antigravity tokens after forced termination
SuggestionsThese are optional follow-ups and are not sent to S7: 🟢 Broaden live runtime acceptanceThe opt-in live test checks provisioning and ScoreThe implementation has substantial lifecycle coverage and explicit safety checks, but the two credential/session correctness gaps prevent merge readiness. 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 84add91
Summary of ChangesI fixed both findings: F16 and F17. The Sprites suite and the neighbouring runtime, credential-broker and argv suites all pass (144 tests), and lint and typecheck are clean. The launcher regression for F17 fails against the launcher as it was before this change (it returns the stale F16: session resumes are refused before launch
F17: Antigravity's refreshed token survives a KILL
Other changes
The change has no visible UI, so I made no previews. Review digestRisk-tiered paths
Diff size: 8 files changed, +283/−45 lines 🤖 Implementation Details
💡 ProPR Slash Commands
🤖 Generated by ProPR |
I fixed both findings: F16 and F17. The Sprites suite and the neighbouring runtime, credential-broker and argv suites all pass (144 tests), and lint and typecheck are clean. The launcher regression for F17 fails against the launcher as it was before this change (it returns the stale `{"token":"agy"}`), so it does catch the bug.
**F16: session resumes are refused before launch**
- A credential mount marked `perRun: false` is a store that has to keep the provider session between launches. Sprites now refuses it (in `spritesMountRefusal`, `spritesCommand.ts`). The message says the session can't be preserved and to use Docker.
- That check already runs in `assertAgentRuntimeSupports` and `planSpritesMounts`, so a run is refused before any Sprite is acquired, restored or uploaded to.
- I checked the other callers. Every resume path (Claude `--resume`, `codex exec resume`, Antigravity goal mode) sets `perRun: false`, and only goal runs do. So all three providers are covered, and normal task runs are unaffected.
- Regression: Claude, Codex and Antigravity goal-shaped specs are refused by the mount check, by `assertAgentRuntimeSupports` and by a direct `start()`, which never creates a Sprite.
**F17: Antigravity's refreshed token survives a KILL**
- There is a new `live` launcher record. When Antigravity's disposable HOME holds a copy of the token, the launcher returns that copy instead of the possibly stale one in `/home/node/.gemini-source`. It checks the path the same way: if any part of it is a symlink or not a regular file, nothing is returned, no export is recorded, and the live copy is kept. With no disposable copy it falls back to the store copy as before.
- If the export isn't confirmed, the recovery record now lists `/tmp/propr-antigravity-home/.gemini` as well as the store, and cleanup already keeps that HOME.
- Before each run the launcher now also removes `/tmp/propr-antigravity-home`, so a disposable copy left by an earlier run is never returned as this run's token.
- Codex and Claude refresh the token where it is installed, so they have no separate live copy and need nothing here.
- Regressions:
- A real-bash launcher test: the token is rotated in the disposable HOME, then the real KILL signal script runs. It also covers a symlinked live path and the case with no live copy.
- Two fake-runtime tests: a KILLed run writes the rotated token back to the canonical store, and a run whose export can't be confirmed keeps the live token and records where it is.
**Other changes**
- `spritesCommand.ts` went 14 lines over the 400-line lint limit. I moved the credential-return record helpers into a new `sprites/spritesCredentialRecords.ts`, and `spritesCommand.ts` re-exports the public names.
- The fake Sprite in `test/helpers/fakeSprites.ts` now understands `live` records.
- `agent-runtime.md` now describes the goal-run refusal and the Antigravity live-token return.
The change has no visible UI, so I made no previews.
PR: #3786
Comment by: @propr-ultrafix (ID: 0)
Model: Claude Opus 5.5
ProPR-Agent: claude/claude-opus-5-5
|
✅ AI Code Review Complete requested by @propr-ultrafix Posted 1 review: |
🔍 AI Code Review — codex:gpt-6-astraOverall EvaluationThis PR adds a substantial Sprites runtime with provisioning, credential transfer, output recovery, and configuration UI. It needs changes before merge because the supported checkpoint-disabled mode permits a persistent symlink to redirect a privileged ownership change. ✅ Credential recovery — Persisted baselines and recovery markers protect refreshed credentials when export or write-back fails. ✅ Output continuity — Separate byte offsets and UTF-8 decoders preserve stdout/stderr across reconnects. ✅ Current checks — The supplied authoritative status reports 24 passed checks and no failures. Review was limited to static analysis of the supplied code; no commands were run. Merge blockersEvery finding below was introduced by this PR and must be resolved before merging. F18: 🔴 Prevent privileged writes through leftover symlinks
SuggestionsThese are optional follow-ups and are not sent to S8: 🟢 Exercise the real SDK lifecycleThe fake SDK and local shell tests provide useful coverage, but they cannot establish actual checkpoint restoration, session events, or filesystem API behavior. A disposable live test covering two consecutive runs and a reconnect would strengthen deployment confidence. This is additional validation, separate from the demonstrated blocker. ScoreThe implementation has substantial recovery coverage and passing current checks, but the persistent-directory privilege escalation requires 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 dc4e497
Summary of ChangesI fixed F18. Before any root The fix. A new bash helper, It is applied everywhere the same mistake occurred:
The test. It is in
Against the old launcher, run 1's cleanup deleted a file through the link. With that step removed, run 2 alone still created Checks: all 45 tests in Separate issue, not fixed: with checkpoint restore off, Review digestRisk-tiered paths
Diff size: 4 files changed, +147/−9 lines 🤖 Implementation Details
💡 ProPR Slash Commands
🤖 Generated by ProPR |
I fixed F18. Before any root `mkdir`, `chown`, `install`, `cp` or `rm -rf` on a path the agent can reach, the Sprites launcher and cleanup now remove any symlink the agent planted on that path, so a link left by an earlier run can no longer hand `/opt/propr/bin` to `node`. The new regression test passes, and it fails against the old code. **The fix.** A new bash helper, `secure_path`, lives in `packages/core/src/agents/runtime/sprites/spritesPathSafety.ts`. It walks the path below its top-level directory (`/home`, `/tmp`, `/run`, which the agent can't replace). The first component that is a symlink, or a non-directory where a directory belongs, is removed, along with whatever was reached through it. After that, every existing directory above the target is real and the target itself is not a symlink. Paths that aren't absolute and plain (empty, `.` or `..` components) are refused. This is safe from races only because no `node` process is alive while root works: the launcher kills them all first, and cleanup runs only after the run was confirmed stopped. It is applied everywhere the same mistake occurred: - **`dir` records** (log and scratch directories, tmpfs targets): the reported bug. A planted symlink or file is removed and a real directory is created before the `chown`. - **`file` records:** checked, then the target is removed before `install -o node`. A symlinked parent previously put a `node`-owned file into the linked directory. - **`store` records:** checked before `cp -a` and `chown -R`. - **`purge` records:** now fail the run if the path can't be made safe, instead of deleting through a symlinked parent. - **The workspace directory:** checked before `mkdir -p` and, when not cloning, `chown node:node`. - **End-of-run removal of credential and file copies:** checked before deleting. - **The release cleanup (`SPRITES_SCRUB_SCRIPT`):** used when checkpoint restore is off or fails. It was a bare `rm -rf -- "$@"`; it now checks each path first and exits non-zero on any path it can't clear. `SPRITES_SCRUB_SCRIPT` is still exported from `spritesCommand.ts`; it moved into the new file only to keep that file under the 400-line lint limit. I also added a short paragraph to step 5 of `docs/docs/architecture/agent-runtime.md`. **The test.** It is in `test/spritesRuntime.test.ts` and runs the real launcher twice on the same filesystem with nothing restored between runs, as with `PROPR_SPRITES_RESTORE_CHECKPOINT=false`. Ownership changes are recorded rather than made, because the test can't run as root. In run 1 the agent replaces its log directory, its workspace and the parent directories of later targets with links to a stand-in for `/opt/propr/bin`. Run 2 then installs `dir`, `file`, `store` and `purge` records and a non-clone workspace on top of those links. The test checks that: - nothing is created in or removed from the protected directory, either by run 1's cleanup or by run 2. - every ownership change lands below the agent's own directories. - the linked paths are real directories again after run 2. - the cleanup script removes a planted parent link instead of following it, and refuses a path containing `..`. Against the old launcher, run 1's cleanup deleted a file through the link. With that step removed, run 2 alone still created `share` inside the protected directory and deleted `opencode` from it. **Checks:** all 45 tests in `spritesRuntime.test.ts` pass, as do the registry and native-goal boundary suites (90 total). Lint with zero warnings on the runtime folder and the core typecheck also pass. Nothing visible changed, so there are no previews. **Separate issue, not fixed:** with checkpoint restore off, `prepareSprite` returns `ready` on a matching setup stamp without repeating setup's ownership checks on what root runs. This fix stops the launcher and cleanup from causing those files to change, but nothing re-checks them when a Sprite is reused. PR: #3786 Comment by: @propr-ultrafix (ID: 0) Model: Claude Opus 5.5 ProPR-Agent: claude/claude-opus-5-5
|
✅ AI Code Review Complete requested by @propr-ultrafix Posted 1 review: |
🔍 AI Code Review — codex:gpt-6-astraOverall EvaluationThis PR adds a substantial Sprites runtime with provisioning, clone transport, credential recovery, cancellation, and UI configuration. It needs changes before merge because the new filesystem handling exposes a privilege boundary failure and retains data between runs when checkpoint restoration is disabled. ✅ Credential recovery — Persisted baselines and recovery markers protect rotated tokens across worker restarts and failed exports. ✅ Output continuity — Independent byte offsets and UTF-8 decoders preserve separate output streams across reconnections. ✅ Failure coverage — The added tests exercise preparation deadlines, cancellation, failed termination, and checkpoint recovery. Current-head checks report no failures, with one check pending. This review is a static analysis of the supplied code; no commands were run. Merge blockersEvery finding below was introduced by this PR and must be resolved before merging. F19: 🔴 Writable credential staging enables root file overwrite
F20: 🔴 Log and scratch directories retain prior-run data
SuggestionsThese are optional follow-ups and are not sent to S9: 🟢 Expand live runtime acceptanceThe opt-in live test checks provisioning and ScoreThe implementation has substantial recovery logic and test coverage, and current checks show no failures. The root-write exposure and cross-run data retention prevent merge readiness. 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 9bd4858
Summary of ChangesI've fixed F19 and F20. All checks are clean: 101 tests across the Sprites suites and the runtime registry and credential broker suites, typecheck, and the zero-warning lint. Nothing was run against a real Sprite, and the Antigravity entrypoint was run as the test user (with F19: root file overwrite through the credential stagingThere were three root-side copies of this kind in the Antigravity entrypoint, not one. All of them follow paths that
Fix:
F20: log and scratch directories kept earlier runs' data
Tests (4 new, 1 updated)
The docs ( Other problems found (not fixed)
This change has nothing visible, so there are no previews. Review digestRisk-tiered paths
Diff size: 7 files changed, +315/−56 lines 🤖 Implementation Details
💡 ProPR Slash Commands
🤖 Generated by ProPR |
|
Design direction to stop the F-finding churn. I suggest this over point fixes. F19, F20 and the earlier leftover-data finding share one root cause: a Sprite is reused without restoring the clean checkpoint, and root-side code then touches paths the agent controlled. Rather than hardening each path:
Add a fake-Sprite test asserting that a run always starts from a restored checkpoint and that release restores even when the run fails. I'll re-run the live three-agent E2E once this lands. |
I've fixed F19 and F20. All checks are clean: 101 tests across the Sprites suites and the runtime registry and credential broker suites, typecheck, and the zero-warning lint. Nothing was run against a real Sprite, and the Antigravity entrypoint was run as the test user (with `id` reporting 0), not as real root. ## F19: root file overwrite through the credential staging There were three root-side copies of this kind in the Antigravity entrypoint, not one. All of them follow paths that `node` controls, and all of them run after the repository setup hook has already run as `node`: 1. **The sync back after the run** (the finding): `cp -p` into `.gemini-source/…propr-tmp-$$`. 2. **The transcript export**: a `cp` to `PROPR_ANTIGRAVITY_TRANSCRIPT_PATH` under `/tmp/git-processor/…`. The agent can create that directory and plant a link there. On a Sprite this file never reaches the worker anyway. 3. **The copy-in before the CLI starts**: a `cp -p` into `/tmp/propr-antigravity-home/.gemini/…`. The setup hook can plant links there, and it can also change the store's contents. **Fix:** - A Sprite run no longer receives `PROPR_ANTIGRAVITY_SOURCE_CONFIG` or `PROPR_ANTIGRAVITY_TRANSCRIPT_PATH`, whichever source sets them. They are listed in `SPRITES_WITHHELD_VARIABLES` in `spritesCommand.ts`. Without them the unchanged entrypoint makes none of the three copies, so Docker and the image are unaffected. - The launcher now installs the store copy into the disposable HOME itself, before any process of the run exists (`spritesCredentials.ts`). - The refreshed token comes back through the launcher's existing live-copy export, which already has the path checks and only runs once every run process is gone. ## F20: log and scratch directories kept earlier runs' data - **Before a run:** the manifest now removes every planned log, scratch and tmpfs directory before anything is installed (`spritesPurgeRecords`). - **At release:** the cleanup now includes those directories. When live credentials are kept for recovery, directories inside or around those copies are left alone. - These definitions moved into a new `sprites/spritesRunCleanup.ts`, because the change pushed `spritesCommand.ts` over the 400-line lint limit. `spritesCommand.ts` still re-exports them. ## Tests (4 new, 1 updated) - **Fake-Sprite tests:** - An Antigravity run gets neither variable, and its CLI finds the store's token, put there by the launcher. - With checkpoint restore off, release removes the log, scratch and tmpfs directories, and a later run gets them empty. Those directories are purged before anything is installed. - **Real-bash tests:** - The installed Antigravity entrypoint, with its paths moved into a sandbox: with the image's variables, links the agent planted make it overwrite both protected files; under the Sprites launcher and environment it writes nothing through them and the rotated token is returned. - The launcher empties a filled log directory without following a link inside it. - I updated one existing test, which had asserted that the disposable HOME starts without a token. - Undoing each of the four fixes on its own makes at least one new test fail. The docs (`agent-runtime.md`) now describe the new flow. ## Other problems found (not fixed) - **Other leftovers with restore off:** release still removes only a fixed list of paths. Anything else a run writes stays for the next run, possibly from another repository. Examples are the setup-hook cache `/tmp/propr-setup-cache/<agent>`, `/home/node/.cache`, `/home/node/.npm`, `/var/tmp` and `/dev/shm`. - **Root `mkdir -p` after the setup hook:** the root-run entrypoints still create directories under `node`-owned paths at that point, for example Antigravity's `antigravity-cli/log` and `cache` and Claude's `projects/…`. A planted directory link can make root create empty directories elsewhere. No file content is written. - **`readOnly` on credential stores:** the launcher still ignores it and installs every store as `node`-owned. After this fix nothing root-side follows paths in the store, and the production Antigravity bind isn't read-only anyway (only the test fixture is). This change has nothing visible, so there are no previews. PR: #3786 Comment by: @propr-ultrafix (ID: 0) Model: Claude Opus 5.5 ProPR-Agent: claude/claude-opus-5-5
|
⏳ Ultrafix is waiting for CI before the next These blocking checks on
Checks matching this repository's non-blocking checks never gate Ultrafix. The loop continues automatically once the blocking checks pass; if they have not settled within 2 hours, Ultrafix stops. |
|
✅ Applied the requested follow-up changes in commit f056b5a Summary of ChangesI've made the three changes. Restoring the clean checkpoint is now mandatory and happens in 1. Mandatory restore at release
2. No root-side credential sync (F19)
The remaining gap was the read-only behaviour, and that's now fixed. A new launcher step installs a credential source owned by root and readable but not writable by 3. Unchanged: the node symlink and Tests
I moved the restore-or-replace logic into Review digestRisk-tiered paths
Diff size: 11 files changed, +313/−110 lines 🤖 Implementation Details
Undo Changes • View Task Execution 💡 ProPR Slash Commands
🤖 Generated by ProPR |
I've made the three changes. Restoring the clean checkpoint is now mandatory and happens in `release()`, and the credential source on a Sprite is read-only for the agent. Nothing was run against a real Sprite, so your live three-agent E2E is still the real check. The Sprites suites (55 tests), the runtime registry and credential broker suites, and core typecheck and the zero-warning lint all pass. **1. Mandatory restore at release** - **Option removed:** `PROPR_SPRITES_RESTORE_CHECKPOINT` is gone from the config. Setup now always creates the checkpoint. An operator who still has the variable set is ignored rather than refused. - **Restore at release:** `release()` restores the post-setup checkpoint after the write-back has finished. This happens whether the run succeeded, failed, crashed, timed out or was stopped. The Sprite is then marked clean, so the next run starts with no restore. The restore time is logged as a new `releaseRestoreMs` timing. - **Failed restore:** if the restore fails, or the checkpoint is missing, the Sprite is treated as unusable. It is deleted and created again, and the next run sets it up from scratch. If even the delete fails, release removes the run's data, and the Sprite stays unmarked so its next run restores or replaces it first. - **Never run unrestored:** a Sprite without the clean mark is restored before the run starts. That covers a worker crash, a quarantine that was lifted, or a run that was never released. If that restore fails too, the Sprite is replaced. - **Quarantined Sprites:** a Sprite still holding credentials that were not written back is not restored, since that would delete the only copy of the token. It stays out of use, as before, and is restored before its next run once an operator clears it. - **Hardening kept:** the earlier fixes (symlink removal, purging log and scratch directories before a run) are still in place as a second line of defence. Cleanup of individual paths now only runs for quarantined Sprites and ones that couldn't be deleted. **2. No root-side credential sync (F19)** Most of this was already on the branch from the F19 fix (9bd4858): - A Sprite run never receives `PROPR_ANTIGRAVITY_SOURCE_CONFIG`, so agy's `cp -p` sync never runs. - The refreshed token comes back only through the launcher's `returned/` export. That export checks for a plain file first and doesn't follow symlinks. The remaining gap was the read-only behaviour, and that's now fixed. A new launcher step installs a credential source owned by root and readable but not writable by `node`. It applies to any store with a read-only bind and to Antigravity's `/home/node/.gemini-source`, since its CLI only ever uses the copy in its disposable home. Claude and Codex stores, which their CLIs refresh in place, still belong to `node`. **3. Unchanged:** the node symlink and `--allow-scripts` setup fixes and the `antigravity` enablement. **Tests** - **The fake-Sprite test you asked for:** a failed run, a crashed agent, a stopped run, and a run left unreleased followed by a worker restart. Each run writes to paths no cleanup list names, such as `~/.cache`, `~/.npm`, `/var/tmp`, `/dev/shm` and the setup-hook cache. The test asserts that every release restores, and that every run starts from the checkpointed filesystem with nothing from an earlier run. - **Restore failure:** a second test covers a failed restore, both at release and before a run (the Sprite is deleted and created again), and a delete that also fails. - **Read-only source:** a real-bash launcher test checks that the source is installed with modes 0750/0640 and owned by root, and that a symlink planted there is removed, not followed. - **Updated tests:** the tests that used the removed option now run with the restore always on. - **Mutation checks:** skipping the restore at release, starting on an unrestored Sprite, or installing the source writable each make the new tests fail. I moved the restore-or-replace logic into `spritesRunLifecycle.ts` to keep `spritesRuntime.ts` under the 400-line lint limit, and updated `agent-runtime.md` to match. There is no visible change, so no previews. PR: #3786 Comment by: @integry (ID: 7139818953) Model: Claude Opus 5.5 ProPR-Agent: claude/claude-opus-5-5
|
Pausing this PR: ultrafix is stopped, and the PR stays open as a reference. #3764 is being restarted from the epic branch with the design from my last comment, which makes the clean-checkpoint restore mandatory on release and removes root-side credential sync. There are two independent attempts, #3789 (Codex Astra) and #3790 (Claude Fable). The one that passes review and the live three-agent E2E replaces this PR. |
|
ℹ️ Analyzed the follow-up request by @integry Analysis SummaryI haven't changed anything on this PR. Your comment pauses it rather than asking for edits: ultrafix is stopped, the PR stays open as a reference, and #3764 restarts from the epic branch in #3789 and #3790. Because nothing changed, I didn't generate any visual previews. The branch stays at
So this PR shouldn't be merged as it stands, even after CI goes green. The last full-suite run also failed on shard 2, in These parts are still useful to #3789 and #3790:
No code changes were necessary based on the current state of the branch. 🤖 Analysis Details
💡 ProPR Slash Commands
🤖 Generated by ProPR |
The Sprites runtime is implemented from the epic branch with the issue's design, and the unit, fake-Sprite and real-bash launcher tests pass. Nothing was run against a real Sprite: there is no `PROPR_SPRITES_LIVE_TOKEN` here, so `test/spritesRuntime.live.test.ts` is written but only confirmed to skip. What was built - Selection: `PROPR_AGENT_RUNTIME=sprites` or an agent's `runtime: sprites` now resolves to `SpritesRuntime`, for Claude Code, Codex and Antigravity. The API validates the `runtime` field. - Clean checkpoint by construction: - A run is only handed a Sprite that this worker process provisioned and checkpointed, or restored, with no run since. - The restore starts as soon as the run ends, whether it succeeded, failed, timed out or was killed. `release()` awaits it; there is no skip option. - A failed restore, or a run whose processes can't be confirmed dead, destroys the Sprite and provisions a new one. - The clean checkpoint's id is recorded on the worker, never looked up by comment on a used Sprite. A restarted worker restores before its first run, and replaces a Sprite it has no matching record for. - No root work on agent paths: - The launcher (`scripts/sprites-launcher.sh`) installs files only before anything of the run starts. - Provider entrypoints are unchanged but run behind an `<agent>-as-agent` shim that drops to `node` first, so the Antigravity root-side sync-back never executes on a Sprite. - Credential export: - After all `node` processes are killed, the launcher reads each refreshable token as `node` into a root-owned export directory. - The worker reader takes plain regular files only, never follows symlinks, caps size at 1 MiB, then calls `broker.commit()`. - Antigravity's source store is installed read-only for `node`. - Org token: withheld from the run by variable name and by value, and redacted from error messages. `SPRITES_CLIENT_SIGNALS=0` is set unless the operator set it. - Live-verified items kept: - `node`, `npm` and `npx` are linked from the nvm shim's real directory. - CLIs install with `npm install -g --allow-scripts=<package>`. - Pins, including the three Antigravity ones, are read from `Dockerfile.agent`. - Credentials, prompt, env and argv go up as one tar in a single upload. - Docs: `docs/docs/architecture/agent-runtime.md` (new "Sprites Runtime" section), `.env.example`, changelog and the third-party license list. Things you might not expect: - `@fly/sprites` was not actually a dependency on the epic branch, so I added `0.2.5` to `packages/core` and the lockfile. It declares Node ≥ 24; it imports and its WebSocket auth header works on Node 22 locally. - To let Sprites tests exit, the shared handle output code moved from `dockerRuntime.ts` to a new `agentRunOutput.ts` (re-exported, no behaviour change). - A cross-process lock file per Sprite keeps two worker processes with the same worker id off one Sprite. - An agent configured for a CLI version other than the pinned one is refused on Sprites rather than silently run on the pin. Tests `test/spritesRuntime.test.ts` (20), `test/spritesRunPlan.test.ts` (16) and `test/spritesLauncher.test.ts` (2) pass, as do the existing registry, clone-transport, credential-broker and golden-argv suites, lint and typecheck. They cover each acceptance point and each #3786 finding: - Run 2 sees only the clean checkpoint's paths: no workspace, result bundle, Antigravity HOME or token, logs or scratch from run 1. - Restore after failed and killed runs, and restore failure leading to destroy and recreate. - The export reader rejecting symlinks, FIFOs, directories and oversize files. - A symlink planted at a credential path exporting nothing. - The org token absent from run env, Sprite commands and logs. `spritesLauncher.test.ts` executes the real launcher script end to end, but unprivileged with the privilege-drop commands stubbed. `sprites-agent-setup.sh` itself was only syntax-checked and function-tested, never run as a whole. Still needs live verification (for the PR description) 1. `test/spritesRuntime.live.test.ts` on a real Sprite: setup script end to end, pinned CLIs, `node` without sudo, export round trip, and run 2 finding nothing from run 1. 2. That a checkpoint restore resets `/tmp`, `/var/tmp`, `/dev/shm` and `/home/node`, and leaves no surviving processes (the live test checks this). 3. That the filesystem API reports symlinks as symlinks in `stat`, and that it can write to `/opt/propr/run` (owned by whoever uploaded the setup files). 4. Detachable session behaviour: the launcher survives a dropped worker connection, and `tail --pid` followers resume. 5. The `bash -lc` login shell on a Sprite keeping `/opt/propr/bin` ahead of the preinstalled CLIs for the agent. 6. `@fly/sprites` under the production Node 22 image. 7. Timings against the issue's figures (about 30 s cold, about 7.5 s warm minus the restore). 8. The three-agent E2E (Claude, Codex, Antigravity) with the real clone transport, including Antigravity token refresh through the export. Not in scope and documented as such: OpenCode and Vibe, goal sessions, restricted network and private-network MCP are refused on Sprites. Agent-run admission limits don't apply; `PROPR_SPRITES_MAX_SPRITES` bounds concurrency. A Sprites-only worker still prepares the Docker agent image. There is no UI selector for `runtime`. No visual preview: the change has no user-visible UI. ProPR-Agent: claude/claude-fable-5-2
|
❌ Failed to resolve merge conflicts from System-triggered merge conflict resolution |
|
Superseded by #3791, which was merged into the epic after live verification with Claude, Codex and Antigravity. |


AI Implementation Summary
Closes #3764
Branch:
3764/claude-opus-5-5-spritesruntime-run-agents-20261124-1023-erwCommits: ✅ Changes committed (d03a4ec)
AI Processing Completed
Execution Details:
Summary:
I've implemented
SpritesRuntime(packages/core/src/agents/runtime/spritesRuntime.ts): selectingspritesnow runs Claude Code and Codex agents on Fly Sprites. It has not been run against a real Sprite, because no Sprites token was available here. Everything was tested against a mocked SDK, and the generated bash scripts were run locally with real bash.Tested
test/spritesRuntime.live.test.ts. It is skipped unlessPROPR_SPRITES_LIVE_TOKENis set; with a token it provisions a real Sprite, runs the pinnedclaude --versionthrough the entrypoint, and prints the startup timings.How a run works
<prefix>-<worker>-<slot>, with one run per Sprite. A Sprite is created on first use, set up once, checkpointed, and restored to that clean checkpoint before every later run.propr/agentimage, soscripts/sprites-agent-setup.shrebuilds what the entrypoints need. It creates anodeuser (not in sudoers), adds the privilege-drop tools, installs the existing entrypoint scripts, and pins the CLI versions read fromDockerfile.agent. That covers Claude Code, Codex and Antigravity (agy) 1.5.15, so a Sprite runs the same CLIs as the image.docker run --user 0:0would./home/node(the Sprite's own~/.claudeand~/.codexare never touched), writes refreshed tokens back under the store lock, and deletes the copies after the run.tailprocesses that resume from the bytes already received after a dropped connection.SpritesRunInterruptedError; nothing can hang. Timeouts, cancellation, the spend cap and the watchdog stop the run through the launcher (TERM, then KILL).Sprites run startup overheadline with queue, wake/create, setup, restore, credential sync, clone and total times. The fields are documented inagent-runtime.md.PROPR_SPRITES_TOKEN, name prefix, region and the other options are documented inagent-runtime.mdand.env.example.SPRITES_CLIENT_SIGNALS=0is set unless the operator set it. Agents get aruntimefield, validated by the API, and the Web UI agent dialog has a Runtime selector (Instance default / Docker / Fly Sprites).Limits and assumptions
sudofor its default user. The setup script fails clearly without it.attach()can follow a run after a worker restart, but nothing in the worker calls it yet.PROPR_SPRITES_WORKER_ID. As a safeguard, a Sprite already running another process's launcher is skipped.@fly/[email protected]is a new@propr/coredependency. It declares Node ≥24 but works on Node 22, and the app image now includes the setup script. I added an e2e test for the selector, and the previews of the dialog are ready for the PR.Review digest
Risk-tiered paths
package-lock.json(+24/−0): lockfilepackages/core/package.json(+1/−0): dependency manifestpackages/core/src/agents/credentials/hostCredentialStaging.ts(+2/−2): auth-looking pathpackages/core/src/agents/runtime/sprites/spritesCredentials.ts(added, +112/−0): auth-looking pathpropr-ui/src/pages/SettingsPage/agentCredentialSetupUtils.ts(+6/−0): auth-looking path.env.example(+9/−0)docker/Dockerfile.app.prod(+2/−0)packages/api/routes/configAgentValidation.ts(+13/−1)packages/core/src/agents/AgentRegistry.ts(+3/−0)packages/core/src/agents/agentImagePreparation.ts(+21/−1)packages/core/src/agents/runtime/dockerRunArgs.ts(+2/−2)packages/core/src/agents/runtime/dockerRuntime.ts(+1/−1)packages/core/src/agents/runtime/registry.ts(+17/−4)packages/core/src/agents/runtime/runtimeSelection.ts(added, +26/−0)packages/core/src/agents/runtime/sprites/spritesCommand.ts(added, +297/−0)packages/core/src/agents/runtime/sprites/spritesConfig.ts(added, +124/−0)packages/core/src/agents/runtime/sprites/spritesExecution.ts(added, +307/−0)packages/core/src/agents/runtime/sprites/spritesProvisioning.ts(added, +245/−0)packages/core/src/agents/runtime/sprites/spritesSdk.ts(added, +91/−0)packages/core/src/agents/runtime/spritesRuntime.ts(added, +402/−0)packages/core/src/agents/runtime/types.ts(+12/−0)packages/core/src/config/configManagerAgents.ts(+2/−0)packages/core/src/git/worktreeMounts.ts(+25/−3)packages/core/src/index.ts(+6/−1)propr-ui/src/api/proprTypes.ts(+2/−0)propr-ui/src/pages/SettingsPage/AgentConfigModal.tsx(+9/−1)propr-ui/src/pages/SettingsPage/AgentRuntimeSelector.tsx(added, +59/−0)scripts/sprites-agent-setup.sh(added, +122/−0)docs/docs/architecture/agent-runtime.md(+55/−1)docs/docs/architecture/coding-agent-integration.md(+2/−0)propr-ui/e2e/agent-runtime-selector.pw.ts(added, +53/−0)propr-ui/src/pages/SettingsPage/AgentConfigModal.test.tsx(+22/−0)test/agentRuntimeRegistry.test.ts(+4/−2)test/configAgentValidation.test.ts(+15/−0)test/helpers/fakeSprites.ts(added, +246/−0)test/nativeGoalLaunchBoundary.test.ts(+2/−1)test/spritesRuntime.live.test.ts(added, +56/−0)test/spritesRuntime.test.ts(added, +318/−0)New dependencies (1):
@fly/spritesinpackages/core/package.jsonDiff size: 38 files changed, +2,715/−20 lines
View task for the run's logs and conversation.
This PR was created automatically by ProPR after processing issue #3764.
💡 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
Runtime selector
Close-up of the Runtime selector: Instance default, Docker, Fly Sprites
Full-size original
Agent dialog with Fly Sprites runtime
Add-agent dialog (Claude Code) at desktop width with the new Runtime selector set to Fly Sprites and its worker-setting hint
Full-size original