Repository navigation
[3798 by GPT-6.2 Astra] FlyMachinesRuntime (restart, Astra): ephemeral Fly Machine per run, one authoritative output path - #3801
Conversation
Implemented `fly-machines` for Claude Code and Codex. Each run gets an ephemeral Machine. Captured files drive results, cost accounting, and workflow checks. Live logs are display-only. The worker retrieves credentials and any workspace bundle before destroying the Machine. The core build passed. Regression tests finished with 151 passed, 0 failed, and 2 skipped. The skips required Fly credentials and local root privileges, respectively. Pending live verification before merge covers digest-based boot, authenticated provider runs and credential refresh, `.internal` MCP connectivity, and a graceful stop returning exit 143 with a readable bundle and a destroyed Machine. The configuration and live-test command are documented in the [runtime reference](/home/node/workspace/docs/docs/architecture/agent-runtime.md). ProPR-Agent: codex/gpt-6.2-astra
|
/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: |
Checks FailedValidation failed during setup, tests, CLI packaging, linting, or build checks. View Logs |
|
CI failed: Validate Changes Please investigate and fix this CI failure.
Failure evidence
|
|
✅ Applied the requested follow-up changes in commit c4b89b8 Processed 2 comments:
Summary of ChangesFixed all six ESLint warnings that caused Core lint passed locally with zero warnings, and the core build passed. The Fly runtime suite had 15 passing tests and one skip. The live integration test requires a configured Fly app and token. Review digestRisk-tiered paths
Diff size: 4 files changed, +82/−43 lines 🤖 Implementation Details
Undo Changes • View Task Execution 💡 ProPR Slash Commands
🤖 Generated by ProPR |
Fixed all six ESLint warnings that caused `Validate Changes` to fail on PR #3801. The changes are confined to the four flagged Fly runtime files and preserve existing behavior. Core lint passed locally with zero warnings, and the core build passed. The Fly runtime suite had 15 passing tests and one skip. The live integration test requires a configured Fly app and token. PR: #3801 Comment by: @github-actions[bot] (ID: 7155552708) Comment by: @propr-dev[bot] (ID: 7155552803) Model: GPT-6.2 Astra ProPR-Agent: codex/gpt-6.2-astra
🔍 AI Code Review — codex:gpt-6-astraOverall EvaluationThe PR adds an ephemeral Fly Machines runtime with credential staging, captured-output processing, and workspace recovery. It needs changes before merge: failed workspace retrieval can destroy the only result copy, and cost-cap enforcement occurs only after execution finishes. ✅ Authoritative output separation — Only captured files feed the result pipeline; live logs remain display-only. ✅ Credential isolation — Launch preparation removes the worker’s Fly token and exports only declared provider credential files. ✅ Current checks pass — The supplied authoritative status reports 24 passed checks and no failures or pending checks. This assessment is based on static inspection of the supplied code; no commands were run. Merge blockersEvery finding below was introduced by this PR and must be resolved before merging. F1: 🔴 Preserve bundles when retrieval fails
F2: 🔴 Enforce cost caps during execution
SuggestionsThese are optional follow-ups and are not sent to S1: 🟢 Expand live deployment coverageThe live test exercises CLI version commands, task execution, stopping, and bundle return, but does not perform authenticated provider requests, credential refresh, or MCP calls. Extending deployment verification to cover those paths would strengthen confidence in the integration. This is additional verification, not a separately demonstrated code defect. ScoreThe implementation has useful isolation boundaries and passing checks, but workspace data loss and ineffective execution-time cost caps remain merge blockers. 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 2aee0f9
Summary of ChangesAddressed F1 and F2 in PR #3801.
The core build passed. Across five test files, 92 tests passed and 2 skipped. The skipped tests require live Fly credentials and local root privileges, respectively. Review digestRisk-tiered paths
Diff size: 6 files changed, +256/−31 lines 🤖 Implementation Details
💡 ProPR Slash Commands
🤖 Generated by ProPR |
Addressed F1 and F2 in PR #3801. - **F1:** Failed bundle retrieval now preserves the Machine through finalization, `stop()`, and `release()`. The error identifies the Fly app, Machine ID, and recovery directory. A Machine holding a fallback bundle remains available until an operator recovers the bundle and destroys it. - **F2:** Active cost caps now consume authoritative stdout while the agent runs. Reads resume from the last validated byte after an interruption, and final collection accounts for the remaining records exactly once. Display-only logs stay outside cost accounting. The core build passed. Across five test files, **92 tests passed and 2 skipped**. The skipped tests require live Fly credentials and local root privileges, respectively. PR: #3801 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: |
|
CI failed: Validate Changes Please investigate and fix this CI failure.
Failure evidence
|
Checks FailedValidation failed during setup, tests, CLI packaging, linting, or build checks. View Logs |
|
✅ Applied the requested follow-up changes in commit 418810d Processed 2 comments:
Summary of ChangesFixed both ESLint warnings that caused The core package built successfully, lint passed with zero warnings, and all 21 Fly Machines runtime tests passed locally. Review digestRisk-tiered paths
Diff size: 1 file changed, +41/−30 lines 🤖 Implementation Details
Undo Changes • View Task Execution 💡 ProPR Slash Commands
🤖 Generated by ProPR |
Fixed both ESLint warnings that caused `Validate Changes` to fail on PR #3801. In [flyMachinesRuntime.ts](/home/node/workspace/packages/core/src/agents/runtime/flyMachinesRuntime.ts), I grouped the exit-polling callbacks into one parameter and extracted post-exit collection and cleanup into a helper, preserving the order of operations. The core package built successfully, lint passed with zero warnings, and all 21 Fly Machines runtime tests passed locally. PR: #3801 Comment by: @propr-dev[bot] (ID: 7156393828) Comment by: @github-actions[bot] (ID: 7156394440) Model: GPT-6.2 Astra ProPR-Agent: codex/gpt-6.2-astra
🔍 AI Code Review — codex:gpt-6-astraOverall EvaluationThe PR adds a well-separated Fly Machines runtime, but it is not ready to merge: two failure paths can discard the only recoverable copy of run data or refreshed credentials. Both need localized cleanup fixes. ✅ Authoritative capture — Results and cost accounting consume guest capture files independently of best-effort live logs. ✅ Recovery-aware retrieval — Failed bundle retrieval preserves the Machine and reports its recovery location. ✅ Focused regression coverage — Tests cover interrupted reads, graceful stops, cost-cap enforcement, and workflow markers. Current-head checks report 24 passed and no failures. This review used 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. F3: 🔴 Preserve bundles when settlement rejects
F4: 🔴 Retain credentials after write-back failure
SuggestionsThese are optional follow-ups and are not sent to S2: 🟢 Expand live integration coverageThe live test exercises provider ScoreThe implementation has substantial focused coverage and passing current checks, but cleanup can still destroy recoverable workspace changes and refreshed credentials. 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 030ada3
Summary of Changes
The core build passed. Across the Fly runtime, workspace transport, and credential broker suites, 71 tests passed and 2 were skipped. The skipped tests require live Fly credentials and local root privileges, respectively. Review digestRisk-tiered paths
Diff size: 6 files changed, +203/−35 lines 🤖 Implementation Details
💡 ProPR Slash Commands
🤖 Generated by ProPR |
- **F3** — When settlement rejects after workspace collection, the error reports the local bundle directory. The bundle survives destroy retries, `stop()`, and `release()`. Cancellation between `wait()` and workspace retrieval also preserves the bundle. - **F4** — A failed credential export or write-back keeps the Machine recoverable and reports its Fly app, Machine ID, and credential directory. Forced stop, finalization, release, and guest expiry all respect pending write-back. The core build passed. Across the Fly runtime, workspace transport, and credential broker suites, **71 tests passed and 2 were skipped**. The skipped tests require live Fly credentials and local root privileges, respectively. PR: #3801 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: |
Checks FailedValidation failed during setup, tests, CLI packaging, linting, or build checks. View Logs |
|
CI failed: Validate Changes Please investigate and fix this CI failure.
Failure evidence
|
|
✅ Applied the requested follow-up changes in commit dc7f703 Summary of ChangesFixed the two ESLint complexity warnings that caused Locally, core lint passed with zero warnings and the core build passed. All 26 Fly runtime regression tests passed. The live integration test was skipped because Fly credentials and an app were unavailable. Review digestRisk-tiered paths
Diff size: 2 files changed, +17/−10 lines 🤖 Implementation Details
Undo Changes • View Task Execution 💡 ProPR Slash Commands
🤖 Generated by ProPR |
Fixed the two ESLint complexity warnings that caused `Validate Changes` to fail. Extracted provider argument construction and output diagnostics into separate helpers, preserving Fly runtime behavior. Locally, core lint passed with zero warnings and the core build passed. All 26 Fly runtime regression tests passed. The live integration test was skipped because Fly credentials and an app were unavailable. PR: #3801 Comment by: @propr-dev[bot] (ID: 7157454827) Model: GPT-6.2 Astra ProPR-Agent: codex/gpt-6.2-astra
Live Fly verification at head c45ae2a (2026-11-25)Image:
Note for the live test: |
|
/review |
|
/review Re-review with the live Fly evidence in #3801 (comment): the live test, a real-credential task and stop all pass at this head, and no Machines were left. |
|
✅ AI Code Review Complete requested by @integry Posted 1 review: |
|
/ultrafix goal=8 max=5 Independent maintainer review at c45ae2a. Live Fly passes at this head (see #3801 (comment)); keep that behaviour, including the live test. Fix these:
In the live test, |
|
🔄 Ultrafix loop started (goal: 8/10, max cycles: 5) First action:
|
🔍 AI Code Review — codex:gpt-6-astraOverall EvaluationReady to merge within the reviewed scope. The implementation adds ephemeral Fly Machines for Claude Code and Codex, with captured output, credential write-back, and workspace recovery integrated into the runtime contract. ✅ Authoritative output — Results and cost accounting use captured files rather than best-effort Fly logs; missing captures fail explicitly. ✅ Recovery-aware cleanup — Bundle retrieval and credential write-back precede destruction. Failed retrieval preserves the Machine and reports recovery instructions. ✅ Current-head validation — All 24 current checks pass. The supplied live evidence at This was a static review of the supplied code and evidence; no commands were run. Merge blockersNo merge blockers. SuggestionsThese are optional follow-ups and are not sent to S5: 🟢 Extend live integration coverageAdd focused live exercises for authenticated ScoreThe changed behavior has substantial failure-path coverage, passing current-head checks, and supporting live execution evidence. No merge-blocking defect was established in the supplied diff. Score: 8/10 🤖 Review Details
Copy and edit to choose records from this review: 🤖 Review by ProPR |
|
✅ AI Code Review Complete requested by @integry Posted 1 review: |
🔍 AI Code Review — codex:gpt-6-astraOverall EvaluationThe PR adds an ephemeral Fly Machines runtime with captured-file results, credential write-back, and workspace recovery. It needs significant changes before merge: redaction can corrupt results, lifecycle failures can leave unattended Machines, and setup hooks lose required environment values. ✅ Authoritative results — Captured files feed results and cost accounting independently of best-effort live logs. ✅ Recovery protection — Workspace bundles are copied before destruction, and credential export failures preserve the guest with recovery instructions. ✅ Focused coverage — Tests cover interrupted reads, credential failures, cancellation, and cost-cap enforcement. The supplied current-head status reports 24 passed checks and no failures. This review is a static trace of the supplied diff and context; no commands were run. Merge blockersEvery finding below was introduced by this PR and must be resolved before merging. F5: 🔴 Redaction corrupts numeric provider output
F6: 🔴 Credential-bearing orphan never expires
F7: 🔴 Cancellation during creation leaves unattended execution
F8: 🔴 Setup hooks lose agent environment
F9: 🔴 Cleanup failure discards successful execution
SuggestionsThese are optional follow-ups and are not sent to S6: 🟢 Tune startup and polling toleranceThe fixed 120-second boot deadline, unconditional usage scans, and two-failure accounting cutoff deserve configurable deadlines and bounded backoff. These would improve resilience to cold pulls and transient API failures; the supplied code alone does not establish a particular service latency or rate-limit failure. S7: 🟢 Reconnect best-effort live logs
S8: 🟢 Make MCP endpoint selection explicitA Fly-specific endpoint override and API-process targeting would avoid deriving an endpoint from the worker app name. The supplied context does not establish an actual deployment where that hostname reaches the wrong process, so this remains a deployment compatibility follow-up. S9: 🟢 Improve forced-stop credential recoveryThe pending-credential S10: 🟢 Small implementation cleanupsReuse a run-scoped redactor for live logs, with correct stream buffering and finalization, and replace the live test’s ScoreThe implementation has useful recovery mechanisms and passing current-head checks, but verified result corruption, lifecycle leaks, environment loss, and cleanup failure propagation 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 de10cee
Summary of ChangesAddressed F5–F9 on PR #3801. Credential redaction preserves numeric provider usage fields. Fly Machines now wait for worker authorization before starting the workspace, and the worker force-deletes unstarted Machines after cancellation or boot timeout. Credential-only retention defaults to 900 seconds and ends on write-back acknowledgement. Fallback bundles remain recoverable. Setup hooks receive the resolved agent environment after dropping privileges to The core build and lint passed. 115 tests passed, 0 failed, and 2 skipped. The live Fly test required credentials unavailable in this environment. The real-UID transport test required root or passwordless sudo. Review digestRisk-tiered paths
Diff size: 8 files changed, +342/−147 lines 🤖 Implementation Details
💡 ProPR Slash Commands
🤖 Generated by ProPR |
Maintainer review (independent, at c45ae2a)Independent maintainer review at c45ae2a. Live Fly passes at this head (see #3801 (comment)); keep that behaviour, including the live test. Fix these:
In the live test, |
Addressed F5–F9 on PR #3801. Credential redaction preserves numeric provider usage fields. Fly Machines now wait for worker authorization before starting the workspace, and the worker force-deletes unstarted Machines after cancellation or boot timeout. Credential-only retention defaults to 900 seconds and ends on write-back acknowledgement. Fallback bundles remain recoverable. Setup hooks receive the resolved agent environment after dropping privileges to `node`. A failed deletion after successful collection is logged and retried in the background while the caller receives the result. The core build and lint passed. **115 tests passed, 0 failed, and 2 skipped.** The live Fly test required credentials unavailable in this environment. The real-UID transport test required root or passwordless sudo. PR: #3801 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: |
|
✅ Applied the requested follow-up changes in commit dd41fe2 Summary of ChangesAddressed all 11 review findings on PR #3801. Fly’s configurable boot timeout now defaults to 300 seconds and includes creation and image pull. Credential-bearing runs get at least five seconds to exit after Polling skips unchanged output, backs off with jitter, and gives cost accounting 15 seconds to recover from read failures. Live logs resume after errors and continue polling without a cursor. MCP defaults to the API process group and supports Verification: Core build and lint passed. Across the Fly and adjacent runtime suites, 89 tests passed. The live Fly test was skipped because Review digestRisk-tiered paths
Diff size: 10 files changed, +179/−81 lines 🤖 Implementation Details
Undo Changes • View Task Execution 💡 ProPR Slash Commands
🤖 Generated by ProPR |
Addressed all 11 review findings on PR #3801. Fly’s configurable boot timeout now defaults to 300 seconds and includes creation and image pull. Credential-bearing runs get at least five seconds to exit after `SIGKILL`, and failed deletion retries in the background after result collection. Polling skips unchanged output, backs off with jitter, and gives cost accounting 15 seconds to recover from read failures. Live logs resume after errors and continue polling without a cursor. MCP defaults to the API process group and supports `PROPR_FLY_MCP_URL`. The live test now uses portable Git initialization. **Verification:** Core build and lint passed. Across the Fly and adjacent runtime suites, **89 tests passed**. The live Fly test was skipped because `PROPR_FLY_LIVE_TOKEN` and `PROPR_FLY_LIVE_APP` were unavailable, so this revision still needs live verification. The PR adds 1,069 core source lines, within the [size budget](#3798). PR: #3801 Comment by: @integry (ID: 7158798908) Model: GPT-6.2 Astra ProPR-Agent: codex/gpt-6.2-astra
Live Fly re-verification at head dd41fe2 (2026-11-25)
I checked the maintainer findings in code: the redaction is now limited to credential values of at least 12 characters, the start is gated on worker authorization with a boot deadline, and the credential wait has a time limit. 👍 One remaining findingF1: the wrapper still never exits while if (run / 'workspace' / 'result.bundle').exists():
time.sleep(30)
continueEvery run that returns through the bundle fallback (push refused, or no push credentials) leaves this file until the worker collects it. If the worker crashes or is redeployed before collecting it, the Machine sleeps forever, keeps billing and holds one of the 3 Free-plan Machine slots. Bound the bundle wait as well, with the same configurable retention as credentials or the 15-minute window, and document that an uncollected bundle is lost after it. |
|
✅ Applied the requested follow-up changes in commit dc9ddde Summary of ChangesFixed F1. After a task exits, the Fly wrapper waits up to All 33 local Fly runtime tests passed, including the regression test for an abandoned bundle. The live Fly test skipped because its required configuration was unavailable. Review digestRisk-tiered paths
Diff size: 3 files changed, +8/−7 lines 🤖 Implementation Details
Undo Changes • View Task Execution 💡 ProPR Slash Commands
🤖 Generated by ProPR |
Fixed F1. After a task exits, the Fly wrapper waits up to `PROPR_FLY_CREDENTIAL_RETENTION_SECONDS` (15 minutes by default) for bundle retrieval. At the deadline, the wrapper exits even if `result.bundle` is still present. The [runtime reference](/home/node/workspace/docs/docs/architecture/agent-runtime.md:48) documents that Fly then destroys the Machine and any uncollected bundle is lost. All 33 local Fly runtime tests passed, including the regression test for an abandoned bundle. The live Fly test skipped because its required configuration was unavailable. PR: #3801 Comment by: @integry (ID: 7159711563) Model: GPT-6.2 Astra ProPR-Agent: codex/gpt-6.2-astra
🔍 AI Code Review — codex:gpt-6-astraOverall EvaluationThe PR is merge-ready within the supplied scope. It adds an ephemeral Fly Machines runtime with captured output, credential write-back, workspace recovery, and bounded guest retention. Static review found no verified merge blockers. Current-head checks report 24 passed and no failures. ✅ Authoritative output — Results, workflow markers, and cost accounting consume captured files independently of best-effort live logs. ✅ Recovery-aware cleanup — Workspace bundles are collected before destruction; credential export failures preserve the Machine and report recovery instructions. ✅ Targeted regression coverage — Tests cover cancellation during creation, failed retrieval, credential write-back, cost accounting retries, and cleanup failures. This review used the supplied code and context only; no commands or tests were run. Merge blockersNo merge blockers. SuggestionsThese are optional follow-ups and are not sent to S11: 🟢 Extend authenticated live coverageThe live test exercises provider ScoreThe implementation addresses the documented lifecycle and accounting concerns with substantial regression coverage, and all current-head checks pass. External service behavior was not independently exercised during this static review. Score: 8/10 🤖 Review Details
Copy and edit to choose records from this review: 🤖 Review by ProPR |
AI Implementation Summary
Closes #3798
Branch:
3798/gpt-6.2-astra-flymachinesruntime-restar-20261125-0640-gs1Commits: ✅ Changes committed (328db9e)
AI Processing Completed
Execution Details:
Summary:
Implemented
fly-machinesfor Claude Code and Codex. Each run gets an ephemeral Machine. Captured files drive results, cost accounting, and workflow checks. Live logs are display-only. The worker retrieves credentials and any workspace bundle before destroying the Machine.The core build passed. Regression tests finished with 151 passed, 0 failed, and 2 skipped. The skips required Fly credentials and local root privileges, respectively.
Pending live verification before merge covers digest-based boot, authenticated provider runs and credential refresh,
.internalMCP connectivity, and a graceful stop returning exit 143 with a readable bundle and a destroyed Machine. The configuration and live-test command are documented in the runtime reference.Review digest
Risk-tiered paths
.env.example(+9/−0)packages/core/src/agents/runtime/agentRunMcpTransport.ts(+5/−0)packages/core/src/agents/runtime/fly/api.ts(added, +121/−0)packages/core/src/agents/runtime/fly/config.ts(added, +14/−0)packages/core/src/agents/runtime/fly/files.ts(added, +78/−0)packages/core/src/agents/runtime/fly/launch.ts(added, +154/−0)packages/core/src/agents/runtime/fly/wrapper.ts(added, +148/−0)packages/core/src/agents/runtime/flyMachinesRuntime.ts(added, +239/−0)packages/core/src/agents/runtime/registry.ts(+4/−2)packages/core/src/agents/runtime/runPipeline.ts(+3/−1)packages/core/src/agents/runtime/runtimeSelection.ts(+2/−1)packages/core/src/index.ts(+1/−0)docs/docs/architecture/agent-runtime.md(+16/−0)test/flyMachinesRuntime.live.test.ts(added, +92/−0)test/flyMachinesRuntime.test.ts(added, +342/−0)Diff size: 15 files changed, +1,228/−4 lines
View task for the run's logs and conversation.
This PR was created automatically by ProPR after processing issue #3798.
💡 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!