Skip to content

SpritesRuntime: run agents on Fly Sprites #3764

Done

Description

@integry

Fly Sprites are persistent microVMs with Claude Code, Codex, Gemini CLI and others pre-installed, billed only on actual CPU/memory while active. They cannot boot custom images, and Docker inside a Sprite is unreliable, so the runtime drives the pre-installed CLIs directly.

Acceptance:

  • SpritesRuntime implements AgentRuntime using @fly/sprites (spawn + streamed stdout/stderr, kill, detachable sessions so a worker restart can reattach, filesystem API).
  • Uses clone workspace transport and the credential broker (files written via filesystem API, refreshed tokens read back).
  • Keeps the Sprite awake for the full run (output stream + Tasks/keep-awake renewal) and survives a cold pause gracefully (detect, fail clearly, no silent hang).
  • Agent CLI versions pinned by a setup script so behaviour matches the propr/agent image (same entrypoint contract as docker/ entrypoints).
  • Config: org-scoped Sprites token (secret), Sprite name prefix, region; SPRITES_CLIENT_SIGNALS=0 set by default.
  • Startup overhead measured and logged per run (wake/create, restore, clone, credential sync) and documented.
  • Live integration test gated behind an env token; unit tests with a mocked SDK.

Implementation

Add packages/core/src/agents/runtime/spritesRuntime.ts and a provider->Sprite command mapping reusing entrypoint scripts. Add settings to agent config and Web UI runtime selector. Start with Claude Code and Codex; others follow the same mapping.

Activity

  1. integry commented on Nov 24, 2026

    @integry
    OwnerAuthor

    Live check on a Sprite (2026-11-24): all three agent CLIs ran a small edit task from copied credentials. The credentials were written with the Sprites filesystem API, mode 0600, never written back, and removed afterwards.

    Agent Version on Sprite Invocation Result Peak RSS
    Claude Code 2.1.319 claude -p … --dangerously-skip-permissions --output-format json file created, exit 0, $0.031 (Haiku) ~234 MB
    Codex 0.167.0 codex exec --skip-git-repo-check --dangerously-bypass-approvals-and-sandbox … file created, exit 0 ~250 MB
    Antigravity agy 1.5.3 prompt on stdin, agy --dangerously-skip-permissions (matches AntigravityAgent.buildAntigravityShellCommand) file created, exit 0 ~441 MB

    Credential file paths on the Sprite (home /home/sprite):

    • ~/.claude/.credentials.json
    • ~/.codex/auth.json
    • ~/.gemini/antigravity-cli/antigravity-oauth-token

    The Sprite already has ~/.claude, ~/.codex and ~/.gemini directories of its own, so back up and restore rather than replace the directories.

    Notes for the implementation:

    • Version pinning: the preinstalled agy is 1.5.3, while ProPR pins 1.5.15. Claude Code and Codex also lag the propr/agent image. The setup script should pin all three.
    • Missing tools: the Sprite image has no bc and no GNU time. Use Node or date +%s%N for timings.
    • Token rotation: subscription OAuth tokens rotate on refresh. A copy that refreshes on a Sprite can invalidate the original on the control plane, so the credential broker (Per-run agent credential copies instead of read-write host credential mounts #3759) must write refreshed tokens back under a lock. Alternatively, copy only tokens that are still valid for longer than the run.
  2. integry commented on Nov 24, 2026

    @integry
    OwnerAuthor

    Observed on a live Fly deploy with PROPR_AGENT_RUNTIME=sprites: the worker still runs Docker agent-image preparation and liveness checks about every 30 s (Cannot determine the filesystem backing Docker image/build storage, docker ps failed). The Sprites runtime should turn off Docker-only preparation and sweeps when Docker isn't the selected runtime.

  3. propr-dev commented on Nov 24, 2026

    @propr-dev
    Contributor

    🤖 AI processing has started for this issue using claude agent with claude-opus-5-5 model.

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

    Processing Details:

    • Agent: claude
    • Model: claude-opus-5-5
    • Branch: 3764/claude-opus-5-5-spritesruntime-run-agents-20261124-1023-erw
    • Base Branch: 3758-epic-runtime-abstraction-sc0
    • Worktree: issue-3764-20261124-1023-claude-opus-5-5-erw

    🔍 Track Task Execution

  4. integry commented on Nov 24, 2026

    @integry
    OwnerAuthor

    Implemented by the restart #3789 / PR #3791, merged into the epic.

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