Skip to content

[3807 by Claude Opus 5.5] Remote runtimes: apply instance runtime packages on Sprites and Fly Machines (refuse until supported) - #3816

Merged
integry merged 29 commits into
3758-epic-runtime-abstraction-sc0from
3807/claude-opus-5-5-remote-runtimes-apply-ins-20261126-0040-t2w
Nov 26, 2026
Merged

integry merged 29 commits into
3758-epic-runtime-abstraction-sc0from
3807/claude-opus-5-5-remote-runtimes-apply-ins-20261126-0040-t2w

Conversation

@propr-dev

@propr-dev propr-dev Bot commented Nov 26, 2026 •

Copy link
Copy Markdown
Contributor

Scope (decided 2026-11-26): on Fly Machines, runtime packages are installed at every Machine start. The derived Fly image was split out to #3821 (reference code on 3807-derived-fly-image-reference), and #3807's text was updated to match. Reviews should not require the derived image in this PR. The PROPR_FLY_MACHINES_MAX concurrency cap was also split out, to #3822 (reference code on 3807-fly-machines-cap-reference).

AI Implementation Summary

Closes #3807

Branch: 3807/claude-opus-5-5-remote-runtimes-apply-ins-20261126-0040-t2w
Commits: ✅ Changes committed (cf0e9d3)


AI Processing Completed

Execution Details:

Summary:
I implemented three of the issue's four items. Sprites now install the configured runtime packages, runtimes that can't apply packages are refused before launch, and the docs cover each runtime. Item 2, building a derived image for Fly Machines, is not done, so Fly runs are refused whenever packages are configured. Type-check, lint, the new tests and the affected runtime/registry suites pass. Nothing was run live: the psql --version checks on a real Sprite and a real Fly Machine still need doing.

The refusal (item 3)

  • I added a supportsRuntimePackages capability next to supportsExtensions. Docker and Sprites declare true and Fly Machines false. A custom runtime that doesn't declare it is treated as unsupported, as with extensions.
  • runAgent checks it before launch. If packages are configured and the runtime can't apply them, the run fails with AgentRuntimeCapabilityError (capability runtime_packages). The message lists the packages and points to a supporting runtime, removing the packages in Settings, or .propr/setup.sh.
  • The package list is only read for runtimes that lack the capability, so Docker runs pay nothing extra. If the list can't be read or is invalid, the run is refused rather than started without packages.
  • I didn't block the setting in the Settings UI; the refusal happens at launch only.
  • The package list and validation now live in a new file, agentRuntimePackageProfile.ts, which doesn't depend on Docker. agentRuntimePackages.ts re-exports what it used before.

Sprites (item 1)

  • Provisioning installs the configured packages with apt-get after sprites-agent-setup.sh and before the clean checkpoint. It uses the same flags as the Docker build, and package names are passed as arguments, never pasted into the shell script.
  • An apt failure fails provisioning with apt's error text and deletes the Sprite.
  • Sprites use the package list as saved in Settings, not the last list that built successfully in Docker. So a misspelled package that fails the Docker build will also fail Sprite provisioning.
  • Each pooled Sprite records a digest of its package list. When a run asks for a Sprite, the worker re-reads the list; it deletes warm Sprites built with an old list and provisions a fresh one.
  • This differs from the issue, which suggested putting the digest in the pool key or deployment marker. I did it per Sprite instead, because warm Sprites are held in each worker's memory, and that avoids changing the shared Redis marker. Each worker retires its own stale Sprites the next time it hands one out.
  • The provisioning deadline went from 21 to 36 minutes to make room for up to 15 minutes of package installs.

Docs (item 4): agent-runtime.md has a new "Runtime Packages" section with a per-runtime table and .propr/setup.sh as the per-repository alternative. The Fly tutorial has a matching note.

Tests: the new file test/agentRuntimePackagesRemote.test.ts (7 tests) covers:

  • the refusal message and error.
  • the install command.
  • installing before the checkpoint.
  • reusing a warm Sprite when nothing changed and replacing it when the list changes.
  • an apt failure.

Two existing suites, agentRuntimeRegistry and agentRunComputeUsage, hung after the change: their fake runtimes now trigger the package read, which opens the test database. I added after(closeConnection) to both, as spritesRuntime.test.ts already does.

Still open:

  • The Fly Machines image build (item 2). Once it lands, Fly's capability flag can be switched to true.
  • On a worker that runs only Sprites, the Settings package build job still runs the Docker image build, so it will probably show failed even though Sprites install the packages. This predates the change, and I haven't run it.

There are no visual previews because nothing in the UI changed.

Review digest

Risk-tiered paths

  • High risk: none
  • Normal risk (9 files)
    • packages/core/src/agents/runtime/agentRuntimePackageProfile.ts (added, +79/−0)
    • packages/core/src/agents/runtime/agentRuntimePackages.ts (+9/−30)
    • packages/core/src/agents/runtime/dockerRuntime.ts (+1/−0)
    • packages/core/src/agents/runtime/flyMachinesRuntime.ts (+1/−1)
    • packages/core/src/agents/runtime/registry.ts (+31/−2)
    • packages/core/src/agents/runtime/sprites/spritesProvisioning.ts (+53/−10)
    • packages/core/src/agents/runtime/spritesRuntime.ts (+7/−4)
    • packages/core/src/agents/runtime/types.ts (+6/−0)
    • packages/core/src/index.ts (+1/−1)
  • Low risk (5 files)
    • docs/docs/architecture/agent-runtime.md (+14/−2)
    • docs/docs/tutorials/setup-fly.md (+2/−0)
    • test/agentRunComputeUsage.test.ts (+4/−1)
    • test/agentRuntimePackagesRemote.test.ts (added, +134/−0)
    • test/agentRuntimeRegistry.test.ts (+4/−1)

Diff size: 14 files changed, +346/−52 lines

View task for the run's logs and conversation.


This PR was created automatically by ProPR after processing issue #3807.


💡 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!

Live verification on Fly

Both runs: propr deploy fly, idle stop, then wake via the labeled issue (webhookRecovery.redelivered=1). figlet is absent from Dockerfile.agent; the agent's file line 2 was FIGlet Copyright (C) 1991-2012 Glenn Chappell, Ian Chai, John Cowan,. Clean teardown each time: no apps, branches, PRs or issues left.

Runtime Run Install log Compute
Sprites https://github.com/integry/propr/actions/runs/45736960862 (a537da7) Installed agent runtime packages on Sprite: packagesDigest=eaeead723146fff2 packageCount=1 installMs=7443 compute_runtime: sprites
Fly Machines https://github.com/integry/propr/actions/runs/45768556650 (a1b7ea6) Installed agent runtime packages at Fly Machine start: packagesDigest=eaeead723146fff2 packageCount=1 installMs=3990 compute_runtime: fly-machines (separate agent app, attenuated 2 h token)

An earlier Fly Machines run failed with HTTP 422: Your organization has reached its machine limit. The F1 error message surfaced it: the org was at the Free Plan's 3 Machines, and stopped Machines count.

Derived-image path (Fly Machines), after R0: https://github.com/integry/propr/actions/runs/45830138638 on 56d79e2 ✅

After the split (derived Fly image moved to #3821), ec956c8

Runtime Run Install log
Sprites https://github.com/integry/propr/actions/runs/45858711967 ✅ Installed agent runtime packages on Sprite: … packageCount=1 installMs=5191
Fly Machines https://github.com/integry/propr/actions/runs/45860780777 ✅ Installed agent runtime packages at Fly Machine start: … packageCount=1 installMs=4074

On both, the agent's file line 2 was the figlet banner, webhookRecovery.redelivered=1, and teardown was clean. The earlier Sprites Sprite lease expired (actually a swallowed provisioning error, fixed in 25b5fdf) didn't recur. The derived-image results above are kept for #3821.

After my review fixes (R1–R7), e6741f9

Final head 419a420 (after F19–F22): Sprites https://github.com/integry/propr/actions/runs/45892690062 ✅ and Fly Machines https://github.com/integry/propr/actions/runs/45894502589 ✅. Review 8/10 with no blockers, CI clean.

I implemented three of the issue's four items. Sprites now install the configured runtime packages, runtimes that can't apply packages are refused before launch, and the docs cover each runtime. Item 2, building a derived image for Fly Machines, is not done, so Fly runs are refused whenever packages are configured. Type-check, lint, the new tests and the affected runtime/registry suites pass. Nothing was run live: the `psql --version` checks on a real Sprite and a real Fly Machine still need doing.

The refusal (item 3)
- I added a `supportsRuntimePackages` capability next to `supportsExtensions`. Docker and Sprites declare `true` and Fly Machines `false`. A custom runtime that doesn't declare it is treated as unsupported, as with extensions.
- `runAgent` checks it before launch. If packages are configured and the runtime can't apply them, the run fails with `AgentRuntimeCapabilityError` (capability `runtime_packages`). The message lists the packages and points to a supporting runtime, removing the packages in Settings, or `.propr/setup.sh`.
- The package list is only read for runtimes that lack the capability, so Docker runs pay nothing extra. If the list can't be read or is invalid, the run is refused rather than started without packages.
- I didn't block the setting in the Settings UI; the refusal happens at launch only.
- The package list and validation now live in a new file, `agentRuntimePackageProfile.ts`, which doesn't depend on Docker. `agentRuntimePackages.ts` re-exports what it used before.

Sprites (item 1)
- Provisioning installs the configured packages with `apt-get` after `sprites-agent-setup.sh` and before the clean checkpoint. It uses the same flags as the Docker build, and package names are passed as arguments, never pasted into the shell script.
- An apt failure fails provisioning with apt's error text and deletes the Sprite.
- Sprites use the package list as saved in Settings, not the last list that built successfully in Docker. So a misspelled package that fails the Docker build will also fail Sprite provisioning.
- Each pooled Sprite records a digest of its package list. When a run asks for a Sprite, the worker re-reads the list; it deletes warm Sprites built with an old list and provisions a fresh one.
- This differs from the issue, which suggested putting the digest in the pool key or deployment marker. I did it per Sprite instead, because warm Sprites are held in each worker's memory, and that avoids changing the shared Redis marker. Each worker retires its own stale Sprites the next time it hands one out.
- The provisioning deadline went from 21 to 36 minutes to make room for up to 15 minutes of package installs.

Docs (item 4): `agent-runtime.md` has a new "Runtime Packages" section with a per-runtime table and `.propr/setup.sh` as the per-repository alternative. The Fly tutorial has a matching note.

Tests: the new file `test/agentRuntimePackagesRemote.test.ts` (7 tests) covers:
- the refusal message and error.
- the install command.
- installing before the checkpoint.
- reusing a warm Sprite when nothing changed and replacing it when the list changes.
- an apt failure.

Two existing suites, `agentRuntimeRegistry` and `agentRunComputeUsage`, hung after the change: their fake runtimes now trigger the package read, which opens the test database. I added `after(closeConnection)` to both, as `spritesRuntime.test.ts` already does.

Still open:
- The Fly Machines image build (item 2). Once it lands, Fly's capability flag can be switched to `true`.
- On a worker that runs only Sprites, the Settings package build job still runs the Docker image build, so it will probably show `failed` even though Sprites install the packages. This predates the change, and I haven't run it.

There are no visual previews because nothing in the UI changed.

ProPR-Agent: claude/claude-opus-5-5
@integry

integry commented Nov 26, 2026

Copy link
Copy Markdown
Owner

Close the two open items in this PR

The issue asks for runtime packages on both remote runtimes, so please finish these here rather than leaving them open:

1. Fly Machines: install at Machine start (instead of a derived image for now). A derived image needs a builder the worker doesn't have: there's no Docker daemon on Fly, and adding a remote builder is a bigger change. Fly Machines runs are ephemeral, so the simplest correct approach is the same install Sprites now do, run in the Machine before the agent starts:

  • same apt-get flags and argument passing as the Sprites path (no shell interpolation), as root, before dropping to the agent user;
  • a bounded time limit with a clear failure that includes the end of apt's output; fail the run, don't start it without packages;
  • skip it entirely when no packages are configured (no apt overhead for the default case);
  • record the install time in the run's compute or timing data, so the per-run cost is visible;
  • then set supportsRuntimePackages: true for Fly Machines and update the docs table, noting that it installs on every run and suggesting Sprites (warm pool) when installs are slow.

A cached derived image can come later as an optimization; note it in the docs as a known cost, not as missing support.

2. Settings package status on non-Docker workers. When the worker runs only remote runtimes (no Docker daemon), the Settings package build must not run the Docker build and report failed. Validate the list (same validator), then report it as applied when the runtime installs it (e.g. "installed when Sprites are provisioned / at Fly Machine start") instead of a build result. Add a test.

Live verification (required before merge): I'll run it on Fly with a package configured. Please make it easy to check: log one line per run or provisioning with the package digest and install duration, without the package names when the list is long.

@propr-dev

propr-dev Bot commented Nov 26, 2026 •

Copy link
Copy Markdown
Contributor Author

✅ Applied the requested follow-up changes in commit f13cec0

Summary of Changes

Both open items are done: Fly Machines now install the configured runtime packages at every Machine start, and on a worker with only remote runtimes Settings reports the list as applied instead of running the Docker build. The affected suites pass (core, Fly, Sprites, registry, compute usage, the API route test and the Settings UI test), and typecheck and zero-warning lint are clean. Nothing ran on a real Fly Machine or Sprite, so your live check is still the real test.

1. Fly Machines install at Machine start

  • Install step: the launcher installs the packages as root before it reports ready and before dropping to node. It uses the same command as Sprites: same apt-get flags, package names passed as arguments, nothing pasted into the shell. Apt runs with a fixed, trusted environment.
  • Time limit: 15 minutes, with apt's process group killed at the limit. The worker keeps polling while the Machine reports installing, so PROPR_FLY_BOOT_TIMEOUT doesn't include the install.
  • Failure: a failed or timed-out install fails the run and never starts the agent. The error looks like Fly Machine could not install the agent runtime packages (digest …): apt exited with code 100 after 3s …, followed by the last 4 KB of apt's output. The Machine is then destroyed.
  • No packages configured: no install file is sent and there is no apt step.
  • Package list: it is re-read for every run, so a Settings change applies to the next Machine. A list that can't be read or is invalid fails the run before any Machine is created.
  • Install time: recorded in the run's compute usage as a new packageInstallMs field and also as provisioningMs, which already has a database column. The run summary shows it as "… installing packages". Sprites now record packageInstallMs too when a Sprite was provisioned for that run.
  • Capability: supportsRuntimePackages is now true for Fly Machines. The launch-time refusal only applies to custom runtimes that don't declare it.
  • Docs: the runtime table in agent-runtime.md and the Fly tutorial now say Fly installs on every run and suggest Sprites (warm pool) when installs are slow. A cached derived image is listed as a known cost, not missing support.

2. Settings on a worker with no Docker runtime

  • Detection: this applies when no enabled agent runs on Docker.
  • Build job: it runs the same validator, then saves the list as ready with a new appliedBy note, e.g. "Installed at every Fly Machine start; no Docker image is built", or "when Sprites are provisioned", or both. It doesn't run the Docker build or remove old images. Mixed workers that also use Docker build the image as before.
  • API: the Settings checks also used Docker, so on such a worker validation and Apply now use only the name validator. A misspelled package is then reported by the runtime's apt install when a run starts. Package search returns no suggestions there, and the catalog warm-up is skipped.
  • UI: Settings shows "2 active · Installed at every Fly Machine start; no Docker image is built" instead of "N active across 0 agent images". I captured a preview of this.
  • Not changed: propr runtime packages verify still uses Docker, so it won't work on a worker without Docker.

What to look for in your live check: one log line per run.

  • On success: Installed agent runtime packages at Fly Machine start, with run, machine, packagesDigest, packageCount and installMs.
  • On failure: Agent runtime package install failed at Fly Machine start, which adds exitCode.
  • Package names appear only when there are five or fewer.
  • Sprites log Installed agent runtime packages on Sprite with the same fields at provisioning.

Tests:

  • test/flyRuntimePackages.test.ts covers:
    • no install step without packages
    • install before start, with the recorded time
    • a failed install that never starts the agent
    • an unreadable list
    • the log fields
    • the real Python launcher's success, failure and timeout paths
  • test/agentRuntimePackagesRemoteSettings.test.ts covers the remote-only build being ready rather than failed. It fails against the previous code.
  • I also added one API route test and one UI test, and updated agentRuntimePackagesRemote.test.ts for the new Fly capability.

Review digest

Risk-tiered paths

  • High risk: none
  • Normal risk (13 files)
    • packages/api/routes/agentRuntimeRoutes.ts (+26/−12)
    • packages/core/src/agents/runtime/agentRuntimePackageProfile.ts (+39/−0)
    • packages/core/src/agents/runtime/agentRuntimePackages.ts (+31/−2)
    • packages/core/src/agents/runtime/computeUsage.ts (+4/−0)
    • packages/core/src/agents/runtime/fly/launch.ts (+7/−0)
    • packages/core/src/agents/runtime/fly/packages.ts (added, +40/−0)
    • packages/core/src/agents/runtime/fly/wrapper.ts (+34/−0)
    • packages/core/src/agents/runtime/flyMachinesRuntime.ts (+48/−6)
    • packages/core/src/agents/runtime/sprites/spritesProvisioning.ts (+13/−5)
    • packages/core/src/agents/runtime/spritesRuntime.ts (+4/−3)
    • packages/core/src/index.ts (+1/−0)
    • propr-ui/src/api/agentRuntimeApi.ts (+2/−0)
    • propr-ui/src/pages/SettingsPage/AgentRuntimePackagesSection.tsx (+8/−1)
  • Low risk (7 files)
    • docs/docs/architecture/agent-runtime.md (+6/−2)
    • docs/docs/tutorials/setup-fly.md (+1/−1)
    • packages/api/test/agentRuntimeRoutes.test.ts (+41/−0)
    • propr-ui/src/pages/SettingsPage/AgentRuntimePackagesSection.test.tsx (+17/−0)
    • test/agentRuntimePackagesRemote.test.ts (+15/−17)
    • test/agentRuntimePackagesRemoteSettings.test.ts (added, +71/−0)
    • test/flyRuntimePackages.test.ts (added, +168/−0)

Diff size: 20 files changed, +576/−49 lines

Visual preview

Runtime packages on a remote-only worker

Runtime packages on a remote-only worker

Settings → Agent extensions & packages with only Fly Machines configured: the list is reported ready and applied at every Fly Machine start, instead of an image build result or a failed status.

Full-size original


🤖 Implementation Details

  • Model: Claude Opus 5.5 (medium)
  • Requested By: @integry
  • Time: 23m 34s
  • Tokens: 14,276,751 (14,221,132 in / 55,619 out)
  • Cost: $4.92
  • Subscription usage: Weekly +1%

Undo Changes • View Task Execution


💡 ProPR Slash Commands
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
Processing comment ID: 7179341931✓

Both open items are done: Fly Machines now install the configured runtime packages at every Machine start, and on a worker with only remote runtimes Settings reports the list as applied instead of running the Docker build. The affected suites pass (core, Fly, Sprites, registry, compute usage, the API route test and the Settings UI test), and typecheck and zero-warning lint are clean. Nothing ran on a real Fly Machine or Sprite, so your live check is still the real test.

**1. Fly Machines install at Machine start**
- **Install step:** the launcher installs the packages as root before it reports ready and before dropping to `node`. It uses the same command as Sprites: same `apt-get` flags, package names passed as arguments, nothing pasted into the shell. Apt runs with a fixed, trusted environment.
- **Time limit:** 15 minutes, with apt's process group killed at the limit. The worker keeps polling while the Machine reports `installing`, so `PROPR_FLY_BOOT_TIMEOUT` doesn't include the install.
- **Failure:** a failed or timed-out install fails the run and never starts the agent. The error looks like `Fly Machine could not install the agent runtime packages (digest …): apt exited with code 100 after 3s …`, followed by the last 4 KB of apt's output. The Machine is then destroyed.
- **No packages configured:** no install file is sent and there is no apt step.
- **Package list:** it is re-read for every run, so a Settings change applies to the next Machine. A list that can't be read or is invalid fails the run before any Machine is created.
- **Install time:** recorded in the run's compute usage as a new `packageInstallMs` field and also as `provisioningMs`, which already has a database column. The run summary shows it as "… installing packages". Sprites now record `packageInstallMs` too when a Sprite was provisioned for that run.
- **Capability:** `supportsRuntimePackages` is now `true` for Fly Machines. The launch-time refusal only applies to custom runtimes that don't declare it.
- **Docs:** the runtime table in `agent-runtime.md` and the Fly tutorial now say Fly installs on every run and suggest Sprites (warm pool) when installs are slow. A cached derived image is listed as a known cost, not missing support.

**2. Settings on a worker with no Docker runtime**
- **Detection:** this applies when no enabled agent runs on Docker.
- **Build job:** it runs the same validator, then saves the list as `ready` with a new `appliedBy` note, e.g. "Installed at every Fly Machine start; no Docker image is built", or "when Sprites are provisioned", or both. It doesn't run the Docker build or remove old images. Mixed workers that also use Docker build the image as before.
- **API:** the Settings checks also used Docker, so on such a worker validation and Apply now use only the name validator. A misspelled package is then reported by the runtime's apt install when a run starts. Package search returns no suggestions there, and the catalog warm-up is skipped.
- **UI:** Settings shows "2 active · Installed at every Fly Machine start; no Docker image is built" instead of "N active across 0 agent images". I captured a preview of this.
- **Not changed:** `propr runtime packages verify` still uses Docker, so it won't work on a worker without Docker.

**What to look for in your live check:** one log line per run.
- On success: `Installed agent runtime packages at Fly Machine start`, with `run`, `machine`, `packagesDigest`, `packageCount` and `installMs`.
- On failure: `Agent runtime package install failed at Fly Machine start`, which adds `exitCode`.
- Package names appear only when there are five or fewer.
- Sprites log `Installed agent runtime packages on Sprite` with the same fields at provisioning.

**Tests:**
- `test/flyRuntimePackages.test.ts` covers:
  - no install step without packages
  - install before start, with the recorded time
  - a failed install that never starts the agent
  - an unreadable list
  - the log fields
  - the real Python launcher's success, failure and timeout paths
- `test/agentRuntimePackagesRemoteSettings.test.ts` covers the remote-only build being `ready` rather than `failed`. It fails against the previous code.
- I also added one API route test and one UI test, and updated `agentRuntimePackagesRemote.test.ts` for the new Fly capability.

PR: #3816
Comment by: @integry (ID: 7179341931)
Model: Claude Opus 5.5

ProPR-Agent: claude/claude-opus-5-5
@integry

integry commented Nov 26, 2026

Copy link
Copy Markdown
Owner

Live verification: have the Fly smoke workflow exercise a runtime package

Thanks, both items look right. To verify this live, and to keep it covered, extend .github/workflows/fly-e2e.yml:

  1. Configure one runtime package that isn't in the agent image, e.g. figlet; check the image first and pick something absent and small. Configure it in "Configure the fixture Claude agent" through the same code path Settings uses (core API or DB helper), and record its digest. It must go in before the idle stop, so the post-wake run picks it up.
  2. The fixture issue asks the agent to write the package's output into the file, for example: "Create $APP.txt whose first line is exactly $APP and whose second line is the output of figlet -v | head -1". In the PR verification, check that line 1 equals $APP and that line 2 matches the installed package's version banner (non-empty and not command not found).
  3. Evidence: in the verify step, grep the app logs for Installed agent runtime packages (Sprites provisioning, or Fly Machine start) and print packagesDigest, packageCount and installMs. Fail if it's missing.
  4. Keep the default runtime sprites. Add a workflow_dispatch input agent_runtime (sprites | fly-machines, default sprites), so I can also run the same smoke on Fly Machines. The nightly cron stays on sprites. For fly-machines, the CLI deploy step must pass --agent-runtime fly-machines, and the verify step must check compute_runtime: fly-machines.

I'll run it on both runtimes and post the results.

@propr-dev

propr-dev Bot commented Nov 26, 2026 •

Copy link
Copy Markdown
Contributor Author

✅ Applied the requested follow-up changes in commit a537da7

Summary of Changes

I've extended .github/workflows/fly-e2e.yml with all four items. Nothing has run live yet. Locally I checked that every step's bash parses, ran the new jq filters and file checks against made-up logs and files, and type-checked core.

1. Runtime package. I picked figlet: it isn't in Dockerfile.agent's apt list or in sprites-agent-setup.sh. The prepare step now fails if either file ever mentions it, since the smoke would then prove nothing.

  • The configure step, still before the idle stop, uses the same two functions as Settings → Apply. requestAgentRuntimePackageBuild is what the API calls, and buildAgentRuntimePackageProfile is what the worker's job calls.
  • It fails unless the package state comes back ready, holding exactly figlet, and marked as installed by the selected runtime.
  • It saves the list's digest as RUNTIME_PACKAGES_DIGEST. To read the digest over SSH I exported agentRuntimePackagesDigest from @propr/core; that one-line change in packages/core/src/index.ts is the only code change outside the workflow and docs.

2. Fixture issue. The issue asks for $APP.txt with exactly two lines: $APP, then the output of figlet -v | head -1, copied as-is. The verify step prints both lines and checks:

  • there are exactly two lines and line 1 equals $APP.
  • line 2 is non-empty and doesn't contain "not found".
  • line 2 matches ^FIGlet Copyright \(C\) [0-9], the first line of Debian figlet 2.2.5's -v output as I recall it, not checked against a real install. If the live run shows a different banner, only the RUNTIME_PACKAGE_BANNER value needs changing.

3. Log evidence. The verify step finds the latest Installed agent runtime packages… record, which covers both the Sprite and the Fly Machine wording. It prints packagesDigest, packageCount and installMs, and fails if the record is missing, the digest differs from the recorded one, the count isn't 1, or installMs isn't a number.

  • It only accepts records logged after the workflow saw the Machine stop. I didn't use the wake record's wokeAt, because a Sprite warmed at boot could log just before it.

4. agent_runtime input. It's a workflow_dispatch choice, sprites (default) or fly-machines. The nightly cron has no inputs, so it stays on sprites. Deploy passes --agent-runtime "$AGENT_RUNTIME", and the database check now matches compute_runtime against the selected runtime.

Extra steps a fly-machines run needs. The Fly Machines runtime won't start without PROPR_FLY_APP, PROPR_FLY_IMAGE and PROPR_FLY_API_TOKEN, so for fly-machines the workflow also:

  • creates a throwaway agent app, propr-e2e-agents-<run>-<attempt>.
  • builds the agent image on the runner with build-images.sh --only agent, pushes it to that app and uses the pushed digest.
  • creates a 2-hour deploy token limited to that app, and adds all three values to the env file.
  • skips the Sprites token and PROPR_SPRITES_MAX, so FLY_E2E_SPRITES_TOKEN is only required for Sprites runs.
  • deletes the agent app during cleanup; the Sprite cleanup step now runs only for Sprites.

The image build and push will make the Fly Machines run noticeably longer, but I haven't timed them. The job's 100-minute limit is unchanged.

I updated the "Nightly smoke fixture" section of docs/docs/tutorials/setup-fly.md to describe the input, the agent app and the package checks.

There are no visual previews, since nothing in the UI changed.

Review digest

Risk-tiered paths

  • High risk (1 file)
    • .github/workflows/fly-e2e.yml (+110/−17): CI or workflow file
  • Normal risk (1 file)
    • packages/core/src/index.ts (+1/−1)
  • Low risk (1 file)
    • docs/docs/tutorials/setup-fly.md (+4/−2)

Diff size: 3 files changed, +115/−20 lines


🤖 Implementation Details

  • Model: Claude Opus 5.5 (medium)
  • Requested By: @integry
  • Time: 8m 32s
  • Tokens: 3,889,170 (3,861,384 in / 27,786 out)
  • Cost: $1.87

Undo Changes • View Task Execution


💡 ProPR Slash Commands
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
Processing comment ID: 7179771861✓

I've extended `.github/workflows/fly-e2e.yml` with all four items. Nothing has run live yet. Locally I checked that every step's bash parses, ran the new jq filters and file checks against made-up logs and files, and type-checked core.

**1. Runtime package.** I picked `figlet`: it isn't in `Dockerfile.agent`'s apt list or in `sprites-agent-setup.sh`. The prepare step now fails if either file ever mentions it, since the smoke would then prove nothing.
- The configure step, still before the idle stop, uses the same two functions as Settings → Apply. `requestAgentRuntimePackageBuild` is what the API calls, and `buildAgentRuntimePackageProfile` is what the worker's job calls.
- It fails unless the package state comes back `ready`, holding exactly `figlet`, and marked as installed by the selected runtime.
- It saves the list's digest as `RUNTIME_PACKAGES_DIGEST`. To read the digest over SSH I exported `agentRuntimePackagesDigest` from `@propr/core`; that one-line change in `packages/core/src/index.ts` is the only code change outside the workflow and docs.

**2. Fixture issue.** The issue asks for `$APP.txt` with exactly two lines: `$APP`, then the output of `figlet -v | head -1`, copied as-is. The verify step prints both lines and checks:
- there are exactly two lines and line 1 equals `$APP`.
- line 2 is non-empty and doesn't contain "not found".
- line 2 matches `^FIGlet Copyright \(C\) [0-9]`, the first line of Debian figlet 2.2.5's `-v` output as I recall it, not checked against a real install. If the live run shows a different banner, only the `RUNTIME_PACKAGE_BANNER` value needs changing.

**3. Log evidence.** The verify step finds the latest `Installed agent runtime packages…` record, which covers both the Sprite and the Fly Machine wording. It prints `packagesDigest`, `packageCount` and `installMs`, and fails if the record is missing, the digest differs from the recorded one, the count isn't 1, or `installMs` isn't a number.
- It only accepts records logged after the workflow saw the Machine stop. I didn't use the wake record's `wokeAt`, because a Sprite warmed at boot could log just before it.

**4. `agent_runtime` input.** It's a `workflow_dispatch` choice, `sprites` (default) or `fly-machines`. The nightly cron has no inputs, so it stays on `sprites`. Deploy passes `--agent-runtime "$AGENT_RUNTIME"`, and the database check now matches `compute_runtime` against the selected runtime.

**Extra steps a `fly-machines` run needs.** The Fly Machines runtime won't start without `PROPR_FLY_APP`, `PROPR_FLY_IMAGE` and `PROPR_FLY_API_TOKEN`, so for `fly-machines` the workflow also:
- creates a throwaway agent app, `propr-e2e-agents-<run>-<attempt>`.
- builds the agent image on the runner with `build-images.sh --only agent`, pushes it to that app and uses the pushed digest.
- creates a 2-hour deploy token limited to that app, and adds all three values to the env file.
- skips the Sprites token and `PROPR_SPRITES_MAX`, so `FLY_E2E_SPRITES_TOKEN` is only required for Sprites runs.
- deletes the agent app during cleanup; the Sprite cleanup step now runs only for Sprites.

The image build and push will make the Fly Machines run noticeably longer, but I haven't timed them. The job's 100-minute limit is unchanged.

I updated the "Nightly smoke fixture" section of `docs/docs/tutorials/setup-fly.md` to describe the input, the agent app and the package checks.

There are no visual previews, since nothing in the UI changed.

PR: #3816
Comment by: @integry (ID: 7179771861)
Model: Claude Opus 5.5

ProPR-Agent: claude/claude-opus-5-5
@integry

integry commented Nov 26, 2026

Copy link
Copy Markdown
Owner

Fly Machines path: the agent token can't be created with tokens create (same failure as F5 in #3804)

flyctl tokens create deploy --app "$AGENT_APP" runs with FLY_E2E_TOKEN, an org token. Org tokens can't create tokens: #3804 run 1 failed exactly there (createLimitedAccessToken … Not authorized). F5 fixed it for the Machine stop token by deriving a token locally with flyctl tokens attenuate (caveats on stdin: the Apps caveat for this app's internal numeric ID with the right access, plus a ValidityWindow). See the stop-token code already in this workflow.

Please derive the agent-app token the same way. Scope it to $AGENT_APP only, with the access the Fly Machines runtime needs (create, start, stop and destroy Machines and read the app's images), and valid for at most 2 h. Also make sure teardown (always()) destroys $AGENT_APP when the destroy-agent-app marker exists. I'm running the Sprites variant meanwhile.

@propr-dev

propr-dev Bot commented Nov 26, 2026 •

Copy link
Copy Markdown
Contributor Author

✅ Applied the requested follow-up changes in commit 06dd148

Summary of Changes

I changed the Fly Machines path in .github/workflows/fly-e2e.yml so it derives the agent token locally instead of calling tokens create. It hasn't run live yet. The YAML parses; I couldn't run the jq caveat expression because jq isn't installed in this container, but it has the same structure as the stop-token one already in the workflow.

Agent token

  • flyctl tokens create deploy is gone. The step now looks up $AGENT_APP's internal numeric ID through the Machines API, the same way the stop token does. It requires the ID to be a positive integer, because an ID of 0 would grant access to every app.
  • It then pipes two caveats into flyctl tokens attenuate, which uses FLY_E2E_TOKEN as the parent token:
    • Apps for that ID only, with access rwcdC: read, write, create, delete and control. Read covers the app's images and logs. Create, delete and control cover creating, destroying, starting and stopping Machines.
    • ValidityWindow with not_after set to now + 7200 s, so the token lasts at most 2 h.
  • I checked the Fly Machines runtime (packages/core/src/agents/runtime/fly/api.ts). It only calls the Machines API and logs endpoints for that one app, so no other access is needed.
  • If the derived token comes back empty, the step fails. The token is masked and written to PROPR_FLY_API_TOKEN as before.

Teardown

  • "Destroy the Fly Machines agent app" now runs on plain always() and destroys $AGENT_APP whenever the destroy-agent-app marker exists.
  • Before, it also required the main app step to have succeeded and the runtime to be fly-machines. Now only the marker decides. It's written right after flyctl apps create "$AGENT_APP" succeeds, so a failure at any later point still gets cleaned up.

Review digest

Risk-tiered paths

  • High risk (1 file)
    • .github/workflows/fly-e2e.yml (+13/−3): CI or workflow file
  • Normal risk: none
  • Low risk: none

Diff size: 1 file changed, +13/−3 lines


🤖 Implementation Details

  • Model: Claude Opus 5.5 (medium)
  • Requested By: @integry
  • Time: 3m 34s
  • Tokens: 369,524 (366,438 in / 3,086 out)
  • Cost: $0.34

Undo Changes • View Task Execution


💡 ProPR Slash Commands
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
Processing comment ID: 7179951337✓

I changed the Fly Machines path in `.github/workflows/fly-e2e.yml` so it derives the agent token locally instead of calling `tokens create`. It hasn't run live yet. The YAML parses; I couldn't run the `jq` caveat expression because `jq` isn't installed in this container, but it has the same structure as the stop-token one already in the workflow.

**Agent token**
- `flyctl tokens create deploy` is gone. The step now looks up `$AGENT_APP`'s internal numeric ID through the Machines API, the same way the stop token does. It requires the ID to be a positive integer, because an ID of 0 would grant access to every app.
- It then pipes two caveats into `flyctl tokens attenuate`, which uses `FLY_E2E_TOKEN` as the parent token:
  - `Apps` for that ID only, with access `rwcdC`: read, write, create, delete and control. Read covers the app's images and logs. Create, delete and control cover creating, destroying, starting and stopping Machines.
  - `ValidityWindow` with `not_after` set to now + 7200 s, so the token lasts at most 2 h.
- I checked the Fly Machines runtime (`packages/core/src/agents/runtime/fly/api.ts`). It only calls the Machines API and logs endpoints for that one app, so no other access is needed.
- If the derived token comes back empty, the step fails. The token is masked and written to `PROPR_FLY_API_TOKEN` as before.

**Teardown**
- "Destroy the Fly Machines agent app" now runs on plain `always()` and destroys `$AGENT_APP` whenever the `destroy-agent-app` marker exists.
- Before, it also required the main app step to have succeeded and the runtime to be `fly-machines`. Now only the marker decides. It's written right after `flyctl apps create "$AGENT_APP"` succeeds, so a failure at any later point still gets cleaned up.

PR: #3816
Comment by: @integry (ID: 7179951337)
Model: Claude Opus 5.5

ProPR-Agent: claude/claude-opus-5-5
@propr-dev propr-dev Bot changed the title 🔨 [3807 by Claude Opus 5.5] Remote runtimes: apply instance runtime packages on Sprites and Fly Machines (refuse until supported) ✅ [3807 by Claude Opus 5.5] Remote runtimes: apply instance runtime packages on Sprites and Fly Machines (refuse until supported) Nov 26, 2026
propr-dev Bot pushed a commit that referenced this pull request Nov 26, 2026
Package (stdio) MCP servers now run on both Sprites and Fly Machines, and `packageMcp` is `true` for both. Nothing was tested live. Locally, the related suites, the core and root typechecks, and lint on the changed source all pass.

**How the install works (both runtimes)**
- The worker first installs and verifies each package server exactly as it does for Docker: same registry, exact version, integrity value, no lifecycle scripts.
- The worker sends its verified `package.json` and `package-lock.json` to the sandbox. The sandbox replays them as root with `npm ci --ignore-scripts` against the same registry, so npm checks every dependency against the integrity value in the lock file.
- The installer refuses a lock that doesn't pin the package at its stored integrity value, or any dependency not from the registry. It then checks the installed package's name and version and makes the result root-owned and read-only at `/opt/propr/packages/<key>`.
- The servers run next to the agent through the same stdio bridge as on Docker. Plain variables are passed the same way, secrets only by environment name, and output redaction is the same.
- A new test does the full replay locally: real `npm ci` against the fixture registry, then a tool call through the bridge. It also checks that a lock with the wrong integrity value is refused before npm runs.
- **Registry reach:** the Sprite or Machine must reach the npm registry. A private mirror set with `PROPR_EXTENSION_NPM_REGISTRY` has to be reachable from there too.

**Sprites**
- The install runs during provisioning, after the setup script and before the clean checkpoint. A failure fails provisioning with the end of npm's output, and the Sprite is deleted.
- Each pool slot carries a digest of its package-server set. An idle Sprite with a different digest is retired, not reused, and so is a background replacement built for another set.
- Matching is exact, so a run with no package servers won't reuse a Sprite built with some. If runs with different sets alternate, Sprites will be reprovisioned more often. Background replacements are built for the set the latest run asked for.
- The stdio bridge wasn't on Sprites before. It's now uploaded with the setup scripts and installed at `/opt/propr/extension-stdio-bridge.mjs`.
- The install time is recorded as `packageServerInstallMs` in compute usage. A warm Sprite reports none.

**Fly Machines**
- At Machine start the wrapper reports `installing` and runs the installer as root, before the agent and before the start gate opens. The time limit is 10 minutes.
- A failed or timed-out install reports `install-failed`. The run fails with an error naming the servers and digest, followed by the end of npm's output. The Machine is destroyed and the agent never starts.
- A run without package servers gets no installer files and no install step.
- The install time is recorded in compute usage (`packageServerInstallMs`, also counted in `provisioningMs`).

**Interim rule**
- The drop/refuse rule no longer applies to package servers on Sprites and Fly. It still applies to custom runtimes that don't declare `packageMcp`.
- **Decision for you:** I split operator catalog stdio servers into their own class (`catalogMcp`, error capability `catalog_mcp`), and Sprites and Fly keep the drop/refuse rule for them. They run an executable that must already be in the run's image, which neither runtime provides, so turning on `packageMcp` would otherwise have launched them broken with no note. For custom runtimes `catalogMcp` defaults to their `packageMcp` value. Say if you'd rather handle those differently.

**Log lines for your live check**
- Every run that applies library items logs `Extension Library items applied to this run`. It carries the runtime, library revision, `extensionDigest` of the applied items, the counts `skills`, `urlServers`, `packageServers` and `catalogStdioServers`, and `packageServersDigest`.
- The installs log `Installed package MCP servers on Sprite` and `Installed package MCP servers at Fly Machine start`, with the same digest and the install time.

**Gateway reachability:** #3817 isn't merged, so it isn't wired. I left a `TODO(#3817)` in `extensionRuntimeSupport.ts` where URL servers are marked unsupported when there's no reachable URL. That's where the reverse forward's `/api/extensions/mcp` should go.

**Docs:** the tables in `agent-runtime.md`, `agent-extensions.md` and the Fly tutorial now show package servers as supported, list catalog stdio separately, and describe the installs, failures and log lines.

**Merging with #3816:** #3816 is also unmerged and edits the same spots: the Fly wrapper and probe states, Sprite provisioning and the compute usage fields. I used my own file names so the two installs can sit side by side, but whichever lands second will need its conflicts resolved.

Updated tests cover:
- the Sprite install happening before the checkpoint
- warm-pool reuse versus retirement by digest
- a Sprite provisioning failure
- a Fly install that succeeds (with compute usage), fails, or isn't needed
- the wrapper's install states
- the remote launch carrying the install
- catalog stdio refusal on both runtimes

PR: #3818
Comment by: @integry (ID: 7180544030)
Model: Claude Opus 5.5

ProPR-Agent: claude/claude-opus-5-5
@integry

integry commented Nov 26, 2026

Copy link
Copy Markdown
Owner

Fly Machines smoke run: Machine create rejected with HTTP 422 (cause hidden)

Live results on this PR:

F1 (blocker): surface Fly's validation message. MachinesClient.request discards the error body, because it can echo the submitted config. Keep that protection, but parse the JSON and include only Fly's error string. Truncate it to ~300 chars and pass it through the same secret redaction as run output, e.g. Fly Machines API POST returned HTTP 422: <error>. Unit-test that a body echoing an env secret is redacted.

F2: find the 422. With F1 the next run will say what Fly rejected. Meanwhile, please check what this PR adds to the create request against the Machines API schema: the package-install files entries (guest_path, raw_value size, mode type), anything under /run or other mounted paths (Fly hides those, see #3804 F7/F9), and any new init/env fields. If you can't tell which one it is, add a unit test that builds the full create body for a run with runtime packages and validates it against the same constraints validateContainerFilePaths enforces for the control plane.

I'll re-run the Fly Machines variant once F1 lands.

@propr-dev propr-dev Bot changed the title ✅ [3807 by Claude Opus 5.5] Remote runtimes: apply instance runtime packages on Sprites and Fly Machines (refuse until supported) 🔨 [3807 by Claude Opus 5.5] Remote runtimes: apply instance runtime packages on Sprites and Fly Machines (refuse until supported) Nov 26, 2026
@propr-dev

propr-dev Bot commented Nov 26, 2026 •

Copy link
Copy Markdown
Contributor Author

✅ Applied the requested follow-up changes in commit a1b7ea6

Summary of Changes

I've done F1: the next Fly Machines run will show Fly's reason for the 422. For F2, the package install is unlikely to be the cause, but I couldn't pin down what is. The new tests, the existing Fly suites (39 pass), the core typecheck and lint all pass. Nothing ran against the real Machines API.

F1: Fly's validation message is now in the error

  • When a request fails, MachinesClient.request reads up to 64 KB of the body. It keeps only Fly's JSON error string and drops the rest, so the echoed config never reaches the error. A body that isn't JSON, or has no string error, gives the same message as before.
  • Before that string is used, three kinds of value are redacted:
    • the run's known secrets (the Fly token, transport token, provider and GitHub credentials), using the same redactor as run output, so their base64, hex and URL-encoded forms are caught too.
    • anything that looks like a known kind of secret (redactSecrets).
    • any unbroken run of 80+ base64-style characters, such as an echoed file raw_value. I added this because the agent's env travels inside base64 file contents, where a plain match on the secret wouldn't find it. Image digests (64 hex characters) still show.
  • It is then truncated to 300 characters, so the error reads Fly Machines API POST returned HTTP 422: <error>.
  • To pass the secret list to the client, flyMachinesRuntime.ts now prepares the launch before creating the client.

F2: what this PR adds to the create request

  • It adds one entry to files: /root/propr-run/packages.json. It sits in the same root-owned directory as the input and stdin files that were already sent. Its mode is the number 0o600, and its raw_value is a few hundred bytes of base64.
  • Nothing is under /run, /proc, /sys, /dev or /data.
  • The PR adds no init, env, mount or service fields.

The only thing that differs from a run without packages is that one small file, so I don't think it causes the 422. The rejection may come from config that was already there before this PR; the error text from your re-run should say which.

New tests (test/flyMachinesCreateRequest.test.ts, 3 tests):

  • the parsing rules: non-JSON or a missing or non-string error gives no detail, secrets are redacted, and long messages are truncated.
  • an end-to-end rejected create where the 422 body echoes an env secret and an agent-file raw_value. The run fails with the redacted message, and the error contains neither the secret nor the Fly token.
  • the full create body for a run with two packages, checked against validateContainerFilePaths (imported from the CLI). It also checks that paths are absolute and normalized, there are no duplicates, modes are integers from 0 to 0o777, raw_values are valid base64, the config has no new keys, and the Fly token is absent.

No previews, since nothing in the UI changed.

Review digest

Risk-tiered paths

  • High risk: none
  • Normal risk (2 files)
    • packages/core/src/agents/runtime/fly/api.ts (+49/−6)
    • packages/core/src/agents/runtime/flyMachinesRuntime.ts (+1/−1)
  • Low risk (1 file)
    • test/flyMachinesCreateRequest.test.ts (added, +94/−0)

Diff size: 3 files changed, +144/−7 lines


🤖 Implementation Details

  • Model: Claude Opus 5.5 (medium)
  • Requested By: @integry
  • Time: 7m 44s
  • Tokens: 1,785,758 (1,772,264 in / 13,494 out)
  • Cost: $1.10

Undo Changes • View Task Execution


💡 ProPR Slash Commands
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
Processing comment ID: 7181040823✓

propr-dev Bot pushed a commit that referenced this pull request Nov 26, 2026
I added the `extensions` mode to `.github/workflows/fly-e2e.yml`. It hasn't run live yet. Locally, the workflow parses as YAML and every step passes `bash -n`. I also ran the new parts against the repo's real validators and sample data: the skill archive, the library save body, the jq filters and the three-line check all pass. **#3816 isn't merged, so the mode is Sprites-only.** A comment at the `EXTENSIONS` env var says to combine it with `agent_runtime` once #3816 lands.

**How it turns on**
- **Manual runs:** a `workflow_dispatch` boolean input `extensions`, default `false`.
- **Nightly runs:** only when the repo variable `FLY_E2E_NIGHTLY_EXTENSIONS` is `true`.

**One fixture change.** The library API only accepts a stored administrator, and nothing signs in on the fixture. So in extensions mode the deploy step adds the `FLY_E2E_GITHUB_TOKEN` user's login to `PROPR_ADMIN_USERS`. The new step then claims the administrator role through `POST /api/admin/members/claim`.

**1. Setup, before the idle stop (new step)**
- It calls the Settings → Extensions API itself (`/api/instance/extensions/v1/…`), using the fixture GitHub token as a bearer token.
- **Skill bundle:** a ustar archive holding one `SKILL.md` named `fixture-token`. When asked for the fixture skill token, it answers `SKILL-OK-<run id>-<attempt>`. It goes through the same archive upload route as Settings.
- **Package MCP server:** `fixture-echo`, running `@modelcontextprotocol/server-everything` 2.3.1 with the `stdio` argument and the `echo` tool.
  - The integrity value is pinned in the workflow. Settings' "Check" lookup has to return that value, and so does the saved library. Otherwise the step fails.
  - I ran this version locally: `echo` with `MCP-OK-1` returns `Echo: MCP-OK-1`.
- Both items are auto-applied and limited to the fixture repo. The step checks the saved revision afterwards.
- **No URL MCP server.** The step summary says why: the fixture has no reachable URL MCP server of its own, and the gateway route from #3817 isn't merged.
- Only the read requests retry. A repeated save would fail on the library revision check.

**2. The issue** asks for `$APP.txt` with three lines: `$APP`, the skill token, and the `echo` output for `MCP-OK-<run id>-<attempt>`. Without the mode, the issue text is unchanged.

**3. The verify step**
- It checks all three lines, expecting line 3 to be `Echo: MCP-OK-…`, and that the file has exactly three lines.
- It requires an `Extension Library items applied to this run` log line with runtime `sprites`, `skills>=1` and `packageServers>=1`.
- It then requires an `Installed package MCP servers on Sprite` (or `… at Fly Machine start`) line with the same `packageServersDigest`.
- It prints `extensionDigest`, `packageServersDigest`, the item counts and `installMs` to the log and the step summary.
- The step streams app logs in the background from its start. `flyctl logs --no-tail` keeps only recent lines, and the install line could be gone by the time the PR exists.

**Docs**
- In `agent-runtime.md`, the operator catalog stdio row is now labelled `catalogMcp`. For Sprites and Fly it says "dropped with a note when auto-applied, run refused when added explicitly".
- `setup-fly.md` has a new "Extension Library check" section covering the input, the nightly variable, the admin change, the pinned package and what gets verified.

One thing to check before you run it: if the fixture's env sets a GitHub user whitelist, the token user has to be on it, or the API calls get a 403.

There's no visible UI change, so I made no previews.

PR: #3818
Comment by: @integry (ID: 7180949991)
Model: Claude Opus 5.5

ProPR-Agent: claude/claude-opus-5-5
I've done F1: the next Fly Machines run will show Fly's reason for the 422. For F2, the package install is unlikely to be the cause, but I couldn't pin down what is. The new tests, the existing Fly suites (39 pass), the core typecheck and lint all pass. Nothing ran against the real Machines API.

**F1: Fly's validation message is now in the error**
- When a request fails, `MachinesClient.request` reads up to 64 KB of the body. It keeps only Fly's JSON `error` string and drops the rest, so the echoed config never reaches the error. A body that isn't JSON, or has no string `error`, gives the same message as before.
- Before that string is used, three kinds of value are redacted:
  - the run's known secrets (the Fly token, transport token, provider and GitHub credentials), using the same redactor as run output, so their base64, hex and URL-encoded forms are caught too.
  - anything that looks like a known kind of secret (`redactSecrets`).
  - any unbroken run of 80+ base64-style characters, such as an echoed file `raw_value`. I added this because the agent's env travels inside base64 file contents, where a plain match on the secret wouldn't find it. Image digests (64 hex characters) still show.
- It is then truncated to 300 characters, so the error reads `Fly Machines API POST returned HTTP 422: <error>`.
- To pass the secret list to the client, `flyMachinesRuntime.ts` now prepares the launch before creating the client.

**F2: what this PR adds to the create request**
- It adds one entry to `files`: `/root/propr-run/packages.json`. It sits in the same root-owned directory as the `input` and `stdin` files that were already sent. Its `mode` is the number `0o600`, and its `raw_value` is a few hundred bytes of base64.
- Nothing is under `/run`, `/proc`, `/sys`, `/dev` or `/data`.
- The PR adds no `init`, `env`, mount or service fields.

The only thing that differs from a run without packages is that one small file, so I don't think it causes the 422. The rejection may come from config that was already there before this PR; the error text from your re-run should say which.

**New tests** (`test/flyMachinesCreateRequest.test.ts`, 3 tests):
- the parsing rules: non-JSON or a missing or non-string `error` gives no detail, secrets are redacted, and long messages are truncated.
- an end-to-end rejected create where the 422 body echoes an env secret and an agent-file `raw_value`. The run fails with the redacted message, and the error contains neither the secret nor the Fly token.
- the full create body for a run with two packages, checked against `validateContainerFilePaths` (imported from the CLI). It also checks that paths are absolute and normalized, there are no duplicates, modes are integers from 0 to 0o777, `raw_value`s are valid base64, the config has no new keys, and the Fly token is absent.

No previews, since nothing in the UI changed.

PR: #3816
Comment by: @integry (ID: 7181040823)
Model: Claude Opus 5.5

ProPR-Agent: claude/claude-opus-5-5
@propr-dev propr-dev Bot changed the title 🔨 [3807 by Claude Opus 5.5] Remote runtimes: apply instance runtime packages on Sprites and Fly Machines (refuse until supported) ✅ [3807 by Claude Opus 5.5] Remote runtimes: apply instance runtime packages on Sprites and Fly Machines (refuse until supported) Nov 26, 2026
@integry

integry commented Nov 26, 2026

Copy link
Copy Markdown
Owner

Both runtimes verified live — one docs addition before ultrafix

Sprites and Fly Machines both pass (evidence in the description). The earlier 422 was Fly's org Machine limit, and your F1 message is what showed it.

Please document that in the Fly tutorial and the Fly Machines runtime docs:

  • On Fly's Free Plan an org can have 3 Machines, stopped ones included. With the Fly Machines runtime, every agent run creates a Machine, so beside the control plane at most 2 agent runs can run at once, fewer if other apps in the org have Machines.
  • When the limit is hit, the run fails with HTTP 422: Your organization has reached its machine limit. Recommend Sprites on the Free Plan, or setting PROPR_FLY_MAX (or whatever the runtime's concurrency setting is) to the free slots.

If the Fly Machines runtime has no concurrency cap today, add one (PROPR_FLY_MACHINES_MAX, default unlimited), and make runs over the cap queue instead of failing.

@propr-dev propr-dev Bot changed the title ✅ [3807 by Claude Opus 5.5] Remote runtimes: apply instance runtime packages on Sprites and Fly Machines (refuse until supported) 🔨 [3807 by Claude Opus 5.5] Remote runtimes: apply instance runtime packages on Sprites and Fly Machines (refuse until supported) Nov 26, 2026
@propr-dev

propr-dev Bot commented Nov 26, 2026 •

Copy link
Copy Markdown
Contributor Author

✅ Applied the requested follow-up changes in commit 144f727

Summary of Changes

I documented the Fly Free Plan Machine limit in both docs. The Fly Machines runtime had no concurrency cap, so I added PROPR_FLY_MACHINES_MAX (default unlimited). Runs over the cap now wait their turn instead of failing. Nothing new was run live on Fly; the cap is covered by local tests only.

How the cap works

  • A run over the cap waits before it creates its Machine. Waiting runs go in arrival order.
  • A slot is freed only after the previous run's Machine is destroyed, because a stopped Machine still counts against the org limit.
  • Cancelling a waiting run takes it out of the queue without creating a Machine.
  • An unset or empty value means no cap. Anything other than a positive integer is rejected with Invalid PROPR_FLY_MACHINES_MAX.
  • The cap counts only one worker process's Machines in PROPR_FLY_APP. It doesn't see other workers or other apps in the org, and the docs say to split the free slots across workers. This differs from PROPR_SPRITES_MAX, which workers share through Redis; the Fly runtime has no Redis access today.
  • There is no wait timeout, unlike Sprites' PROPR_SPRITES_QUEUE_TIMEOUT.
  • The code is in a new file, packages/core/src/agents/runtime/fly/capacity.ts. It is read in fly/config.ts and applied in flyMachinesRuntime.ts.

Docs

  • agent-runtime.md (Fly Machines section): a Free Plan org can have 3 Machines, stopped ones included. The control plane is one, so at most 2 agent runs can run at once, fewer if other apps have Machines. It quotes the exact HTTP 422: Your organization has reached its machine limit error and recommends Sprites or PROPR_FLY_MACHINES_MAX. A new paragraph covers what the cap does, including that it is per worker process.
  • setup-fly.md: a "Fly Machines on the Free Plan" note with the same facts and advice. The Fly Machines setup step now suggests adding PROPR_FLY_MACHINES_MAX=2 to the environment file.
  • .env.example: a commented PROPR_FLY_MACHINES_MAX=2 entry next to the other Fly settings.

Tests: the new test/flyMachinesCapacity.test.ts has 4 tests:

  • the setting's parsing.
  • arrival order, leaving the queue on cancel, and releasing a slot only once.
  • with a cap of 2, a third run creates its Machine only after one is destroyed.
  • a stopped waiting run never creates a Machine.

With the cap turned off, the third test hangs instead of passing, so it does catch a missing cap.

Results:

  • The new tests plus the existing flyMachinesRuntime and flyRuntimePackages suites: 43 of 43 pass. They need PROPR_DEMO_MODE=true; without it, flyMachinesRuntime reports a failure from the GitHub-auth startup check even though all its subtests pass.
  • The suites that read .env.example pass.
  • Core type-check and lint of the changed files are clean.

There are no visual previews because nothing in the UI changed.

Review digest

Risk-tiered paths

  • High risk: none
  • Normal risk (4 files)
    • .env.example (+2/−0)
    • packages/core/src/agents/runtime/fly/capacity.ts (added, +59/−0)
    • packages/core/src/agents/runtime/fly/config.ts (+3/−1)
    • packages/core/src/agents/runtime/flyMachinesRuntime.ts (+6/−1)
  • Low risk (3 files)
    • docs/docs/architecture/agent-runtime.md (+3/−1)
    • docs/docs/tutorials/setup-fly.md (+5/−2)
    • test/flyMachinesCapacity.test.ts (added, +120/−0)

Diff size: 7 files changed, +198/−5 lines


🤖 Implementation Details

  • Model: Claude Opus 5.5 (medium)
  • Requested By: @integry
  • Time: 9m 38s
  • Tokens: 1,993,379 (1,979,458 in / 13,921 out)
  • Cost: $1.06

Undo Changes • View Task Execution


💡 ProPR Slash Commands
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
Processing comment ID: 7184736439✓

I documented the Fly Free Plan Machine limit in both docs. The Fly Machines runtime had no concurrency cap, so I added `PROPR_FLY_MACHINES_MAX` (default unlimited). Runs over the cap now wait their turn instead of failing. Nothing new was run live on Fly; the cap is covered by local tests only.

**How the cap works**
- A run over the cap waits before it creates its Machine. Waiting runs go in arrival order.
- A slot is freed only after the previous run's Machine is destroyed, because a stopped Machine still counts against the org limit.
- Cancelling a waiting run takes it out of the queue without creating a Machine.
- An unset or empty value means no cap. Anything other than a positive integer is rejected with `Invalid PROPR_FLY_MACHINES_MAX`.
- The cap counts only one worker process's Machines in `PROPR_FLY_APP`. It doesn't see other workers or other apps in the org, and the docs say to split the free slots across workers. This differs from `PROPR_SPRITES_MAX`, which workers share through Redis; the Fly runtime has no Redis access today.
- There is no wait timeout, unlike Sprites' `PROPR_SPRITES_QUEUE_TIMEOUT`.
- The code is in a new file, `packages/core/src/agents/runtime/fly/capacity.ts`. It is read in `fly/config.ts` and applied in `flyMachinesRuntime.ts`.

**Docs**
- **`agent-runtime.md` (Fly Machines section):** a Free Plan org can have 3 Machines, stopped ones included. The control plane is one, so at most 2 agent runs can run at once, fewer if other apps have Machines. It quotes the exact `HTTP 422: Your organization has reached its machine limit` error and recommends Sprites or `PROPR_FLY_MACHINES_MAX`. A new paragraph covers what the cap does, including that it is per worker process.
- **`setup-fly.md`:** a "Fly Machines on the Free Plan" note with the same facts and advice. The Fly Machines setup step now suggests adding `PROPR_FLY_MACHINES_MAX=2` to the environment file.
- **`.env.example`:** a commented `PROPR_FLY_MACHINES_MAX=2` entry next to the other Fly settings.

**Tests:** the new `test/flyMachinesCapacity.test.ts` has 4 tests:
- the setting's parsing.
- arrival order, leaving the queue on cancel, and releasing a slot only once.
- with a cap of 2, a third run creates its Machine only after one is destroyed.
- a stopped waiting run never creates a Machine.

With the cap turned off, the third test hangs instead of passing, so it does catch a missing cap.

Results:
- The new tests plus the existing `flyMachinesRuntime` and `flyRuntimePackages` suites: 43 of 43 pass. They need `PROPR_DEMO_MODE=true`; without it, `flyMachinesRuntime` reports a failure from the GitHub-auth startup check even though all its subtests pass.
- The suites that read `.env.example` pass.
- Core type-check and lint of the changed files are clean.

There are no visual previews because nothing in the UI changed.

PR: #3816
Comment by: @integry (ID: 7184736439)
Model: Claude Opus 5.5

ProPR-Agent: claude/claude-opus-5-5

integry commented Nov 26, 2026

Copy link
Copy Markdown
Owner

/ultrafix goal=8 max=3

@propr-dev propr-dev Bot added the ultrafix label Nov 26, 2026
@propr-dev

propr-dev Bot commented Nov 26, 2026

Copy link
Copy Markdown
Contributor Author

🔄 Ultrafix loop started (goal: 8/10, max cycles: 3)

First action: /review

💡 Tip: Remove the ultrafix label from this PR to stop further ultrafix cycles.

@propr-dev

propr-dev Bot commented Nov 26, 2026 •

Copy link
Copy Markdown
Contributor Author

✅ AI Code Review Complete requested by @propr-ultrafix

Posted 1 review:

View Task Details

All seven review items (R1–R7) are fixed. One gap: I couldn't read `/etc/os-release` on a real Sprite, because this container has no Sprites token. Type-check, lint (zero warnings) and the affected suites pass. I haven't triggered the live Sprites and Fly Machines runs or ultrafix.

**R1: index per runtime**
- **Sprite distro:** I recorded **Ubuntu 26.04 LTS (resolute)** in the docs, with Ubuntu's default sources (`resolute`, `-updates`, `-backports`, `-security`; `main restricted universe multiverse`; amd64). That comes from Fly's July 2026 changelog, not from a live Sprite; Fly's own base-images page still names an older Ubuntu.
- **Detection during provisioning:** every new Sprite reports its `/etc/os-release` and apt sources (one-line `.list` and the newer `.sources` format). The worker records them, and later checks use the recorded base. If a new Sprite's base differs from the one the list was checked against, the list is checked again before apt runs.
- **Which index:** Fly Machines, and Docker when no daemon is reachable, use the agent image's index. Sprites use the recorded Sprite base. Each index is cached separately.
- **Settings validation** checks every runtime in use, and errors name it, e.g. `Sprites (Ubuntu 26.04 LTS (resolute)): Unknown package: postfix`. Docker's image check still runs when Docker is reachable; its errors get a `Docker:` prefix.
- **Real archives:** I loaded both actual indexes with the new code. Ubuntu resolute has `libssl3t64` and `python3.14`, and bookworm lacks both.

**R2: `cli.github.com`:** the agent image's sources now include GitHub's repo, and `gh=2.106.0` resolves against the real archive. A new test reads `Dockerfile.agent`'s base image and every `deb` line it writes, and fails if the source list drifts from it.

**R3: each remote runtime has its own accepted list**
- The worker's build job checks the list per remote runtime against that runtime's index.
- If the check passes, that runtime accepts the list. If it fails, the runtime keeps its previous list and the record shows the refusal.
- Sprites and Fly Machines install only their accepted list, so a change still `pending` changes nothing on them. Warm Sprites are retired only when the Sprites list actually changes.
- Package states saved before this change have no per-runtime record; they fall back to the last applied list, never the desired one.
- Settings now shows a row per runtime: status, active list, the distro it installs from, and any refusal.

**R4:** Sprite installs no longer delete the apt lists, so they stay in the checkpoint. Fly start-time installs still clean them.

**R5:** when `ready` follows `installing`, the Fly start gate gets a fresh `bootTimeout`. The new test fails without the fix.

**R6:** `appliedBy` is recomputed from the runtimes in use whenever Settings loads or the state changes.

**R7:**
- Stale warm Sprites are deleted in the background, and shutdown still waits for those deletes.
- The worker starts loading the indexes at startup, but only when remote runtimes are in use and packages are configured.
- The index now keeps only package names and `name=version` pins.
- `getAgentImagePackageIndex` uses `startupStep`.
- `setup-fly.md` has the blank line after the Free Plan blockquote.

**Live-run prep:** the Sprites variant of `fly-e2e.yml` now configures `figlet` and `libssl3t64`, an Ubuntu-only name that the old Debian check would have refused. It also checks the list the runtime accepted and the package count in the install log. actionlint passes, and I simulated the edited shell steps locally.

**Tests:**
- New: a suite covering Sprite base detection, the re-check before apt, kept apt lists and background deletes. Added tests for Fly's fresh boot window, per-runtime build outcomes (pending, refused, mixed Docker failure, old saved state), the API's per-runtime errors and state, and the UI rows.
- Updated for the new index format: the existing index, remote-settings and API suites.
- Re-run and passing: the Sprites pool and runtime, Fly Machines, registry, compute-usage and worker-preparation suites.

**For your next steps:** watch for `Detected the Sprite base image package sources` in the worker logs. It is logged only when a new Sprite's sources differ from the recorded ones. The first live Sprite logs it only if its base isn't the documented Ubuntu 26.04 default, so a silent first run means the documented base was right.

The preview shows Settings with Sprites accepting `libssl3t64` and Fly Machines refusing it and keeping `figlet`. Its data is mocked.

Sources:
- [Sprites now run Ubuntu 26.04 LTS (Fly community)](https://community.fly.io/t/sprites-now-run-ubuntu-26-04-lts/28250)
- [Fly changelog: Sprites Ubuntu 26.04](https://fly.io/changelog/sprites-ubuntu-26-04.md)
- [Sprites base images docs](https://docs.sprites.dev/reference/base-images)

PR: #3816
Comment by: @integry (ID: 7200489050)
Model: Claude Opus 5.5

ProPR-Agent: claude/claude-opus-5-5
@propr-dev propr-dev Bot changed the title 🔨 [3807 by Claude Opus 5.5] Remote runtimes: apply instance runtime packages on Sprites and Fly Machines (refuse until supported) ⚠️❻ [3807 by Claude Opus 5.5] Remote runtimes: apply instance runtime packages on Sprites and Fly Machines (refuse until supported) Nov 26, 2026

integry commented Nov 26, 2026

Copy link
Copy Markdown
Owner

/ultrafix goal=8 max=3

@propr-dev propr-dev Bot added the ultrafix label Nov 26, 2026
@propr-dev

propr-dev Bot commented Nov 26, 2026

Copy link
Copy Markdown
Contributor Author

🔄 Ultrafix loop started (goal: 8/10, max cycles: 3)

First action: /review

💡 Tip: Remove the ultrafix label from this PR to stop further ultrafix cycles.

@propr-dev propr-dev Bot changed the title ⚠️❻ [3807 by Claude Opus 5.5] Remote runtimes: apply instance runtime packages on Sprites and Fly Machines (refuse until supported) 🔨 [3807 by Claude Opus 5.5] Remote runtimes: apply instance runtime packages on Sprites and Fly Machines (refuse until supported) Nov 26, 2026
@propr-dev

propr-dev Bot commented Nov 26, 2026 •

Copy link
Copy Markdown
Contributor Author

✅ AI Code Review Complete requested by @integry

Posted 1 review:

View Task Details

@propr-dev

propr-dev Bot commented Nov 26, 2026

Copy link
Copy Markdown
Contributor Author

🔍 AI Code Review — codex:gpt-6-astra

Overall Evaluation

The PR implements start-time package installation on Fly Machines and checkpoint-based installation on Sprites, with capability checks and runtime-specific Settings feedback. It needs changes before merge because inactive runtimes can retain cleared packages, and slow index downloads defeat the documented save-with-warning behavior.

✅ Installation precedes execution — Fly’s wrapper installs before reporting readiness; Sprites install before creating the clean checkpoint.

✅ Safe package arguments — Package specifications pass as positional arguments after validation, rather than being interpolated into shell scripts.

✅ Substantial validation — Tests cover installation failures, stale Sprite replacement, lease renewal, and runtime-specific indexes. The authoritative current-head status reports 35 passed checks and no failures.

This review uses static tracing of the supplied code; no commands or tests were run. Neither the derived Fly image nor the concurrency cap is required here.

Merge blockers

Every finding below was introduced by this PR and must be resolved before merging.

F19: 🔴 Clearing packages preserves inactive runtime records

  • Category: correctness

  • Required behavior: Clearing the instance package profile must stop subsequent runs from installing the cleared packages, including when an existing runtime is enabled again.

  • Evidence: packages/core/src/agents/runtime/agentRuntimePackages.ts, buildAgentRuntimePackageProfile; packages/core/src/agents/runtime/agentRuntimeRemotePackages.ts, acceptRemoteAgentRuntimePackages and loadAcceptedRemoteAgentRuntimePackages.

    static trace:

    1. Apply jq while Sprites is enabled. The build persists remote.sprites.packages = ['jq'].
    2. Switch the enabled agents to Fly Machines, then clear the instance package list.
    3. The build accepts the empty list only for runtimes currently in use. acceptRemoteAgentRuntimePackages copies the previous records, leaving the inactive Sprites record unchanged.
    4. The disabling branch clears activePackages and sets the global status to disabled, but preserves that Sprites record through ...current.
    5. Enable Sprites again. Its loader prefers remote.sprites.packages over activePackages, so subsequent Sprites install jq despite the cleared profile.

    The persistent per-runtime record defeats the empty global list. Syntax validation and Sprite digest replacement do not help: the loader supplies the obsolete list as authoritative. Existing clearing coverage checks only the runtime participating in the clearing build.

    proposed regression: apply packages on Sprites, switch to Fly Machines, clear packages, then assert that both remote loaders return empty lists.

  • Minimum fix: When disabling the global profile, clear all remote runtime package records as well as activePackages, including records for runtimes currently inactive.

F20: 🔴 Index timeout prevents unverified saves

  • Category: correctness

  • Required behavior: When a remote package index cannot be fetched, Settings must allow the syntactically valid list to be saved with an availability warning.

  • Evidence: packages/api/routes/agentRuntimeRoutes.ts, checkWithIndex and queueBuild; packages/core/src/agents/runtime/agentRuntimePackageIndex.ts, FETCH_TIMEOUT_MS, getAgentImagePackageIndex, and validateAgentRuntimePackagesWithIndex.

    static trace:

    1. On a remote-only instance with a cold index cache, submit a valid package list while an archive request stalls without responding.
    2. The index loader permits the fetch to wait for three minutes.
    3. checkWithIndex wraps that validation in the API’s default two-minute request timeout.
    4. The API timeout rejects first. queueBuild exits through its error handler before calling requestBuild, so the list is neither saved nor queued.
    5. The index loader’s eventual failure can produce an availability warning only after the request has already failed.

    This is specifically the slow/unresponsive-network case; the existing tests throw immediate fetch errors and therefore reach the warning path before the outer timeout. Sharing the download does not reconcile the mismatched deadlines.

    proposed regression: hold a cold index download beyond the request deadline and assert that saving returns an accepted response with an availability warning.

  • Minimum fix: Give index validation a bounded caller deadline shorter than the API request deadline and convert that availability timeout into the existing warning result, preserving syntax rejection and explicit cancellation behavior.

Suggestions

These are optional follow-ups and are not sent to /fix.

S16: 🟢 Correct the tutorial’s distribution description

docs/docs/tutorials/setup-fly.md still says package names are checked against the agent image’s Debian index before Sprite provisioning. The implementation and architecture reference correctly use the Sprite’s Ubuntu or detected base. Aligning the tutorial would prevent confusion about Ubuntu-only packages; this documentation correction does not affect runtime execution.

Score

The implementation has strong coverage and passing current-head checks, but two localized correctness fixes remain necessary before merge.

Score: 6/10


🤖 Review Details

  • Model: GPT-6 Astra
  • Time: 1m 5s
  • Tokens: 160,118 (158,528 in / 1,590 out)
  • Cost: $1.55

View Task


💡 Next step: Comment /fix to address every F# merge blocker, /fix all for every pending blocker and suggestion, or name records explicitly, as in /fix F3 S5.
F# and S# IDs increment across review comments and remain permanent, so selectors such as /fix F3 F5 stay unambiguous across cycles. S# suggestions stay optional: they are implemented only when you name them or request /fix all, and they never relax a merge blocker.

Copy and edit to choose records from this review:

/fix F19 F20 S16

🤖 Review by ProPR

@propr-dev

propr-dev Bot commented Nov 26, 2026 •

Copy link
Copy Markdown
Contributor Author

✅ Applied the requested follow-up changes in commit edcbc6f

Addressed 1 AI review comment (IDs: 7201776536)

Addressed findings F19, F20

Summary of Changes

I fixed both findings. The regression tests and the existing runtime-package suites pass (142/142), and core and API typecheck and lint cleanly. Without the fixes, both new tests fail.

F19: clearing packages left records for runtimes not in use

  • When a build clears the list, it now also deletes the stored package list of every remote runtime, including ones no agent uses at the moment (packages/core/src/agents/runtime/agentRuntimePackages.ts). A Sprites or Fly Machines run then reads the empty applied list, so re-enabling Sprites installs nothing.
  • The fix is in the shared clearing step, so it also covers a clear run on a Docker-only worker. That path had the same problem, because it kept the old records untouched.
  • Regression in test/agentRuntimePackagesRemoteSettings.test.ts: apply jq on Sprites, switch to Fly Machines and clear. Both runtimes now return an empty list, and Settings shows Sprites as disabled.

F20: a slow index download blocked saving

  • The index check now takes an optional deadline for the whole call (packages/core/src/agents/runtime/agentRuntimePackageIndex.ts). If the index isn't loaded in time, you get the usual "could not verify availability … not loaded within Nms" warning and the list stays valid. The download keeps running in the background, so later checks use it.
  • Invalid syntax is still refused, and cancelling through the caller's own signal still fails the check.
  • The Settings routes pass a deadline 15 seconds short of the request timeout (105 s of the default 2 minutes; a quarter less for short timeouts) (packages/api/routes/agentRuntimeRoutes.ts). The 2-minute request timeout stays as a backstop.
  • One related change: hitting a deadline would have skipped the existing fallback to the last good index while a refresh is running. A deadline now still falls back to that index; an explicit cancel doesn't.
  • Regressions:
    • In packages/api/test/agentRuntimeIndexRoutes.test.ts: an index download that never answers, with a 400 ms request timeout. Save returns 202, the build is queued and the warning is shown; validate returns 200; bad syntax still returns 400.
    • In test/agentRuntimePackageIndex.test.ts: the warning on a stalled download, cancellation, later checks using the finished download, and the fallback to the last good index.

Separate issue, not fixed (outside F19/F20): the same stale record affects non-empty lists. Apply jq on Sprites, switch to Fly Machines, apply figlet, then re-enable Sprites: Sprites still install jq. A build only checks and updates the runtimes it is using, so it can't validate a new list for the others. Fixing it means deciding whether to drop those records, which changes behaviour on instances where each worker runs a different remote runtime.

No previews: nothing visible changed.

Review digest

Risk-tiered paths

  • High risk: none
  • Normal risk (3 files)
    • packages/api/routes/agentRuntimeRoutes.ts (+11/−1)
    • packages/core/src/agents/runtime/agentRuntimePackageIndex.ts (+18/−5)
    • packages/core/src/agents/runtime/agentRuntimePackages.ts (+4/−0)
  • Low risk (3 files)
    • packages/api/test/agentRuntimeIndexRoutes.test.ts (+28/−0)
    • test/agentRuntimePackageIndex.test.ts (+35/−0)
    • test/agentRuntimePackagesRemoteSettings.test.ts (+16/−0)

Diff size: 6 files changed, +112/−6 lines


🤖 Implementation Details

  • Model: Claude Opus 5.5 (medium)
  • Requested By: @propr-ultrafix
  • Time: 7m 14s
  • Tokens: 1,877,394 (1,861,898 in / 15,496 out)
  • Cost: $1.16

View Task Execution


💡 ProPR Slash Commands
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. The regression tests and the existing runtime-package suites pass (142/142), and core and API typecheck and lint cleanly. Without the fixes, both new tests fail.

**F19: clearing packages left records for runtimes not in use**
- When a build clears the list, it now also deletes the stored package list of every remote runtime, including ones no agent uses at the moment (`packages/core/src/agents/runtime/agentRuntimePackages.ts`). A Sprites or Fly Machines run then reads the empty applied list, so re-enabling Sprites installs nothing.
- The fix is in the shared clearing step, so it also covers a clear run on a Docker-only worker. That path had the same problem, because it kept the old records untouched.
- Regression in `test/agentRuntimePackagesRemoteSettings.test.ts`: apply `jq` on Sprites, switch to Fly Machines and clear. Both runtimes now return an empty list, and Settings shows Sprites as `disabled`.

**F20: a slow index download blocked saving**
- The index check now takes an optional deadline for the whole call (`packages/core/src/agents/runtime/agentRuntimePackageIndex.ts`). If the index isn't loaded in time, you get the usual "could not verify availability … not loaded within Nms" warning and the list stays valid. The download keeps running in the background, so later checks use it.
- Invalid syntax is still refused, and cancelling through the caller's own signal still fails the check.
- The Settings routes pass a deadline 15 seconds short of the request timeout (105 s of the default 2 minutes; a quarter less for short timeouts) (`packages/api/routes/agentRuntimeRoutes.ts`). The 2-minute request timeout stays as a backstop.
- One related change: hitting a deadline would have skipped the existing fallback to the last good index while a refresh is running. A deadline now still falls back to that index; an explicit cancel doesn't.
- Regressions:
  - In `packages/api/test/agentRuntimeIndexRoutes.test.ts`: an index download that never answers, with a 400 ms request timeout. Save returns 202, the build is queued and the warning is shown; validate returns 200; bad syntax still returns 400.
  - In `test/agentRuntimePackageIndex.test.ts`: the warning on a stalled download, cancellation, later checks using the finished download, and the fallback to the last good index.

**Separate issue, not fixed (outside F19/F20):** the same stale record affects non-empty lists. Apply `jq` on Sprites, switch to Fly Machines, apply `figlet`, then re-enable Sprites: Sprites still install `jq`. A build only checks and updates the runtimes it is using, so it can't validate a new list for the others. Fixing it means deciding whether to drop those records, which changes behaviour on instances where each worker runs a different remote runtime.

No previews: nothing visible changed.

PR: #3816
Comment by: @propr-ultrafix (ID: 0)
Model: Claude Opus 5.5

ProPR-Agent: claude/claude-opus-5-5
@propr-dev

propr-dev Bot commented Nov 26, 2026 •

Copy link
Copy Markdown
Contributor Author

✅ AI Code Review Complete requested by @propr-ultrafix

Posted 1 review:

View Task Details

@propr-dev

propr-dev Bot commented Nov 26, 2026

Copy link
Copy Markdown
Contributor Author

🔍 AI Code Review — codex:gpt-6-astra

Overall Evaluation

The PR implements package installation during Sprite provisioning and every Fly Machine start, consistent with the revised scope. It needs a localized correctness fix before merge.

✅ Installation precedes execution — Sprite installs occur before checkpoint creation; Fly’s launcher installs before reporting readiness and surfaces installation failures.

✅ Focused regression coverage — Added tests cover installation errors, stale Sprite replacement, runtime-specific package indexes, and lease renewal during long provisioning.

This review is based on static inspection of the supplied code; no commands were run. Current checks report 30 passed, four pending, and no failures.

Merge blockers

Every finding below was introduced by this PR and must be resolved before merging.

F21: 🔴 Reactivated runtimes retain obsolete packages

  • Category: correctness

  • Required behavior: Applying an instance package profile must not leave a subsequently reactivated runtime indefinitely installing an obsolete profile without checking the latest applied selection.

  • Evidence: packages/core/src/agents/runtime/agentRuntimeRemotePackages.ts, loadAcceptedRemoteAgentRuntimePackages and acceptRemoteAgentRuntimePackages; packages/core/src/agents/runtime/agentRuntimePackages.ts, buildAgentRuntimePackageProfile.

    static trace:

    1. Apply ['jq'] while Sprites is enabled. The build stores remote.sprites.packages = ['jq'].
    2. Switch the enabled agents to Fly Machines only, then successfully apply ['figlet']. The builder checks only usage.runtimes.filter(isRemoteAgentRuntime). Acceptance copies the previous records, preserving the inactive Sprites record, while the successful outcome sets activePackages to ['figlet'].
    3. Enable a Sprites agent again. Its loader preferentially returns remote.sprites.packages, without comparing that record’s build ID with the current profile.
    4. Sprites installs jq, or reuses a warm checkpoint containing it, indefinitely. Runs requiring the applied figlet package therefore start without it.

    The availability check only validates the obsolete list it receives. The checkpoint digest likewise matches that obsolete list. Neither protection reconciles the runtime with the newer applied profile. The explicit empty-list cleanup fixes the clearing case, but nonempty replacements still preserve stale inactive records. No runtime-reactivation reconciliation appears in the supplied changed paths.

  • Minimum fix: On runtime reactivation or package loading, detect a record superseded by a later applied profile and check that profile for the runtime before accepting it. Preserve the previous list only for a pending or explicitly refused change. Add a regression covering Sprites → Fly-only profile replacement → Sprites reactivation.

Suggestions

These are optional follow-ups and are not sent to /fix.

S17: 🟢 Correct the tutorial’s distribution description

docs/docs/tutorials/setup-fly.md says package names are checked against the agent image’s Debian index, including before Sprite provisioning. The implementation and architecture reference correctly use the Sprite’s Ubuntu or detected base. Aligning this sentence would prevent confusion about Ubuntu-only package names. This documentation inconsistency does not block the installation paths.

Score

The installation paths and targeted tests are substantial, but the persistent stale-profile behavior needs correction. Pending checks alone do not reduce the score.

Score: 6/10


🤖 Review Details

  • Model: GPT-6 Astra
  • Time: 1m 30s
  • Tokens: 162,854 (161,205 in / 1,649 out)
  • Cost: $1.56

View Task


💡 Next step: Comment /fix to address every F# merge blocker, /fix all for every pending blocker and suggestion, or name records explicitly, as in /fix F3 S5.
F# and S# IDs increment across review comments and remain permanent, so selectors such as /fix F3 F5 stay unambiguous across cycles. S# suggestions stay optional: they are implemented only when you name them or request /fix all, and they never relax a merge blocker.

Copy and edit to choose records from this review:

/fix F21 S17

🤖 Review by ProPR

@propr-dev

propr-dev Bot commented Nov 26, 2026 •

Copy link
Copy Markdown
Contributor Author

✅ Applied the requested follow-up changes in commit d28b5a2

Addressed 1 AI review comment (IDs: 7202206386)

Addressed finding F21

Summary of Changes

F21 is fixed. When a package list is applied, a remote runtime that isn't in use no longer keeps its old record. If you switch to Fly-only, apply ['figlet'], then turn Sprites back on, Sprites now install figlet instead of the old jq.

What changed

  • New helper: remoteRecordsForAppliedProfile in agentRuntimeRemotePackages.ts keeps only the records of remote runtimes that took part in the build.
  • Where it runs: buildAgentRuntimePackageProfile uses it at both points where a list counts as applied:
    • a remote-only build whose outcome is ready.
    • a successful Docker build, which on a mixed instance also covers remote runtimes not in use.
  • Reactivated runtime: with no record, its loader falls back to the applied list (activePackages). Before the next install, that list is checked against the runtime's own index (checkAgentRuntimePackagesBeforeInstall), so a name the Sprite base lacks fails the run rather than bringing back the old list.
  • Pending and refused changes are unchanged: a build that's still pending, refused or failed keeps every record. So a Fly-only list that Fly refuses leaves the Sprites list as it was.
  • Docs: the per-runtime paragraph in docs/docs/architecture/agent-runtime.md and the module comment now describe this.

Same defect elsewhere: the build job is the only place these records are written for inactive runtimes. The empty-list path already dropped all records, and the loader and Settings view read the result. I found no other occurrence.

Tests (two new ones in test/agentRuntimePackagesRemoteSettings.test.ts):

  • Reactivation: Sprites ['jq'], then a Fly-only apply of ['postgresql-client'], then Sprites turned back on. Sprites load and show ['postgresql-client'], and it passes their index check. A Fly-only list missing from the Sprite base (postfix) is loaded and then refused by the Sprites install check.
  • Kept records: a refused Fly-only change and a pending change both leave the Sprites list at ['jq'].
  • With the helper turned into a no-op, the reactivation test fails; with the fix in place, it passes.
  • Core typecheck, zero-warning lint on both source files, and the four package suites (32 tests) pass.

Not covered by a test: this container has no Docker, so the successful Docker-build path is changed but not exercised.

There are no previews, since nothing visible changed.

Review digest

Risk-tiered paths

  • High risk: none
  • Normal risk (2 files)
    • packages/core/src/agents/runtime/agentRuntimePackages.ts (+6/−3)
    • packages/core/src/agents/runtime/agentRuntimeRemotePackages.ts (+14/−0)
  • Low risk (2 files)
    • docs/docs/architecture/agent-runtime.md (+1/−1)
    • test/agentRuntimePackagesRemoteSettings.test.ts (+39/−0)

Diff size: 4 files changed, +60/−4 lines


🤖 Implementation Details

  • Model: Claude Opus 5.5 (medium)
  • Requested By: @propr-ultrafix
  • Time: 5m 25s
  • Tokens: 1,008,681 (999,372 in / 9,309 out)
  • Cost: $0.71

View Task Execution


💡 ProPR Slash Commands
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

F21 is fixed. When a package list is applied, a remote runtime that isn't in use no longer keeps its old record. If you switch to Fly-only, apply `['figlet']`, then turn Sprites back on, Sprites now install `figlet` instead of the old `jq`.

**What changed**
- **New helper:** `remoteRecordsForAppliedProfile` in `agentRuntimeRemotePackages.ts` keeps only the records of remote runtimes that took part in the build.
- **Where it runs:** `buildAgentRuntimePackageProfile` uses it at both points where a list counts as applied:
  - a remote-only build whose outcome is `ready`.
  - a successful Docker build, which on a mixed instance also covers remote runtimes not in use.
- **Reactivated runtime:** with no record, its loader falls back to the applied list (`activePackages`). Before the next install, that list is checked against the runtime's own index (`checkAgentRuntimePackagesBeforeInstall`), so a name the Sprite base lacks fails the run rather than bringing back the old list.
- **Pending and refused changes are unchanged:** a build that's still pending, refused or failed keeps every record. So a Fly-only list that Fly refuses leaves the Sprites list as it was.
- **Docs:** the per-runtime paragraph in `docs/docs/architecture/agent-runtime.md` and the module comment now describe this.

**Same defect elsewhere:** the build job is the only place these records are written for inactive runtimes. The empty-list path already dropped all records, and the loader and Settings view read the result. I found no other occurrence.

**Tests** (two new ones in `test/agentRuntimePackagesRemoteSettings.test.ts`):
- **Reactivation:** Sprites `['jq']`, then a Fly-only apply of `['postgresql-client']`, then Sprites turned back on. Sprites load and show `['postgresql-client']`, and it passes their index check. A Fly-only list missing from the Sprite base (`postfix`) is loaded and then refused by the Sprites install check.
- **Kept records:** a refused Fly-only change and a pending change both leave the Sprites list at `['jq']`.
- With the helper turned into a no-op, the reactivation test fails; with the fix in place, it passes.
- Core typecheck, zero-warning lint on both source files, and the four package suites (32 tests) pass.

**Not covered by a test:** this container has no Docker, so the successful Docker-build path is changed but not exercised.

There are no previews, since nothing visible changed.

PR: #3816
Comment by: @propr-ultrafix (ID: 0)
Model: Claude Opus 5.5

ProPR-Agent: claude/claude-opus-5-5
@propr-dev

propr-dev Bot commented Nov 26, 2026 •

Copy link
Copy Markdown
Contributor Author

✅ AI Code Review Complete requested by @propr-ultrafix

Posted 1 review:

View Task Details

@propr-dev

propr-dev Bot commented Nov 26, 2026

Copy link
Copy Markdown
Contributor Author

🔍 AI Code Review — codex:gpt-6-astra

Overall Evaluation

The PR implements runtime packages for Sprites and installation at every Fly Machine start, consistent with the revised scope. It needs a localized state-persistence correction before merge.

✅ Installation ordering — Both remote runtimes install packages before agent execution; Sprites include them in the clean checkpoint.

✅ Useful regression coverage — Added tests exercise install failures, stale Sprite replacement, runtime-specific package validation, and long installation timing.

This review is a static analysis of the supplied code; no commands were run. Current checks show no failures, with four pending.

Merge blockers

Every finding below was introduced by this PR and must be resolved before merging.

F22: 🔴 Superseded builds can overwrite newer settings

  • Category: correctness

  • Required behavior: A superseded package build must not overwrite a newer requested package profile or prevent its queued build from applying.

  • Evidence: packages/core/src/agents/runtime/agentRuntimePackages.ts, buildAgentRuntimePackageProfile — intermediate remote-record save followed by the remote-only outcome save.

    1. Remote-only build A finishes its index checks, loads the latest state, and passes latest.buildId === job.buildId.
    2. A awaits saveAgentRuntimePackageState(current) to persist its remote records. Meanwhile, a Settings request B has read the state and submits its newer pending profile. Its write can be queued behind A’s intermediate write.
    3. A resumes and submits the unconditional saveAgentRuntimePackageState(applied). That write follows B’s pending-state write and replaces it with A’s older buildId, desired packages, and ready outcome.
    4. B’s queued job subsequently encounters A’s build ID and is treated as superseded. The user’s newer package selection is lost.

    The build worker’s concurrency of one serializes build jobs, but does not serialize Settings requests against them. The existing build-ID check precedes the intermediate awaited write; neither new write conditionally checks the persisted build ID. static trace: the new remote branch’s read/check/save/save sequence and the Settings request/build queue path. This interleaving was not executed.

  • Minimum fix: Make the new remote-state writes conditional on the persisted build ID still matching the job, and return the newer state when that condition fails. Remove the redundant intermediate write for remote-only builds. Add a regression covering a Settings save between remote acceptance and final activation.

Suggestions

These are optional follow-ups and are not sent to /fix.

S18: 🟢 Correct the tutorial’s package sources

docs/docs/tutorials/setup-fly.md says package names are checked against the agent image’s Debian index, including before Sprite provisioning. The implementation and architecture reference correctly use the detected Ubuntu Sprite base. Align that tutorial sentence with the runtime-specific behavior; this documentation inconsistency does not block execution.

Score

The implementation has substantial focused coverage and reported live verification, but the new activation path can discard a newer Settings change. Correct that persistence ordering before merge.

Score: 6/10


🤖 Review Details

  • Model: GPT-6 Astra
  • Time: 1m 39s
  • Tokens: 163,820 (161,641 in / 2,179 out)
  • Cost: $1.61

View Task


💡 Next step: Comment /fix to address every F# merge blocker, /fix all for every pending blocker and suggestion, or name records explicitly, as in /fix F3 S5.
F# and S# IDs increment across review comments and remain permanent, so selectors such as /fix F3 F5 stay unambiguous across cycles. S# suggestions stay optional: they are implemented only when you name them or request /fix all, and they never relax a merge blocker.

Copy and edit to choose records from this review:

/fix F22 S18

🤖 Review by ProPR

@propr-dev

propr-dev Bot commented Nov 26, 2026 •

Copy link
Copy Markdown
Contributor Author

✅ Applied the requested follow-up changes in commit 419a420

Addressed 1 AI review comment (IDs: 7202656810)

Addressed finding F22

Summary of Changes

I fixed F22. A remote-only build that a newer Settings request has superseded can no longer overwrite that request, and the newer request's own build then applies. The new regression tests fail on the previous code and pass on the fix.

The fix (agentRuntimePackages.ts, agentRuntimeRemotePackages.ts)

  • Conditional save: a new saveAgentRuntimePackageStateForBuild writes the state in one UPDATE … WHERE json_extract(value,'$.buildId') = ? statement. If a newer request has replaced the build ID, it writes nothing and returns the newer state. The database is SQLite only, so a single statement is atomic.
  • Writes it covers:
    • the remote-only outcome (ready or failed).
    • the cleared-list (disabled) outcome. This path now runs after the awaited usage read and index checks, so it had the same gap.
    • the remote-record save before a Docker build on a mixed instance.
  • Intermediate save removed for remote-only and cleared-list builds, as the finding asked. The records are saved together with the outcome. The one before a Docker build stays, because the later ready step reads the records from storage.
  • Old images are only cleaned up after a successful write. A superseded cleared-list build therefore leaves the newer state's images alone.
  • Refactor for lint: the change pushed the file over the 400-line limit and the function over the complexity limit of 20. I replaced remoteOnlyBuildOutcome with buildOutcomeWithoutDocker, which builds both no-Docker outcomes. The resulting states are the same as before. Nothing else used the old function.
  • One log line changed: "Agent runtime packages applied by remote runtimes" is now "Agent runtime packages applied without a Docker image build", and it is also logged for cleared lists.

Regression tests (test/agentRuntimePackagesRemoteSettings.test.ts, one for an applied list and one for a cleared list)

  • Settings request B is written through a second SQLite connection at the exact moment build A issues its outcome write. This is the latest point B can land.
  • Each test checks that A returns B's state and that B's newer list stays pending. A must activate nothing, and Sprites must keep their previous list. B's build must then apply its list.
  • Against the previous code both tests fail: A's older build ID replaces B's.

Checks

  • tsc --noEmit on core passes.
  • eslint --max-warnings 0 passes on both changed source files.
  • 89 of 89 tests pass across agentRuntimePackagesRemoteSettings, agentRuntimePackages, agentRuntimePackageVerification, agentRuntimePackagesRemote and agentRegistryOpenCode.
  • The existing mixed-instance test covers the record save before a Docker build. I did not add a separate race test for that path.

Found separately, not changed: these saves already existed on main and use the same read, check, then unconditional save pattern. A Settings request landing in between could still be overwritten:

  • the first building save in buildAgentRuntimePackageProfile.
  • the Docker ready and failed saves.
  • the save in resolveAgentRuntimeImage.

The gap is small there because nothing is awaited between the check and the save. The same conditional save would close it if you want that done.

Nothing in the UI changed, so there are no previews.

Review digest

Risk-tiered paths

  • High risk: none
  • Normal risk (2 files)
    • packages/core/src/agents/runtime/agentRuntimePackages.ts (+28/−28)
    • packages/core/src/agents/runtime/agentRuntimeRemotePackages.ts (+21/−6)
  • Low risk (1 file)
    • test/agentRuntimePackagesRemoteSettings.test.ts (+48/−0)

Diff size: 3 files changed, +97/−34 lines


🤖 Implementation Details

  • Model: Claude Opus 5.5 (high)
  • Requested By: @propr-ultrafix
  • Time: 8m 17s
  • Tokens: 2,275,019 (2,250,914 in / 24,105 out)
  • Cost: $1.38
  • Subscription usage: Weekly +1%

View Task Execution


💡 ProPR Slash Commands
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 F22. A remote-only build that a newer Settings request has superseded can no longer overwrite that request, and the newer request's own build then applies. The new regression tests fail on the previous code and pass on the fix.

**The fix** (`agentRuntimePackages.ts`, `agentRuntimeRemotePackages.ts`)
- **Conditional save:** a new `saveAgentRuntimePackageStateForBuild` writes the state in one `UPDATE … WHERE json_extract(value,'$.buildId') = ?` statement. If a newer request has replaced the build ID, it writes nothing and returns the newer state. The database is SQLite only, so a single statement is atomic.
- **Writes it covers:**
  - the remote-only outcome (`ready` or `failed`).
  - the cleared-list (`disabled`) outcome. This path now runs after the awaited usage read and index checks, so it had the same gap.
  - the remote-record save before a Docker build on a mixed instance.
- **Intermediate save removed** for remote-only and cleared-list builds, as the finding asked. The records are saved together with the outcome. The one before a Docker build stays, because the later `ready` step reads the records from storage.
- **Old images are only cleaned up after a successful write.** A superseded cleared-list build therefore leaves the newer state's images alone.
- **Refactor for lint:** the change pushed the file over the 400-line limit and the function over the complexity limit of 20. I replaced `remoteOnlyBuildOutcome` with `buildOutcomeWithoutDocker`, which builds both no-Docker outcomes. The resulting states are the same as before. Nothing else used the old function.
- **One log line changed:** "Agent runtime packages applied by remote runtimes" is now "Agent runtime packages applied without a Docker image build", and it is also logged for cleared lists.

**Regression tests** (`test/agentRuntimePackagesRemoteSettings.test.ts`, one for an applied list and one for a cleared list)
- Settings request B is written through a second SQLite connection at the exact moment build A issues its outcome write. This is the latest point B can land.
- Each test checks that A returns B's state and that B's newer list stays pending. A must activate nothing, and Sprites must keep their previous list. B's build must then apply its list.
- Against the previous code both tests fail: A's older build ID replaces B's.

**Checks**
- `tsc --noEmit` on core passes.
- `eslint --max-warnings 0` passes on both changed source files.
- 89 of 89 tests pass across `agentRuntimePackagesRemoteSettings`, `agentRuntimePackages`, `agentRuntimePackageVerification`, `agentRuntimePackagesRemote` and `agentRegistryOpenCode`.
- The existing mixed-instance test covers the record save before a Docker build. I did not add a separate race test for that path.

**Found separately, not changed:** these saves already existed on `main` and use the same read, check, then unconditional save pattern. A Settings request landing in between could still be overwritten:
- the first `building` save in `buildAgentRuntimePackageProfile`.
- the Docker `ready` and `failed` saves.
- the save in `resolveAgentRuntimeImage`.

The gap is small there because nothing is awaited between the check and the save. The same conditional save would close it if you want that done.

Nothing in the UI changed, so there are no previews.

PR: #3816
Comment by: @propr-ultrafix (ID: 0)
Model: Claude Opus 5.5

ProPR-Agent: claude/claude-opus-5-5
@propr-dev

propr-dev Bot commented Nov 26, 2026

Copy link
Copy Markdown
Contributor Author

⚠️ Ultrafix stopped before reaching its goal. Requested goal: 8/10. Last score: 6/10. Stopped in cycle 3 of 3. Max cycles were exhausted, so manual review and merge are now required.

@propr-dev propr-dev Bot removed the ultrafix label Nov 26, 2026

integry commented Nov 26, 2026

Copy link
Copy Markdown
Owner

/review

@propr-dev

propr-dev Bot commented Nov 26, 2026 •

Copy link
Copy Markdown
Contributor Author

✅ AI Code Review Complete requested by @integry

Posted 1 review:

View Task Details

@propr-dev

propr-dev Bot commented Nov 26, 2026

Copy link
Copy Markdown
Contributor Author

🔍 AI Code Review — codex:gpt-6-astra

Overall Evaluation

The PR implements runtime packages on Sprites and at every Fly Machine start, with runtime-specific availability checks and Settings reporting. The derived-image and Fly concurrency-cap work are correctly outside this review’s scope.

The implementation appears merge-ready within scope, conditional on the pending checks completing successfully. This was a static review of the supplied diff and surrounding context; no commands or tests were run.

✅ Install before execution — Fly’s wrapper installs packages before reporting readiness, bounds the installation, and preserves apt’s output tail on failure. Sprites install before creating the clean checkpoint.

✅ Warm Sprite reuse — Package digests distinguish stale slots from reusable checkpoints. Availability checks apply to new installations, while matching warm Sprites remain usable after an archive removes a package or version.

✅ Targeted regression coverage — Added tests exercise runtime-specific indexes, installation failures, prolonged provisioning with lease renewal, and superseded remote-build outcome writes.

The supplied current-head status reports no failures, with 17 checks still pending. Historical failures are not treated as current failures.

Merge blockers

No merge blockers.

Suggestions

These are optional follow-ups and are not sent to /fix.

S19: 🟢 Align tutorial package-source wording

In docs/docs/tutorials/setup-fly.md, the new runtime-packages paragraph still says package names are checked against the agent image’s Debian index for both runtimes. Update it to distinguish Fly Machines’ Debian sources from Sprites’ detected Ubuntu sources, matching agentRuntimePackageBases.ts and the architecture reference. This is a documentation inconsistency; the implemented runtime-specific validation is present.

S20: 🟢 Isolate unrelated maintenance changes

The changes to packages/core/src/git/hooklessGit.ts and apps/desktop/scripts/packaged-acceptance-csp-reload.test.mjs address Git maintenance and browser-test teardown independently of runtime packages. Consider separating them into focused follow-ups, or recording their specific connection to the requested check repairs. This would make regression attribution easier, but their inclusion alone is not a demonstrated merge blocker.

Score

The changed paths have substantial targeted coverage and no verified blocker in this static review. Final merge confidence remains conditional on the pending current-head checks.

Score: 8/10


🤖 Review Details

  • Model: GPT-6 Astra
  • Time: 1m 27s
  • Tokens: 169,669 (167,997 in / 1,672 out)
  • Cost: $1.65

View Task


💡 Next step: Comment /fix to address every F# merge blocker, /fix all for every pending blocker and suggestion, or name records explicitly, as in /fix F3 S5.
F# and S# IDs increment across review comments and remain permanent, so selectors such as /fix F3 F5 stay unambiguous across cycles. S# suggestions stay optional: they are implemented only when you name them or request /fix all, and they never relax a merge blocker.

Copy and edit to choose records from this review:

/fix S19 S20

🤖 Review by ProPR

@propr-dev propr-dev Bot changed the title 🔨 [3807 by Claude Opus 5.5] Remote runtimes: apply instance runtime packages on Sprites and Fly Machines (refuse until supported) ✅❽ [3807 by Claude Opus 5.5] Remote runtimes: apply instance runtime packages on Sprites and Fly Machines (refuse until supported) Nov 26, 2026
@integry
integry merged commit 937768d into 3758-epic-runtime-abstraction-sc0 Nov 26, 2026
50 checks passed
@propr-dev propr-dev Bot changed the title ✅❽ [3807 by Claude Opus 5.5] Remote runtimes: apply instance runtime packages on Sprites and Fly Machines (refuse until supported) [3807 by Claude Opus 5.5] Remote runtimes: apply instance runtime packages on Sprites and Fly Machines (refuse until supported) Nov 26, 2026
propr-dev Bot pushed a commit that referenced this pull request Nov 26, 2026
The epic (937768d) is merged in, and the Sprite pool now uses one key built from both digests. Nothing has run live; the Sprites and Fly Machines extension runs are still yours to do.

The epic merge was already on the branch as e660300, from ProPR's automatic conflict resolution. I checked every conflicted file against your points, and only the pool needed more work.

**1. Pool (`spritesProvisioning.ts`, `spritesSlot.ts`)**
- Before, the merged code still matched idle Sprites, cap evictions and background replacements on the package-server digest alone. They now all use one key built from the runtime-package digest plus the package-server digest.
- R1's behaviour is kept for that key:
  - the most recently used matching Sprite is reused.
  - Sprites with other package-server sets stay warm.
  - at `PROPR_SPRITES_MAX`, the least recently used Sprite with another key is evicted.
  - a background replacement gets the server set of the Sprite it replaces and the current runtime packages.
- When the instance's runtime-package list changes, idle Sprites built with the old list are still deleted straight away, as #3816 does. That list is instance-wide, so those Sprites can't match again. Under strict per-key LRU they would only go when the cap forced them out. Say if you'd rather have that.
- New test in `test/spritesPool.test.ts`: runs A (servers), B (none), A, B on one runtime-package list reuse their own two Sprites. After the list changes, run A gets a new Sprite and the old two are deleted.

**Fly boot wait (already correct after the merge, unchanged)**
- `fly/wrapper.ts` installs runtime packages, then package servers. Both report `installing`, and the agent's boot window opens only after both finish.
- The worker runs one state machine (`waitForExit`). It allows extra install time only for the installs a run actually has, and starts a fresh boot window when the Machine reports ready after installing.
- Either `install-failed` fails the run with its own error, through `FlyStartInstalls.failure`. Compute usage reports `packageInstallMs` and `packageServerInstallMs` separately.

**2. Smoke workflow (`fly-e2e.yml`, already correct, unchanged)**
- `EXTENSIONS` has no runtime restriction; only `MCP` requires Sprites.
- On Fly Machines the agent app, image and token come from #3816's step.
- The same run checks the runtime package (file line 2 plus the install log for the chosen runtime), then the extension lines 3–4. It accepts the "applied to this run" record for that runtime and either the Sprite or the Fly Machine package-server install record.
- I couldn't parse the YAML here (no `yaml` module), but I didn't edit the file and it passes its own workflow test, `flyE2eMcpAutomation`.

**3.** The URL-server-through-the-forward change (f6085da) is intact.

**Checks:** the Sprites pool, Sprites runtime, runtime packages, Fly Machines, Fly runtime packages, create request, the workflow test, extension notice and MCP forward suites all pass. `spritesRuntime` only passes with `PROPR_DEMO_MODE=1`, as before. The core typecheck and lint on the changed source are clean.

There are no visual changes, so I made no previews.

PR: #3818
Comment by: @integry (ID: 7203509507)
Model: Claude Opus 5.5

ProPR-Agent: claude/claude-opus-5-5
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant