Repository navigation
Done
Labels
Description
An independent code review of the merged Sprites runtime (#3791) found Docker-executor behaviour that non-Docker runtimes skip or get wrong. I confirmed items 1–3 and 6 in the code; the others are plausible and need checking. The Fly Machines runtime (#3784, still open) has the same gaps for 1 and 2.
Fix at the source: shared run pipeline, not per-runtime copies
dockerExecutor.ts does extensions, workflow markers, the cost cap, the watchdog, diagnostics and redaction inline. Sprites re-implements some of these and leaves out others. Move the runtime-agnostic steps into a shared layer that wraps every AgentRuntime handle, and use it from SpritesRuntime. Make FlyMachinesRuntime use it when it lands; if #3784 merges first, wire it in here.
Findings
- 🔴 Extensions are silently ignored on Sprites and Fly Machines (
spritesExecution.ts). The extension mounts, gateway andbeforeLaunchfromextensionLaunchForDockerRunare never applied, and the output redactor covers only the Sprites org token, notcurrentExtensionLaunch().secrets. Admission (agentRunTrigger.ts:301/316) checks only the agent type. Required: support extensions through the shared layer, or refuse in admission with a clear message (a runtime capability flag such assupportsExtensions). Never run silently without them, and always redact extension secrets. - 🔴 Workflow hook and validation markers are never captured.
captureWorkflowMarkersis fed only bydockerExecutor, so a failingbefore_run/after_createhook no longer fails a Sprites run and every validation shows as unobserved. Feed the runtime handle's stderr through the shared marker capture. - 🔴 Provisioning counts against the agent timeout (
spritesRuntime.ts:49, whereAbortSignal.timeoutstarts instart()). On a cold worker with a short-timeout run, provisioning (up to 20 min) times out, the Sprite is deleted, and the next run is cold again, so the pool never warms. Start the agent timeout at launch, and give provisioning its own bound. Provisioning that already started should complete into the pool even if this run was cancelled. - 🟠
SpritePool.releasecan hang.restoreCheckpointhas no timeout, and a failed restore provisions a replacement insiderelease()with no abort signal. Add timeouts, and do the replacement in the background so the job's cleanup is not blocked andclose()can cancel it. - 🟠
close()and the cached pool promise. One rejected pool promise (for example a failed@fly/spritesimport) makesclose()reject, which skips the remaining shutdown insrc/worker.ts, and the rejected promise stays cached so every later run fails. UsePromise.allSettled, and drop rejected pools from the cache. - 🟠 Node engine mismatch.
@fly/spritesdeclaresengines.node >=24, but every worker image isnode:22-*. It works today (verified live on Node 22), but document the support status: either pin the SDK version that is known to work on 22 and add a CI smoke test on 22, or move the worker to Node 24. - 🟡
release()runs the credential export when the launcher never started (cost-cap refusal or a failure before launch). It then fails on the missingagent.jsonand logs a spurious release error. Skip the export when nothing was launched. - 🟡 Any WebSocket drop fails a long run while the agent keeps running on the Sprite (
reattach: false). At minimum, retry or reattach to the detachable session once before failing. - 🟡 Validate before acquiring. Build and validate the upload payload (clone shape, binds, env files, seed, token scan) before
pool.acquire(), so invalid runs fail without provisioning or restoring a Sprite. - 🟡 Startup work on every launch.
spritesCliVersionRefusalre-readsDockerfile.agentsynchronously on every launch; cache the pins.runtimeSelection.tsduplicatesresolveAgentRuntimeKind; reuse the registry constants.
Acceptance
- Unit tests for each item, where possible through the fake Sprite in
test/. - An extension run on Sprites is either supported end to end or refused at admission.
- A workflow hook failure fails a Sprites run.
- A maintainer reruns
test/spritesRuntime.live.test.tsbefore merge.
Activity
propr-dev commentedon Nov 24, 2026
🤖 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:
codexgpt-6.2-astra3794/gpt-6.2-astra-runtime-parity-for-sprite-20261124-2136-9kp3758-epic-runtime-abstraction-sc0issue-3794-20261124-2136-gpt-6.2-astra-9kp🔍 Track Task Execution
ci: share runtime parity features between Docker and Sprites
integry commentedon Nov 25, 2026
Merged in #3796.