Repository navigation
[3767 by Claude Opus 5.5] FlyMachinesRuntime: ephemeral Fly Machine per run using propr/agent - #3784
Conversation
I added a `fly-machines` agent runtime that starts one ephemeral Fly Machine per run from the `propr/agent` image, with the image's own entrypoints. It has only been run against a fake Machines API and a local bash run of the launcher script — never against real Fly. Typecheck and lint pass, the 11 new tests pass, and the 10 existing runtime, credential and workspace-transport suites still pass. How you select it: set `PROPR_AGENT_RUNTIME=fly-machines`, or `runtime: fly-machines` on an agent. I didn't call it `fly`, because an existing test uses `fly` as its example of an unknown runtime. Configuration: - Required: `PROPR_FLY_API_TOKEN` (falls back to `FLY_API_TOKEN`), a deploy token scoped to the app, and `PROPR_FLY_APP`. - Optional: `PROPR_FLY_REGION` and `PROPR_FLY_MACHINE_SIZE` (`shared-cpu-<n>x` / `performance-<n>x`, default `performance-2x`). Memory comes from `PROPR_FLY_MACHINE_MEMORY_MB`, else the run's memory limit. - `PROPR_FLY_IMAGE`: needed when the run's image is only built locally, because Fly can't pull a local image. What a run does: - Creation: each run is a Machine created through `api.machines.dev/v1` with auto-destroy on exit and restart policy `no`. - Workspace: runs always use the clone workspace transport, since Fly can't bind-mount the worktree. - Credentials: a new step (`agentRunFileUpload.ts`) turns credential mounts into per-run copies from the credential broker, uploaded as files. Refreshed tokens are read back after the run and written to the canonical store. Other mounted files are copied in (up to 16 MiB); log directories start empty. - Prompt and output: Machines have no stdin, so a small launcher script feeds the prompt from a file. It forwards stop signals to the agent and keeps exact stdout/stderr in files. It also sends output to the console so the Fly logs API streams it live. - Results: after the agent exits, the Machine waits so the worker can read the exact output and the clone result, then the worker destroys it. - Stop, cancel, liveness: `stop()` signals the agent and the run ends with its exit code. If the agent doesn't exit in time, or the run is cancelled, the Machine is destroyed. Liveness comes from the Machine's state, and a crash or out-of-memory exit takes its exit code from Fly's record. - MCP over `.internal`: private networking is declared only when the control plane runs on Fly. Runs then reach ProPR at `http://<app>.internal:<port>/api/mcp`, which you set as `PROPR_INTERNAL_API_URL` or `PROPR_AGENT_MCP_URL`. Elsewhere they use a reachable URL with the per-run token. - Cold start and pre-warm: the time from create to started (image pull plus boot) is logged per run. `PROPR_FLY_PREWARM=1` pulls the image in the region once at startup and logs how long it took. Things to know before using it: - Restricted network runs are refused. Fly has no per-Machine outbound allowlist. - Docker-only safeguards don't apply. The spend cap, admission slots and activity watchdog are not enforced for Fly runs. - Secrets are readable through the token. Environment secrets and uploaded credential copies sit in the Machine config, which anyone holding the deploy token can read until the Machine is destroyed. - Every run must start as root. The clone transport requires it. I'm also assuming Fly starts the process as root; if it doesn't, the launcher refuses the run with a clear message rather than running it wrongly. - Assumed API details. The request formats for exec and logs follow Fly's Go client and public docs. The real API should be checked before relying on this. I also updated the two architecture pages (`agent-runtime.md`, `coding-agent-integration.md`). No previews were made, since nothing here is visible in the UI. ProPR-Agent: claude/claude-opus-5-5
|
🔀 Resolved merge conflicts from Conflicting Files
Resolution SummaryResolved both merge conflicts in the runtime registry.
The workspace scan found no remaining merge conflict markers. TypeScript syntax, the core type check, and all 50 targeted tests passed. Git could not mark the file resolved in the index because the index resides on a read-only filesystem. The resolved file is saved in the workspace. 🤖 Resolution Details
System-triggered merge conflict resolution |
|
/ultrafix goal=8 max=10 |
|
🔄 Ultrafix loop started (goal: 8/10, max cycles: 10) First action:
|
Automatically resolved merge conflicts after merging target branch into PR branch. Resolved conflicts in: - packages/core/src/agents/runtime/registry.ts PR: #3784 Model: GPT-6.2 Sol
|
✅ AI Code Review Complete requested by @propr-ultrafix Posted 1 review: |
|
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 b065f31 Summary of ChangesFixed: the shard failed on the new Cause: the runtime modules the test imports pull in Fix: I added the same Verification:
I didn't re-run the rest of Shard 2. The CI log shows this file as the only failure there. Review digestRisk-tiered paths
Diff size: 1 file changed, +9/−1 lines 🤖 Implementation Details
Undo Changes • View Task Execution 💡 ProPR Slash Commands
🤖 Generated by ProPR |
Fixed: the shard failed on the new `test/flyMachinesRuntime.test.ts`. All 11 tests in it passed, but the process never exited, so the runner killed it at 180s and marked it failed. **Cause:** the runtime modules the test imports pull in `@propr/core`, which opens the shared SQLite connection when it loads. Nothing in the test closed that connection, so it kept the process alive. Other runtime tests avoid this by closing the connection at the end — `test/agentRuntimeNetworkCapability.test.ts` does it, for example. **Fix:** I added the same `after()` hook to `test/flyMachinesRuntime.test.ts`. It calls `closeConnection()` and also deletes the temporary credential-run directory the test creates. The runtime code itself is unchanged. **Verification:** - The file alone with `tsx --test`: 11 passed, exited 0 in about 7s. Before the fix it hung until my 60s timeout. - The file through the CI runner (`node scripts/run-test-suite.mjs test/flyMachinesRuntime.test.ts`): passed in 6.7s. I didn't re-run the rest of Shard 2. The CI log shows this file as the only failure there. PR: #3784 Comment by: @propr-dev[bot] (ID: 7130112915) Model: Claude Opus 5.5 ProPR-Agent: claude/claude-opus-5-5
🔍 AI Code Review — codex:gpt-6-astraOverall EvaluationThis PR adds a Fly Machines runtime with clone-based workspaces, credential uploads, output capture, and lifecycle management. It needs significant corrections before merge, particularly around termination and preservation of credentials and workspace results. ✅ Runtime integration — The dispatcher registers ✅ Explicit network limitations — The capability declaration refuses restricted-network runs instead of claiming unsupported enforcement. ✅ Bounded output capture — Live output uses existing bounded buffers, and final stdout/stderr reads have explicit limits. The supplied current-head checks show 18 passed, no failures, and no pending checks. This review is a static analysis 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. F1: 🔴 Timeout settles without stopping execution
F2: 🔴 Failed cancellation disables subsequent cleanup
F3: 🔴 Collection time overwrites newer credentials
F4: 🔴 Failed credential write-back loses refreshed tokens
F5: 🔴 Retained workspace results still self-destruct
F6: 🔴 Credential size limit applies after allocation
SuggestionsThese are optional follow-ups and are not sent to S1: 🟢 Validate the actual Fly contractThe fake API accepts the request and response shapes defined by this implementation, so it cannot independently validate exec, logs, upload permissions, or image-user behavior. An opt-in integration smoke test against Fly would provide valuable deployment confidence. This is an additional verification recommendation, not a claim that those API assumptions are wrong. S2: 🟢 Update runtime overview wordingThe architecture pages still say every agent runs in Docker, while their new sections describe Fly execution. Updating those introductory statements would make the documentation consistent. This is editorial cleanup and does not block runtime correctness. ScoreThe integration is coherent and current checks pass, but termination and recovery defects can leave execution running or lose credentials and workspace results. These require correction before merge. 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 800d335
Summary of ChangesI've fixed all six findings (F1–F6) and added a regression test for each. All 19 tests in F1 – a timed-out run kept executing. After the grace period the worker now kills the agent's whole process group: the launcher starts the agent in its own session ( F2 – a failed cancel destroy blocked cleanup. The Machine counts as gone only after a destroy request succeeds (a 404 also counts). After a failure, cleanup retries it, starting at 30s and backing off to 10 minutes. A failed F3 – collection time overwrote newer credentials. Remote reads now return the file's modification time inside the Machine, and the broker uses that to decide which copy is newer. A runtime that reports no modification time gets time 0, so a canonical credential that changed meanwhile is kept, never overwritten. F4 – failed write-back lost refreshed tokens.
F5 – retained runs still self-destructed. F6 – credential size checked after download. Remote reads accept a size limit and refuse an oversized file right after the size check, before downloading any of it. Credential reads pass the 1 MiB limit, and oversized files are never written back. The exit-status file read now has a small limit too. Other changes:
Checks:
Limits that can't be fully fixed:
Not fixed (outside these findings): the clone transport still reads the workspace result bundle through Review digestRisk-tiered paths
Diff size: 7 files changed, +597/−92 lines 🤖 Implementation Details
💡 ProPR Slash Commands
🤖 Generated by ProPR |
I've fixed all six findings (F1–F6) and added a regression test for each. All 19 tests in `test/flyMachinesRuntime.test.ts` pass. Against the original code, all 8 new tests fail. As before, this has only run against the fake Machines API plus a local bash run of the launcher, never against real Fly.
**F1 – a timed-out run kept executing.** After the grace period the worker now kills the agent's whole process group: the launcher starts the agent in its own session (`setsid`) and records its pid. The Machine stays, so partial output and result files are still readable. If the kill isn't confirmed, the Machine is destroyed before the run settles. If the destroy also fails, the run fails instead of reporting a timeout. The same rule now covers every error after the Machine is created, including a start timeout: the run never settles while the agent might still be running.
**F2 – a failed cancel destroy blocked cleanup.** The Machine counts as gone only after a destroy request succeeds (a 404 also counts). After a failure, cleanup retries it, starting at 30s and backing off to 10 minutes. A failed `release()` no longer gets cached, so the next call tries again.
**F3 – collection time overwrote newer credentials.** Remote reads now return the file's modification time inside the Machine, and the broker uses that to decide which copy is newer. A runtime that reports no modification time gets time 0, so a canonical credential that changed meanwhile is kept, never overwritten.
**F4 – failed write-back lost refreshed tokens.**
- **Write-back fails:** the refreshed copy is saved (fsynced) to a root-only `<run>-recovered-*` directory under the credential run root. It carries the same "retained" marker as host staging, so it is never swept. The location is logged and returned.
- **Credential can't be read back, or can't be saved:** the Machine may hold the only copy, so it is kept and `release()` doesn't destroy it. An operator has to remove it by hand.
**F5 – retained runs still self-destructed.** `retain()` now writes a marker into the Machine, and the launcher keeps waiting while the marker exists until the Machine is destroyed. File reads made after `retain()` wait for the marker to be written first. One gap remains: if `retain()` is called after the linger has already run out (at least 30s, default 15 min), the Machine is already gone.
**F6 – credential size checked after download.** Remote reads accept a size limit and refuse an oversized file right after the size check, before downloading any of it. Credential reads pass the 1 MiB limit, and oversized files are never written back. The exit-status file read now has a small limit too.
**Other changes:**
- **New method:** `AgentRunHandle` gets an optional `readFileWithStat(path, { maxBytes })`.
- **Docs:** `agent-runtime.md` is updated to describe this behaviour.
**Checks:**
- **Launcher, run locally in bash:** an agent ignoring SIGTERM, together with a child process, is killed and records exit 137. A retained run keeps waiting past its linger and exits on SIGTERM. An unretained run still exits when its linger ends.
- **Other suites, typecheck, lint:** the 8 neighbouring suites pass (five of them need `--experimental-test-module-mocks`). Core typecheck and both zero-warning lint gates are clean.
**Limits that can't be fully fixed:**
- **Clock skew:** the Machine's clock can differ from the clock that dates the canonical file, and nothing here can correct that.
- **Lost create response:** if the create request succeeds but its response never arrives, there is no Machine id to destroy.
**Not fixed (outside these findings):** the clone transport still reads the workspace result bundle through `readFile` with no size limit.
PR: #3784
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 an ephemeral Fly Machines runtime with clone-based workspaces, credential uploads, output capture, and lifecycle management. It needs changes before merge because credential recovery and Machine cleanup have concrete failure paths. ✅ Workspace integration — Dispatch preserves clone preparation and collects credentials before workspace cleanup releases the handle. ✅ Bounded credential transfers — Credential reads check remote file size before transferring content and preserve remote modification times for concurrent write-back decisions. ✅ Explicit capability limits — The runtime declares unsupported bind mounts and restricted networking, allowing dispatch to refuse incompatible runs. This review is a static analysis of the supplied code; no commands were run. Current checks report 16 passed, one pending, and no failures. Merge blockersEvery finding below was introduced by this PR and must be resolved before merging. F7: 🔴 Reject symlinks when collecting credentials
F8: 🔴 Preserve refreshes from unwritable stores
F9: 🔴 Retry failed explicit Machine releases
SuggestionsThese are optional follow-ups and are not sent to S3: 🟢 Validate the real API contractThe fake API accepts exactly the request shapes implemented by this client, so it cannot independently validate authentication, file injection, signal requests, pagination, or exec response limits. An opt-in real-Fly smoke test would strengthen confidence in those assumptions. This is optional validation beyond the concrete defects above. S4: 🟢 Share credential recovery helpersThe upload module duplicates ScoreThe implementation covers substantial lifecycle behavior, but privileged credential reads, lost refreshes, and indefinite Machine retention remain merge blockers. Passing checks and focused fake-API tests do not cover these 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 be55f62
Summary of ChangesI fixed all three findings (F7, F8, F9). The 22 tests in F7 — Reject symlinks when collecting credentials
F8 — Preserve refreshes from unwritable stores
F9 — Retry failed explicit Machine releases
Tests
Other changes and remaining limits
Review digestRisk-tiered paths
Diff size: 6 files changed, +288/−61 lines 🤖 Implementation Details
💡 ProPR Slash Commands
🤖 Generated by ProPR |
I fixed all three findings (F7, F8, F9). The 22 tests in `test/flyMachinesRuntime.test.ts` pass, typecheck is clean, and lint passes with zero warnings. As before, none of this has been run against real Fly; it was all checked against the fake Machines API.
## F7 — Reject symlinks when collecting credentials
- **New credential-only reader:** `readCredentialFile(root, relative, { maxBytes })`, added as an optional method on `AgentRunHandle` in `types.ts`. Its Fly implementation lives in a new file, `flyMachinesFileRead.ts`. The general `readFile`/`readFileWithStat` reader is unchanged and still used for output and results.
- **What the reader refuses:**
- Before running anything, it rejects paths whose segments are `..`, `.` or empty, or whose root is not absolute.
- On the Machine, it refuses a symlink anywhere on the path, including the store directory and its parents.
- **How it reads:** one shell script that:
- enters the directory with `cd -P` and checks `pwd -P` is exactly the expected path.
- checks the name isn't a symlink and is a regular file.
- opens the file and checks `/proc/$$/fd/3` points at exactly that path, so a symlink swapped in after the checks is still caught.
- takes the size, modification time and content all from that one open file. Reads are capped at the limit plus one byte, so a file that grows after the size check is refused.
- **What happens on a refusal:** a symlinked output is logged and treated as missing, the same as the host collector's `readRegularFileInside`.
- **Collector change:** `agentRunFileUpload.ts` now reads credentials only through this reader. A handle without it counts as unread, so the run is kept rather than read through the general reader.
## F8 — Preserve refreshes from unwritable stores
`uploadAgentRunFiles` now refuses the run before any Machine is created if a writable credential mount points at a store the worker can't write to. That matches the host's behaviour when per-run copies are explicitly requested, since a Fly run has no direct mount to fall back to. Read-only mounts still run.
## F9 — Retry failed explicit Machine releases
- **Retries:** `release()` now marks the release as requested. Any failed destroy, including a failed explicit release of a retained Machine, is retried with doubling backoff capped at 10 minutes until one succeeds. The scheduled retries go through the same path.
- **Retain after release:** `retain()` no longer cancels a pending retry once release has been requested.
- **Unchanged:** an automatic removal that fails after a concurrent `retain()` still leaves the Machine to whoever retained it.
## Tests
- **New regressions** (all three fail against the previous versions of the two source files):
- **Symlinks:** the real reader script runs under `/bin/sh` against real symlinks — a symlinked file, a symlinked parent directory, a symlinked store root, a directory, a missing file, an oversized file, and `..` or absolute paths. A handle with only the general reader is never used for credentials.
- **Unwritable store:** the run is refused, the runtime's `start()` is never called, and a read-only mount still works.
- **Release retries:** a failed `release()` of a retained Machine is retried at 60 s, then again at 120 s, with no further `release()` call, and stops once the destroy succeeds.
- **Updated:** the existing upload and write-back tests now supply the credential reader in their fake handles.
- **Neighbouring suites:** the credential broker, runtime registry, worker credentials, workspace transport, context analysis and review scout suites all pass when run with `--experimental-test-module-mocks`, as `test:unit` does.
## Other changes and remaining limits
- **Line limit:** to stay under the 400-line lint limit, the existing general Machine file reader moved unchanged from `flyMachinesRunHandle.ts` into the new `flyMachinesFileRead.ts`.
- **Docs:** `agent-runtime.md` now describes the symlink refusal, the refusal of unwritable stores, and the retry behaviour.
- **Things it can't fully stop** (none returns content from outside the store):
- If an agent process left running swaps in a FIFO between the checks and the open, the exec times out. That output then counts as unread, so the Machine is kept.
- A hard link to a root-owned file is not detected by the path check. It relies on the kernel's `protected_hardlinks` setting, which normally blocks the agent from creating one.
PR: #3784
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 EvaluationThe PR adds a substantial Fly Machines runtime with clone workspace transport, credential upload/write-back, output capture, and lifecycle management. It needs changes before merge: forced timeouts can lose workspace changes, and release during creation can disable cleanup retries. ✅ Credential isolation — Uploads use provider manifests, and credential collection exclusively uses the confined reader. ✅ Recovery coverage — Tests exercise failed credential commits, retention, cancellation, and repeated destruction failures. This review used static analysis of the supplied code; no commands were run. Current checks show 13 passed, four pending, and no failures. Merge blockersEvery finding below was introduced by this PR and must be resolved before merging. F10: 🔴 Forced timeout kills workspace finalization
F11: 🔴 Early release can suppress destruction retries
SuggestionsThese are optional follow-ups and are not sent to S5: 🟢 Validate the real API contractAn opt-in integration smoke test would strengthen confidence in creation, uploaded permissions, exec responses, and log pagination. The fake API reproduces the client’s assumptions, so it cannot independently validate them. This is optional here because no specific external API incompatibility was established. S6: 🟢 Correct the credential reader documentation
ScoreThe implementation has useful recovery logic and focused tests, but two lifecycle defects remain in consequential paths. Passing checks do not cover these sequences. 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 acf6bc9
Summary of ChangesI fixed both findings, F10 and F11, and added regression tests for each. Every new test fails against the old code and passes with the fix. Typecheck and lint for F10: a forced timeout no longer kills the clone wrapper
F11:
|
| Command | Description | Example |
|---|---|---|
/merge |
Merge target branch into this PR and resolve conflicts | /merge |
/review |
Request an AI code review | /review or /review claude-sonnet |
/fix |
Address review blockers, or blockers and suggestions with /fix all |
/fix, /fix all, or /fix F3 S5 |
/switch |
Change the AI model for this PR | /switch claude-opus |
/use |
Override the model for a single follow-up run | /use claude-sonnet |
/ultrafix |
Loop review→fix cycles until score goal is met | /ultrafix or /ultrafix goal=8 max=10 |
🤖 Generated by ProPR
I fixed both findings, F10 and F11, and added regression tests for each. Every new test fails against the old code and passes with the fix. Typecheck and lint for `packages/core` are clean. The full suites pass: `flyMachinesRuntime` (24 tests), the new `flyMachinesForcedStop` (2), and `workspaceTransport` (22). `workspaceTransport` needs `PROPR_DEMO_MODE=true` in this container, or it exits early on the GitHub-auth banner. As before, none of this has run against real Fly. ### F10: a forced timeout no longer kills the clone wrapper - **Wrapper phase** (`workspaceTransportScript.ts`): the clone wrapper writes a `phase` file in its result directory. It says `agent` while the agent runs and `finalizing` once it starts the snapshot and publish. The worker never reads this file, so Docker runs behave as before. - **New forced-stop script** (`FLY_FORCED_STOP_SCRIPT` in `flyMachinesLaunch.ts`): it pauses the wrapper while it reads the phase, so the wrapper can't start finalizing in between. Then it acts on the phase: - **`agent`:** it kills every other process in the run's session: the agent, its children and anything it left behind. The wrapper sees its agent exit, then snapshots and publishes. - **`finalizing`:** it kills nothing. - **No phase yet, or a run without the clone wrapper:** it kills the whole process group, as before. - **Waiting for finalization** (`stopAfterTimeout`): for clone runs the handle waits up to 3 minutes for the launcher to record the exit before it collects the result. The fallback is unchanged: if that doesn't happen, the Machine is destroyed. - **Tests:** - The main regression runs the real launcher and the real clone wrapper locally. Its agent edits files, leaves a process behind and ignores TERM. The test checks that the exit is 137, the leftover process is dead, the status is `pushed`, and the result ref on the remote has the edited files. With the old kill command the status file is never written. - A second test checks that a `finalizing` wrapper is spared and not left paused, and that the whole group is killed when there is no phase. - A third test, using the fake Machines API, checks that the run waits past the old 15-second window while the wrapper finalizes. ### F11: `release()` during a slow create - **Fix:** after `stop()` gives up, `destroy()` now waits for the run itself to settle before checking for a Machine. A Machine whose create request returns late is then destroyed by the release. If that destroy fails, the release rejects instead of caching a success, and retries are scheduled. - **Test:** the create request is held past `stop()`'s 15-second window, then the cancellation's DELETE and the release's DELETE both fail. The test checks that the release stayed pending, then rejected, and that the automatic retry destroys the Machine. With the old code the release resolved early. The architecture page (`agent-runtime.md`) and the wrapper's header comment now describe both behaviours. ### Separate issues I noticed but did not change - **Docker runs:** a Docker clone run that times out is stopped with its whole container, wrapper included. It probably loses its changes the same way, but the Docker path is outside this PR's changes. - **Late TERM:** the wrapper stops forwarding TERM once it starts finalizing, so a second TERM during finalization (for example from `stop()`) would kill it. The timeout path sends TERM only once. No previews, since nothing here is visible in the UI. PR: #3784 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 EvaluationThe PR adds an ephemeral Fly runtime with clone-based workspaces, uploaded credentials, output capture, and cleanup. It needs changes before merge because it silently drops security requirements and accepts unreadable environment files. ✅ Credential confinement — Credential collection exclusively uses the confined reader, with size limits and recovery handling for failed write-back. ✅ Workspace preservation — Forced timeout handling distinguishes agent execution from clone finalization, with tests covering preservation of workspace changes. This review used static analysis of the supplied code; no commands were run. Current checks show 13 passed, four pending, and no failures. Merge blockersEvery finding below was introduced by this PR and must be resolved before merging. F12: 🔴 Reject unsupported filesystem security requirements
F13: 🔴 Fail launch for unreadable environment files
SuggestionsThese are optional follow-ups and are not sent to S7: 🟢 Add a live Fly smoke testThe fake API exercises lifecycle logic extensively but implements the same request and response assumptions as the client. An opt-in smoke test covering uploads, exec, logs, signals, and destruction would provide independent integration evidence. This is an optional validation improvement, not a separately demonstrated defect. ScoreThe implementation has substantial lifecycle coverage, but two launch-contract regressions require correction. Pending checks are not themselves blockers. 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 640d90e
Summary of ChangesI've fixed both findings in F12 — security requirements. I went through every
F13 — environment files. Found separately, not changed: the Fly upload step ( The credential broker tests only run with Review digestRisk-tiered paths
Diff size: 3 files changed, +80/−8 lines 🤖 Implementation Details
💡 ProPR Slash Commands
🤖 Generated by ProPR |
I've fixed both findings in `flyMachinesLaunch.ts`: a Fly run now fails before any Machine is created if it asks for a security restriction Fly can't enforce, or if one of its environment files can't be read. The Fly test file passes (26 tests, 2 new), the credential broker tests pass (23), and `packages/core` typechecks. This is still checked only against the fake Machines API and a local bash run, never real Fly. **F12 — security requirements.** I went through every `spec.security` field before Machine creation: - **Refused:** a read-only root filesystem, any dropped capabilities, and any security option other than those below. The error names the field. - **Allowed:** `seccomp=unconfined` and `apparmor=unconfined`, which only switch off confinement a Machine never applies. Added capabilities are also allowed: the run starts as root and already has them all. - **Now enforced:** no-new-privileges, set through the field or the `no-new-privileges` option. I didn't refuse it, because every run turns it on by default, so refusing would block every Fly run. Instead the launcher runs the agent under `setpriv --no-new-privs`, so a setuid program can't gain privileges, like Docker's option. A local run of the launcher confirmed it wraps the agent only when asked to. **F13 — environment files.** `envFileValues` (in `hostCredentialStaging.ts`) takes a new `required` option. The Fly renderer passes it, so an unreadable file fails the launch with "Cannot read environment file …". Docker's staging path keeps the old behaviour (empty map, Docker refuses the file later). The new test confirms both paths, and that no Machine is created on failure. **Found separately, not changed:** the Fly upload step (`agentRunFileUpload.ts`) still reads env files the lenient way when choosing fallback secrets. The run then fails at the renderer, before any Machine exists, so this does nothing to what the agent sees. The credential broker tests only run with `--experimental-test-module-mocks`; without it they fail with `mock.module is not a function`. PR: #3784 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: |
|
CI failed: Full Test Suite Shard 3/4 Please investigate and fix this CI failure.
Failure evidence
|
|
✅ Applied the requested follow-up changes in commit 29bcf5f
Summary of ChangesFixed F33. When Fly cannot retrieve a complete stdout or stderr capture, the result names the affected stream in All 54 Fly runtime tests passed, including regressions for independent stream failures and short reads. Core typecheck passed. Live Fly E2E verification remains with the maintainer. Review digestRisk-tiered paths
Diff size: 3 files changed, +46/−4 lines 🤖 Implementation Details
💡 ProPR Slash Commands
🤖 Generated by ProPR |
Fixed F33. When Fly cannot retrieve a complete stdout or stderr capture, the result names the affected stream in `outputIncomplete`, preserves available output, and changes a zero exit code to `-1`. The shared pipeline treats the run as disconnected even if workflow reports were retrieved successfully. All 54 Fly runtime tests passed, including regressions for independent stream failures and short reads. Core typecheck passed. Live Fly E2E verification remains with the maintainer. PR: #3784 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: |
Live Fly E2E at head a46f296 (2026-11-25)Image:
The earlier live blockers (uid 1000, safe.directory, Machine cap/linger, digest docs) are resolved. The remaining review item F33 (capture-read failure reported as success) is a correctness edge case that a live run cannot easily trigger. Fix it, and then this PR is live-verified. |
|
ℹ️ Analyzed the follow-up request by @integry Analysis SummaryF33 is already fixed in I reran all four F33 regression tests against the fake Fly API. All passed. No additional code changes were needed. 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 adds an ephemeral Fly Machines runtime with credential upload, clone workspace transport, and shared execution monitoring. It needs a small correction before merge: phase publication omits the explicitly requested fsync. ✅ Shared execution pipeline — Fly calls ✅ Explicit capability refusals — Extensions and restricted networking are refused before Machine creation. ✅ Phase publication coverage — Temporary-file replacement preserves the previous phase during publication, and the new regression test exercises interruption during the rename. Current-head checks report 19 passed and no failures or pending checks. This was a static review; no commands were run. The omitted Merge blockersEvery finding below was introduced by this PR and must be resolved before merging. F34: 🔴 Sync phase files before publication
SuggestionsThese are optional follow-ups and are not sent to S30: 🟢 Finish consolidating capability refusals
S31: 🟢 Complete the planned live validationThe maintainer’s planned task and ScoreThe implementation has substantial lifecycle safeguards and passing current checks. One explicit acceptance requirement remains incomplete, and the omitted runtime test file limits coverage assessment. Score: 6/10 🤖 Review Details
Files omitted from review diff1 file was omitted from the review diff. Large, binary, generated, and lockfile changes are deprioritized. No patch content from GitHub (a larger review budget cannot recover these)
Copy and edit to choose records from this review: 🤖 Review by ProPR |
|
✅ Applied the requested follow-up changes in commit ae7c736
Summary of ChangesAddressed F34. The wrapper now writes each A new regression forces the first sync to fail for each phase and verifies that rename follows a successful sync of the complete file. The existing stop-during-publication regression also passed. Across the Fly forced-stop and workspace transport suites, 31 tests passed and one root-only test was skipped. The live Fly E2E remains pending the maintainer’s rerun. Review digestRisk-tiered paths
Diff size: 2 files changed, +35/−3 lines 🤖 Implementation Details
💡 ProPR Slash Commands
🤖 Generated by ProPR |
Addressed F34. The wrapper now writes each `agent` and `finalizing` phase to a temporary file in the same directory, fsyncs it, and renames it only after sync succeeds. A failed sync triggers the existing retry loop and leaves the published phase intact. A new regression forces the first sync to fail for each phase and verifies that rename follows a successful sync of the complete file. The existing stop-during-publication regression also passed. Across the Fly forced-stop and workspace transport suites, 31 tests passed and one root-only test was skipped. The live Fly E2E remains pending the maintainer’s rerun. PR: #3784 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: |
🔍 AI Code Review — codex:gpt-6-astraOverall EvaluationThe PR adds an ephemeral Fly Machines runtime with credential upload, workspace recovery, and shared pipeline integration. It needs changes before merge because initial phase publication introduces a window where stopping a run can lose workspace changes. ✅ Shared pipeline integration — Fly calls ✅ Atomic phase replacement — Phase updates write a temporary file, sync it, and rename it, preserving the previous complete value during replacement. This is a static review of the supplied code. No commands were run. Coverage is partial because Merge blockersEvery finding below was introduced by this PR and must be resolved before merging. F35: 🔴 Publish the initial phase before starting the agent
SuggestionsThese are optional follow-ups and are not sent to S32: 🟢 Reuse the extension refusal helper
S33: 🟢 Complete runtime verificationReview the omitted runtime test file and record the planned live Fly task and ScoreThe implementation addresses substantial runtime and recovery requirements, but the initial phase publication window still permits loss of completed agent edits. Current validation has no reported failures; runtime test coverage could not be fully inspected. Score: 6/10 🤖 Review Details
Files omitted from review diff1 file was omitted from the review diff. Large, binary, generated, and lockfile changes are deprioritized. No patch content from GitHub (a larger review budget cannot recover these)
Copy and edit to choose records from this review: 🤖 Review by ProPR |
|
✅ Applied the requested follow-up changes in commit 5b0899a
Summary of ChangesFixed F35. The clone wrapper now publishes the initial Regression tests cover graceful and forced stops on both sides of the initial rename, publication failure, and preservation of workspace changes during the Across the Fly runtime and workspace transport suites, 90 tests passed and one root-only test was skipped. The live Fly E2E remains pending for the maintainer. Review digestRisk-tiered paths
Diff size: 3 files changed, +88/−52 lines 🤖 Implementation Details
💡 ProPR Slash Commands
🤖 Generated by ProPR |
Fixed F35. The clone wrapper now publishes the initial `agent` phase and installs its signal traps before starting the child. If publication fails, bootstrap aborts. Fly also records a stop that arrives between publication and child startup, so the agent cannot miss it. Regression tests cover graceful and forced stops on both sides of the initial rename, publication failure, and preservation of workspace changes during the `finalizing` rename. Across the Fly runtime and workspace transport suites, 90 tests passed and one root-only test was skipped. The live Fly E2E remains pending for the maintainer. PR: #3784 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: |
🔍 AI Code Review — codex:gpt-6-astraOverall EvaluationThis PR adds an ephemeral Fly Machines runtime with credential uploads, clone workspace transport, and shared execution safeguards. It needs changes before merge because captured-output reconciliation can silently omit usage records from cost accounting. ✅ Atomic phase publication — Both wrapper phases use a temporary file, sync, and rename; regression tests exercise stops around publication. ✅ Explicit capability refusals — Fly declares extensions unsupported and rejects restricted networking before Machine creation. ✅ Shared pipeline integration — Fly connects workflow-report capture, redaction, cost monitoring, and the watchdog to This is a static review; no commands were run. The supplied diff omits Merge blockersEvery finding below was introduced by this PR and must be resolved before merging. F36: 🔴 Capture truncation silently drops usage accounting
SuggestionsThese are optional follow-ups and are not sent to S34: 🟢 Consolidate extension refusal wording
ScoreThe implementation addresses the requested phase publication and pipeline integration, but usage recovery still has a concrete correctness gap. Current checks have no failures; assessment of the omitted runtime tests remains limited. Score: 6/10 🤖 Review Details
Files omitted from review diff1 file was omitted from the review diff. Large, binary, generated, and lockfile changes are deprioritized. No patch content from GitHub (a larger review budget cannot recover these)
Copy and edit to choose records from this review: 🤖 Review by ProPR |
|
✅ Applied the requested follow-up changes in commit 83737d2
Summary of ChangesFixed F36. Cost-monitored Fly Machines runs now scan the complete stdout capture before settling cost. Reconciliation counts repeated records individually and skips occurrences already observed live. If a read fails or a reconciliation limit is reached, the result explicitly reports incomplete usage accounting. Regression tests verified that missing usage triggers the cap exactly once after log delivery fails, including when both display buffers have truncated output. All 106 Fly, Sprites, and cost-cap tests passed. Core typecheck and runtime-file lint passed. Live Fly E2E remains pending for the maintainer. Review digestRisk-tiered paths
Diff size: 3 files changed, +146/−25 lines 🤖 Implementation Details
💡 ProPR Slash Commands
🤖 Generated by ProPR |
Fixed F36. Cost-monitored Fly Machines runs now scan the complete stdout capture before settling cost. Reconciliation counts repeated records individually and skips occurrences already observed live. If a read fails or a reconciliation limit is reached, the result explicitly reports incomplete usage accounting. Regression tests verified that missing usage triggers the cap exactly once after log delivery fails, including when both display buffers have truncated output. All 106 Fly, Sprites, and cost-cap tests passed. Core typecheck and runtime-file lint passed. Live Fly E2E remains pending for the maintainer. PR: #3784 Comment by: @propr-ultrafix (ID: 0) Model: GPT-6.2 Astra ProPR-Agent: codex/gpt-6.2-astra
|
|
|
Pausing this PR; it stays open as a reference. It works live (task, stop mid-run, Machine cleanup), but the dual output path (live logs plus capture reconciliation) keeps producing edge cases (36 findings). It is restarted as #3798 with a focused spec: capture files are the only source for the result and accounting, live logs are display-only, there is one atomic status file, the Machine is destroyed on release, and the size budget is about 1,500 lines. All the live-verified Fly facts from this PR (digest image, root via |
|
ℹ️ Analyzed the follow-up request by @integry Analysis SummaryWork on #3784 is paused. The PR stays open as a reference for the live Fly checks covering task completion, mid-run stop, and Machine cleanup. The capture-only redesign belongs to #3798. No files were changed. No code changes were necessary based on the current state of the branch. 🤖 Analysis Details
💡 ProPR Slash Commands
🤖 Generated by ProPR |
|
❌ Failed to resolve merge conflicts from System-triggered merge conflict resolution |
|
Superseded by #3801 (FlyMachinesRuntime restart on a focused spec), which is merged into the epic after live Fly verification: a real Claude task, stop/SIGTERM, credential write-back, and no Machines left behind. |
AI Implementation Summary
Closes #3767
Branch:
3767/claude-opus-5-5-flymachinesruntime-epheme-20261124-1023-ez4Commits: ✅ Changes committed (8c4a3db)
AI Processing Completed
Execution Details:
Summary:
I added a
fly-machinesagent runtime that starts one ephemeral Fly Machine per run from thepropr/agentimage, with the image's own entrypoints. It has only been run against a fake Machines API and a local bash run of the launcher script — never against real Fly. Typecheck and lint pass, the 11 new tests pass, and the 10 existing runtime, credential and workspace-transport suites still pass.How you select it: set
PROPR_AGENT_RUNTIME=fly-machines, orruntime: fly-machineson an agent. I didn't call itfly, because an existing test usesflyas its example of an unknown runtime.Configuration:
PROPR_FLY_API_TOKEN(falls back toFLY_API_TOKEN), a deploy token scoped to the app, andPROPR_FLY_APP.PROPR_FLY_REGIONandPROPR_FLY_MACHINE_SIZE(shared-cpu-<n>x/performance-<n>x, defaultperformance-2x). Memory comes fromPROPR_FLY_MACHINE_MEMORY_MB, else the run's memory limit.PROPR_FLY_IMAGE: needed when the run's image is only built locally, because Fly can't pull a local image.What a run does:
api.machines.dev/v1with auto-destroy on exit and restart policyno.agentRunFileUpload.ts) turns credential mounts into per-run copies from the credential broker, uploaded as files. Refreshed tokens are read back after the run and written to the canonical store. Other mounted files are copied in (up to 16 MiB); log directories start empty.stop()signals the agent and the run ends with its exit code. If the agent doesn't exit in time, or the run is cancelled, the Machine is destroyed. Liveness comes from the Machine's state, and a crash or out-of-memory exit takes its exit code from Fly's record..internal: private networking is declared only when the control plane runs on Fly. Runs then reach ProPR athttp://<app>.internal:<port>/api/mcp, which you set asPROPR_INTERNAL_API_URLorPROPR_AGENT_MCP_URL. Elsewhere they use a reachable URL with the per-run token.PROPR_FLY_PREWARM=1pulls the image in the region once at startup and logs how long it took.Things to know before using it:
I also updated the two architecture pages (
agent-runtime.md,coding-agent-integration.md). No previews were made, since nothing here is visible in the UI.Review digest
Risk-tiered paths
packages/core/src/agents/credentials/hostCredentialStaging.ts(+4/−4): auth-looking pathpackages/core/src/agents/runtime/agentRunFileUpload.ts(added, +214/−0)packages/core/src/agents/runtime/dockerRunArgs.ts(+11/−1)packages/core/src/agents/runtime/dockerRuntime.ts(+2/−2)packages/core/src/agents/runtime/flyMachinesApi.ts(added, +193/−0)packages/core/src/agents/runtime/flyMachinesConfig.ts(added, +164/−0)packages/core/src/agents/runtime/flyMachinesLaunch.ts(added, +189/−0)packages/core/src/agents/runtime/flyMachinesRunHandle.ts(added, +360/−0)packages/core/src/agents/runtime/flyMachinesRuntime.ts(added, +134/−0)packages/core/src/agents/runtime/registry.ts(+27/−7)packages/core/src/agents/runtime/types.ts(+24/−0)packages/core/src/index.ts(+2/−0)docs/docs/architecture/agent-runtime.md(+21/−1)docs/docs/architecture/coding-agent-integration.md(+1/−1)test/flyMachinesRuntime.test.ts(added, +351/−0)Diff size: 15 files changed, +1,697/−16 lines
View task for the run's logs and conversation.
This PR was created automatically by ProPR after processing issue #3767.
💡 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!