Skip to content

SpritesRuntime (restart, Astra): run agents on Fly Sprites from a restored checkpoint #3789

Done

Description

@integry

Restart of #3764 (SpritesRuntime). The first attempt, #3786, ran 14 review rounds and its score fell to 5/10, because point fixes kept opening new security holes. Build it fresh from the epic branch with the design below. You may read #3786's code and reuse pieces, but follow THIS design where they differ.

Goal

PROPR_AGENT_RUNTIME=sprites (or an agent's runtime: sprites) runs Claude Code, Codex and Antigravity agent runs on Fly Sprites (@fly/sprites SDK, already a dependency), with the clone workspace transport (#3760) and per-run credential copies (#3759, CredentialBroker.materialize()/commit()), behind the AgentRuntime interface (#3773).

Design (non-negotiable)

  1. One run per Sprite at a time, and every run starts from the clean checkpoint. After provisioning (setup script plus pinned CLIs), take a checkpoint. On release(), after credential write-back and result read, ALWAYS restore that checkpoint. If restore fails, destroy the Sprite and provision a new one. There is no option to skip the restore. Data from one run (workspace, logs, scratch, tokens, HOME) therefore cannot reach the next run by construction. Do not write per-path scrubbing as the safety mechanism.
  2. No root-side work on agent-controlled paths. Provider entrypoints must not do root-side credential "sync back" on Sprites. Refreshed tokens come back only through a launcher export directory. The worker reads the export with lstat, plain regular files only, never following symlinks, size-capped, and passes them to broker.commit(). Credential sources are read-only to the agent, matching the Docker readOnly: true bind.
  3. Privilege drop. The launcher runs as root only to install files and then drops to the unprivileged node user (no sudo, not in sudoers), as the Docker entrypoints do.
  4. Secrets. The Sprites org token never reaches a run or a log. Set SPRITES_CLIENT_SIGNALS=0 unless the operator set it.

Verified live on real Sprites (keep these)

  • Node on root's PATH. Sprites ship node as an nvm shim at /.sprite/bin/node. Setup runs via sudo -n, whose secure_path drops /.sprite/bin. Resolve the real binary (/.sprite/bin/node -p process.execPath) and symlink node, npm and npx into /usr/local/bin.
  • npm 12 install scripts. Sprites ship npm 12, which blocks install scripts. Install the pinned CLIs with npm install -g --allow-scripts=<package>; Claude Code needs its postinstall.
  • Pins. Read the CLI pins from Dockerfile.agent ARGs, including ANTIGRAVITY_CLI_VERSION, ANTIGRAVITY_CLI_RELEASE_ID and ANTIGRAVITY_CLI_SHA512. Antigravity must be in the supported set.
  • Timings with those fixes. First run with provisioning: about 30 s. Warm: about 7.5 s (wake 0.8 s, restore 3.5 s, credential sync 2.6 s). Moving the restore to release takes it off the next run's startup. Please batch credential uploads, for example one tar through the filesystem API.

Findings from #3786 that the design must make impossible (add a test for each)

  • Workspace, result bundle and Antigravity HOME (including antigravity-oauth-token) left on the Sprite after release.
  • Log and scratch directories carrying one run's files into the next run.
  • Root-side cp -p from the agy entrypoint following an agent-planted symlink (.gemini-source/...propr-tmp-<pid>) and overwriting a root-owned file.

Acceptance

  • Unit and fake-Sprite tests (see test/helpers/fakeSprites.ts in [3764 by Claude Opus 5.5] SpritesRuntime: run agents on Fly Sprites #3786) covering:
    • every run starts from a restored checkpoint;
    • restore happens on release, including after a failed or killed run;
    • restore failure leads to destroy and recreate;
    • the export reader rejects symlinks, non-regular files and oversize files;
    • the org token is never in run env or logs.
  • test/spritesRuntime.live.test.ts (skipped without PROPR_SPRITES_LIVE_TOKEN) passes against a real Sprite.
  • Docs: docs/docs/architecture/agent-runtime.md and .env.example.
  • In the PR description, list exactly what still needs live verification. A maintainer will run a live three-agent E2E (Claude, Codex, Antigravity) on real Sprites before merge.

Activity

  1. propr-dev commented on Nov 24, 2026

    @propr-dev
    Contributor

    🤖 AI processing has started for this issue using codex agent with gpt-6.2-astra model.

    I'll analyze the problem and work on a solution. This may take a few minutes.

    Processing Details:

    • Agent: codex
    • Model: gpt-6.2-astra
    • Branch: 3789/gpt-6.2-astra-spritesruntime-restart-as-20261124-1821-3dv
    • Base Branch: 3758-epic-runtime-abstraction-sc0
    • Worktree: issue-3789-20261124-1821-gpt-6.2-astra-3dv

    🔍 Track Task Execution

  2. integry commented on Nov 24, 2026

    @integry
    OwnerAuthor

    Merged in #3791.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions