Skip to content

Fly Machines: PROPR_FLY_MACHINES_MAX concurrency cap that queues instead of failing at the org limit #3822

Done

Description

@integry

Split out of #3807 / PR #3816.

Problem

On Fly's Free Plan an org has at most 3 Machines, stopped ones included. With the Fly Machines runtime, every agent run creates a Machine. Runs past the org limit fail with HTTP 422: Your organization has reached its machine limit (since #3816 the message is surfaced) instead of waiting their turn.

Goal

Add PROPR_FLY_MACHINES_MAX (positive integer, default unlimited) to the Fly Machines runtime.

  • Runs over the cap wait before creating their Machine, in arrival order. Cancelling a waiting run removes it without creating a Machine.
  • A slot is freed only after the run's Machine is confirmed destroyed. A stopped or retained Machine (snapshot, kept for debugging) keeps its slot until it's gone.
  • Invalid values are rejected with Invalid PROPR_FLY_MACHINES_MAX.
  • Docs: the Fly tutorial and runtime docs recommend a value for the Free Plan (3 minus the control plane and other apps' Machines).

Starting point

The implementation from PR #3816 is on branch 3807-fly-machines-cap-reference (2bbfd18): packages/core/src/agents/runtime/fly/capacity.ts, test/flyMachinesCapacity.test.ts, and its wiring in flyMachinesRuntime.ts. #3816 removed it in 53a9fb5, so reverting that commit is a starting point. Review findings already addressed there: F2/F3/F15 (slot held until confirmed destruction; retained Machines keep their slot).

Acceptance

  • Unit tests: queueing order, cancellation while waiting, slot release only after a confirmed destroy, retained Machines, invalid values.
  • Live (fly-e2e.yml, agent_runtime=fly-machines): with PROPR_FLY_MACHINES_MAX=1 and two labeled issues, the second run waits, then succeeds after the first Machine is destroyed, with no 422.

Activity

  1. propr-dev commented on Nov 26, 2026

    @propr-dev
    Contributor

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

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

    Processing Details:

    • Agent: claude
    • Model: claude-opus-5-5
    • Branch: 3822/claude-opus-5-5-fly-machines-propr_fly_ma-20261126-2329-gqm
    • Base Branch: 3758-epic-runtime-abstraction-sc0
    • Worktree: issue-3822-20261126-2329-claude-opus-5-5-gqm

    🔍 Track Task Execution

  2. integry commented on Dec 1, 2026

    @integry
    OwnerAuthor

    Done in #3823, which merged into the runtime epic; the epic merged into main with #3774 and ships in 0.9.4.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions