Skip to content

[3758 by Claude Opus 5.5] Introduce AgentRuntime interface with DockerRuntime adapter (no behaviour change) - #3773

Merged
integry merged 8 commits into
3758-epic-runtime-abstraction-sc0from
3758/claude-opus-5-5-introduce-agentruntime-in-20261124-0015-hel
Nov 24, 2026
Merged

integry merged 8 commits into
3758-epic-runtime-abstraction-sc0from
3758/claude-opus-5-5-introduce-agentruntime-in-20261124-0015-hel

Conversation

@propr-dev

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

Copy link
Copy Markdown
Contributor

AI Implementation Summary

Closes #3758

Branch: 3758/claude-opus-5-5-introduce-agentruntime-in-20261124-0015-hel
Commits: ✅ Changes committed (c1c36bb)


AI Processing Completed

Execution Details:

Summary:
Every provider now describes its run as an AgentRunSpec, and a DockerRuntime turns it back into the same docker run arguments as before; golden tests confirm the arguments are identical for every provider. Two parts of the issue are only partly done: native goal sessions still launch Docker directly, and helper containers are still recognised by their docker run arguments (details at the end).

Verification

  • Golden tests (test/agentRunSpecGoldenArgv.test.ts): 26 cases across Claude, Codex (including app-server), OpenCode, Antigravity, Vibe and the legacy Claude service. Each compares the new arguments against a verbatim copy of the old builders, saved in test/fixtures/legacyAgentDockerArgs/. Random container-name suffixes are pinned so the comparison is exact.
  • Runtime test (test/agentRuntimeRegistry.test.ts): covers how the runtime is chosen, the run handle (streams, wait, stop, inspect, isAlive) and the capability checks.
  • Existing tests: I ran the 118 that touch the changed code, plus the two new files. Three of them failed only because /tmp/git-processor is read-only in this container; they pass when pointed at writable directories. agentVersionManagement failed because it greps source for the old argument text, so I updated it (below).
  • Typecheck and zero-warning lint pass for packages/core.

What's new (in packages/core/src/agents/runtime/)

  • types.ts: the AgentRunSpec covers image and agent type, entrypoint and CLI arguments, environment, workspace, git and credential mounts, resources, network, MCP grant, labels and the repo-setup wrapper. It also defines the AgentRuntime interface and its capability flags (supportsBindMounts, supportsRestrictedNetwork, supportsMcpPrivateNetwork, reattach).
  • dockerRunArgs.ts: turns a spec into the old argument list. Each environment variable, mount and env file records the order it was declared in, because the old builders interleaved them differently per provider.
  • dockerRuntime.ts: start(spec) returns a handle with stdout/stderr, wait(), stop(signal, timeout), inspect() and isAlive(). The streams only carry output from the moment they are first read, so unread output isn't held in memory twice.
  • registry.ts: the runtime comes from the agent's new runtime setting, then PROPR_AGENT_RUNTIME, then docker. An unknown name fails loudly instead of falling back to Docker, and a spec needing a capability the runtime lacks is refused.
  • agentRunLaunch.ts: admission, the spend cap, the native-log gate, container detection and extension launches now recognise an agent run by the spec it carries, not by matching docker run arguments.

What changed in existing code

  • Each provider gained a spec builder (e.g. buildClaudeRunSpec, buildCodexRunSpec). The old build*DockerArgs functions still exist and now just render the spec, so existing callers and tests keep working.
  • Provider launches go through runAgent(...) instead of calling executeDockerCommand directly.
  • The memory/CPU/PID resource settings, the setup-hook wrapper and the Claude config-seed mount are now part of the spec; the old argument-based helpers remain as thin wrappers.
  • The new API is exported from @propr/core, and both architecture docs describe the seam.

Not done yet

  • Native goal sessions (Claude, Codex app-server, Antigravity) still launch Docker themselves from the rendered arguments, because they need to keep stdin open for steering. Moving them onto runtime.start() needs an interactive handle.
  • Helper containers (capability probes, package verification) still pass raw docker run arguments. They are still recognised by that shape so they keep going through admission as before. That one fallback check is the only place argument matching remains.
  • Docker-specific additions made at launch time (attempt labels, extension mounts, the egress socket mount and the workflow deadline variable) stay inside the Docker executor.

Test files I edited

  • test/opencodeExecutionLog.test.ts: its mock now provides buildOpenCodeRunSpec.
  • test/agentVersionManagement.test.ts: its source-text checks now look for capAdd: ['CHOWN'] and user: '0:0' instead of the old literal arguments.

There's nothing visual to preview, so I didn't create any.

Review digest

Risk-tiered paths

  • High risk: none
  • Normal risk (30 files)
    • packages/core/src/agents/agentContainerResources.ts (+15/−12)
    • packages/core/src/agents/agentGitAccess.ts (+13/−3)
    • packages/core/src/agents/impl/AntigravityAgent.ts (+23/−16)
    • packages/core/src/agents/impl/ClaudeAgent.ts (+6/−6)
    • packages/core/src/agents/impl/CodexAgent.ts (+15/−8)
    • packages/core/src/agents/impl/OpenCodeAgent.ts (+13/−7)
    • packages/core/src/agents/impl/VibeAgent.ts (+19/−20)
    • packages/core/src/agents/impl/openCodeUtils.ts (+39/−38)
    • packages/core/src/agents/impl/utils/antigravityDockerArgsBuilder.ts (+45/−52)
    • packages/core/src/agents/impl/utils/codexDockerArgsBuilder.ts (+50/−45)
    • packages/core/src/agents/impl/utils/dockerArgsBuilder.ts (+73/−63)
    • packages/core/src/agents/impl/utils/index.ts (+1/−0)
    • packages/core/src/agents/impl/utils/vibeAgentHelpers.ts (+21/−11)
    • packages/core/src/agents/impl/utils/vibeRunSpec.ts (added, +54/−0)
    • packages/core/src/agents/runtime/agentRunLaunch.ts (added, +40/−0)
    • packages/core/src/agents/runtime/agentRunSpec.ts (added, +156/−0)
    • packages/core/src/agents/runtime/dockerRunArgs.ts (added, +80/−0)
    • packages/core/src/agents/runtime/dockerRuntime.ts (added, +115/−0)
    • packages/core/src/agents/runtime/registry.ts (added, +78/−0)
    • packages/core/src/agents/runtime/types.ts (added, +179/−0)
    • packages/core/src/agents/types.ts (+2/−0)
    • packages/core/src/claude/claudeHelpers.ts (+4/−59)
    • packages/core/src/claude/claudeService.ts (+5/−4)
    • packages/core/src/claude/claudeServiceRunSpec.ts (added, +62/−0)
    • packages/core/src/claude/docker/claudeConfigSeed.ts (+15/−11)
    • packages/core/src/claude/docker/dockerCostCap.ts (+5/−4)
    • packages/core/src/claude/docker/dockerExecutor.ts (+14/−5)
    • packages/core/src/claude/docker/repoSetupWrapper.ts (+50/−19)
    • packages/core/src/extensions/extensionLaunch.ts (+4/−2)
    • packages/core/src/index.ts (+8/−0)
  • Low risk (15 files)
    • docs/docs/architecture/agent-runtime.md (+2/−0)
    • docs/docs/architecture/coding-agent-integration.md (+8/−0)
    • test/agentRunSpecGoldenArgv.test.ts (added, +205/−0)
    • test/agentRuntimeRegistry.test.ts (added, +100/−0)
    • test/agentVersionManagement.test.ts (+3/−3)
    • test/fixtures/legacyAgentDockerArgs/agentContainerResources.ts (added, +112/−0)
    • test/fixtures/legacyAgentDockerArgs/agentLaunchArgs.ts (added, +76/−0)
    • test/fixtures/legacyAgentDockerArgs/antigravityDockerArgsBuilder.ts (added, +120/−0)
    • test/fixtures/legacyAgentDockerArgs/claudeConfigSeed.ts (added, +93/−0)
    • test/fixtures/legacyAgentDockerArgs/claudeHelpers.ts (added, +476/−0)
    • test/fixtures/legacyAgentDockerArgs/codexDockerArgsBuilder.ts (added, +255/−0)
    • test/fixtures/legacyAgentDockerArgs/dockerArgsBuilder.ts (added, +316/−0)
    • test/fixtures/legacyAgentDockerArgs/openCodeUtils.ts (added, +230/−0)
    • test/fixtures/legacyAgentDockerArgs/repoSetupWrapper.ts (added, +114/−0)
    • test/opencodeExecutionLog.test.ts (+5/−0)

Diff size: 45 files changed, +3,319/−388 lines

View task for the run's logs and conversation.


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


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

Every provider now describes its run as an `AgentRunSpec`, and a `DockerRuntime` turns it back into the same `docker run` arguments as before; golden tests confirm the arguments are identical for every provider. Two parts of the issue are only partly done: native goal sessions still launch Docker directly, and helper containers are still recognised by their `docker run` arguments (details at the end).

Verification
- Golden tests (`test/agentRunSpecGoldenArgv.test.ts`): 26 cases across Claude, Codex (including app-server), OpenCode, Antigravity, Vibe and the legacy Claude service. Each compares the new arguments against a verbatim copy of the old builders, saved in `test/fixtures/legacyAgentDockerArgs/`. Random container-name suffixes are pinned so the comparison is exact.
- Runtime test (`test/agentRuntimeRegistry.test.ts`): covers how the runtime is chosen, the run handle (streams, `wait`, `stop`, `inspect`, `isAlive`) and the capability checks.
- Existing tests: I ran the 118 that touch the changed code, plus the two new files. Three of them failed only because `/tmp/git-processor` is read-only in this container; they pass when pointed at writable directories. `agentVersionManagement` failed because it greps source for the old argument text, so I updated it (below).
- Typecheck and zero-warning lint pass for `packages/core`.

What's new (in `packages/core/src/agents/runtime/`)
- `types.ts`: the `AgentRunSpec` covers image and agent type, entrypoint and CLI arguments, environment, workspace, git and credential mounts, resources, network, MCP grant, labels and the repo-setup wrapper. It also defines the `AgentRuntime` interface and its capability flags (`supportsBindMounts`, `supportsRestrictedNetwork`, `supportsMcpPrivateNetwork`, `reattach`).
- `dockerRunArgs.ts`: turns a spec into the old argument list. Each environment variable, mount and env file records the order it was declared in, because the old builders interleaved them differently per provider.
- `dockerRuntime.ts`: `start(spec)` returns a handle with `stdout`/`stderr`, `wait()`, `stop(signal, timeout)`, `inspect()` and `isAlive()`. The streams only carry output from the moment they are first read, so unread output isn't held in memory twice.
- `registry.ts`: the runtime comes from the agent's new `runtime` setting, then `PROPR_AGENT_RUNTIME`, then `docker`. An unknown name fails loudly instead of falling back to Docker, and a spec needing a capability the runtime lacks is refused.
- `agentRunLaunch.ts`: admission, the spend cap, the native-log gate, container detection and extension launches now recognise an agent run by the spec it carries, not by matching `docker run` arguments.

What changed in existing code
- Each provider gained a spec builder (e.g. `buildClaudeRunSpec`, `buildCodexRunSpec`). The old `build*DockerArgs` functions still exist and now just render the spec, so existing callers and tests keep working.
- Provider launches go through `runAgent(...)` instead of calling `executeDockerCommand` directly.
- The memory/CPU/PID resource settings, the setup-hook wrapper and the Claude config-seed mount are now part of the spec; the old argument-based helpers remain as thin wrappers.
- The new API is exported from `@propr/core`, and both architecture docs describe the seam.

Not done yet
- Native goal sessions (Claude, Codex app-server, Antigravity) still launch Docker themselves from the rendered arguments, because they need to keep stdin open for steering. Moving them onto `runtime.start()` needs an interactive handle.
- Helper containers (capability probes, package verification) still pass raw `docker run` arguments. They are still recognised by that shape so they keep going through admission as before. That one fallback check is the only place argument matching remains.
- Docker-specific additions made at launch time (attempt labels, extension mounts, the egress socket mount and the workflow deadline variable) stay inside the Docker executor.

Test files I edited
- `test/opencodeExecutionLog.test.ts`: its mock now provides `buildOpenCodeRunSpec`.
- `test/agentVersionManagement.test.ts`: its source-text checks now look for `capAdd: ['CHOWN']` and `user: '0:0'` instead of the old literal arguments.

There's nothing visual to preview, so I didn't create any.

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

integry commented Nov 24, 2026

Copy link
Copy Markdown
Owner

/ultrafix goal=8 max=10

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

propr-dev Bot commented Nov 24, 2026

Copy link
Copy Markdown
Contributor Author

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

First action: /review

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

@propr-dev

propr-dev Bot commented Nov 24, 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 24, 2026

Copy link
Copy Markdown
Contributor Author

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

Overall Evaluation

This PR introduces a structured run specification and runtime registry while preserving the existing Docker execution path. It needs changes before merge: capability enforcement, cancellation during startup, and native-goal runtime selection have gaps.

✅ Compatibility coverage — Golden tests compare rendered arguments against legacy builders across all five providers and the legacy Claude service.

✅ Explicit launch identity — Ordinary provider launches now carry their specification into admission, cost-cap classification, and output forwarding.

This review used static analysis of the supplied code; no commands were run. Current checks report 12 passed, 5 pending, and no failures.

Merge blockers

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

F1: 🔴 Enforce restricted-network capabilities

  • Category: security

  • Required behavior: Selecting a runtime must not silently weaken an enforced restricted-network boundary; unsupported required capabilities must be refused before launch.

  • Evidence: packages/core/src/agents/runtime/registry.ts:assertAgentRuntimeSupports and runAgent

    1. Register and select a runtime with bind-mount support but supportsRestrictedNetwork: false.
    2. Execute an ordinary provider task under an instance-enforced restricted-network policy.
    3. assertAgentRuntimeSupports checks only bind mounts and MCP networking, then runAgent calls the selected runtime’s start.
    4. The run proceeds despite the runtime explicitly declaring that it cannot enforce the required outbound restriction.

    The supplied network-policy implementation enforces restrictions inside the Docker launch path. A selected alternative runtime does not automatically traverse that path, and the new specification does not carry the effective restricted-network requirement. The capability tests also omit this case. static trace: registry dispatch, capability checks, specification fields, and the supplied Docker network-policy context.

  • Minimum fix: Resolve the effective network requirement before runtime dispatch and reject runtimes lacking restricted-network support when restriction applies. Pass the resolved requirement to supported runtimes so they can enforce it.

F2: 🔴 Stop can succeed before launch

  • Category: correctness

  • Required behavior: A run handle’s successful stop() must prevent its pending launch from subsequently starting an agent.

  • Evidence: packages/core/src/agents/runtime/dockerRuntime.ts:DockerRunHandle.constructor and DockerRunHandle.stop

    1. Call DockerRuntime.start(spec) while launch preparation is pending, such as asynchronous network preparation or admission.
    2. Before a container exists, call the returned handle’s stop().
    3. The separate docker stop command returns “No such container”; stop() treats this as success.
    4. Pending preparation completes and the original execution starts the container, which can continue working and spending after the caller’s successful stop.

    The interruption window is the original launch’s awaited preparation. stop() neither cancels that preparation nor records a cancellation state checked before creation/start. Existing ownership cancellation does not help because this method never signals it. The new test explicitly accepts “No such container” but does not exercise pending startup. static trace: handle construction and stop handling, together with the supplied asynchronous admission/network launch paths.

  • Minimum fix: Give each handle cancellation state that reaches launch preparation and is checked before container creation/start; also stop any container already created. Do not interpret absence as completed cancellation while startup remains possible.

F3: 🔴 Native goals ignore runtime selection

  • Category: correctness

  • Required behavior: An explicitly selected runtime must be honored or rejected; a run must not silently use a different execution boundary.

  • Evidence: packages/core/src/agents/types.ts:AgentConfig.runtime, packages/core/src/agents/impl/AntigravityAgent.ts:executeTask, and buildDockerArgs

    1. Configure an Antigravity agent with a registered non-Docker runtime, or set PROPR_AGENT_RUNTIME to an unknown name.
    2. Invoke executeTask with executionMode: 'goal'.
    3. The native-goal branch bypasses runAgent and supplies rendered Docker arguments directly to the native transport.
    4. The goal runs through Docker instead of using the selected runtime or reporting the unknown-runtime error.

    The same bypass exists for the supplied Codex app-server path. Registry validation protects ordinary tasks only; rendering a specification does not perform runtime selection. static trace: the full Antigravity implementation and supplied Codex native-goal caller.

  • Minimum fix: Until interactive runtime support exists, resolve runtime selection before every native-goal launch and explicitly reject non-Docker selections, including unknown names.

Suggestions

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

S1: 🟢 Bound slow-consumer stream buffering

LazyOutputStreams.write() ignores backpressure once a stream has been obtained. A paused or slow consumer can therefore accumulate output without a bound. Consider bounded buffering or an explicit overflow policy. This is optional hardening for the newly exposed stream API; ordinary runAgent() callers never obtain these streams.

Score

The argument-preservation coverage is strong, but the new runtime contract has three actionable lifecycle and isolation gaps. Pending CI is not itself a blocker.

Score: 5/10


🤖 Review Details

  • Model: GPT-6 Astra
  • Time: 55s
  • Tokens: 109,907 (108,391 in / 1,516 out)
  • Cost: $1.05

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 F1 F2 F3 S1

🤖 Review by ProPR

@propr-dev

propr-dev Bot commented Nov 24, 2026 •

Copy link
Copy Markdown
Contributor Author

✅ Applied the requested follow-up changes in commit e47fd40

Addressed 1 AI review comment (IDs: 7118882042)

Addressed findings F1, F2, F3

Summary of Changes

I fixed all three findings, F1, F2 and F3, and added tests for each. The new tests fail on the original code and pass with the fixes. Typecheck and zero-warning lint pass for packages/core. The 22 affected test files pass, apart from one problem in the golden argv test that was already there before this change (below).

F1: restricted network is now enforced whichever runtime is chosen

  • New check before launch: resolveAgentRunNetworkPolicy in network/egressExecution.ts works out which network policy applies before the runtime is chosen:

    • the run's restricted policy if it has one.
    • otherwise the instance's enforced restricted policy, for runs started outside any run policy.
    • nothing, if the caller marked the container as exempt.

    If the instance policy can't be read, the run fails rather than running with open networking.

  • The policy is passed to the runtime: runAgent adds it to the spec as network.restriction, so a runtime that supports restricted networking receives it. The provider's own spec is not changed, and the docker run arguments stay the same.

  • Unsupported runtimes are refused: assertAgentRuntimeSupports now rejects a runtime with supportsRestrictedNetwork: false when a restriction applies, before it is started.

F2: stop() can no longer report success before the agent starts

  • The stop reaches the launch: each Docker run handle now has its own cancellation signal, combined with the caller's signal and passed to the executor. The executor's existing checks during network setup, admission and just before spawning therefore see it.
  • Spawn notification: the executor now calls an onSpawn hook as soon as the docker process is spawned.
  • Before spawn: stop() cancels the launch and waits for it to settle; it doesn't run docker stop at all.
  • After spawn:
    • stop() runs docker stop with the requested signal.
    • If Docker says "No such container", the launch is cancelled, because the container may not have been created yet.
    • If docker stop succeeds but the run hasn't exited within 5 seconds, the launch is also cancelled. This covers a container that admission has created but not yet started, where docker stop does nothing.
  • When it resolves: stop() only returns once the launch has settled. wait() then rejects with the new AgentRunStoppedError.

F3: native goals honour the runtime selection

  • assertNativeGoalRuntime checks which runtime is selected and refuses unknown names and anything other than docker.

  • It runs before every native-goal launch:

    • Claude: at the start of the goal and before building each launch's Docker arguments.
    • Codex: in CodexAgent.executeNativeGoal and executeCodexAppServerGoal.
    • Antigravity: before each segment, via a new runtime field on the launch settings.

    In each case the check comes before git credentials are prepared or anything is spawned.

Tests and docs

  • test/agentRuntimeRegistry.test.ts:
    • Network: a restricted run policy and the enforced instance policy both refuse an unsupported runtime; an unreadable policy fails the run; supporting runtimes receive the restriction; exempt runs get none.
    • Stop: stopping while preparation is pending, and stopping when the container is not found after spawn.
    • Caller signal: a caller's own cancellation still reaches the launch.
    • Native goals: the runtime-selection rules.
  • test/nativeGoalLaunchBoundary.test.ts:
    • The three native-goal paths refuse a non-Docker runtime and an unknown PROPR_AGENT_RUNTIME without preparing git access or spawning anything.
    • An end-to-end test through the real executor: stopping during pending network setup spawns nothing.
  • Existing stop test: it now confirms that stop() waits until the run exits.
  • Docs: coding-agent-integration.md now describes all three behaviours.

Test issues not caused by this change

  • Golden test hang: agentRunSpecGoldenArgv passes both its tests but never exits, so timeout kills it. It does the same on a clean copy of HEAD.
  • Leftover test database: at first goalContinuationPublication failed with "table system_configs already exists". The cause was a half-migrated data/propr.sqlite left by one of my own interrupted runs. With that removed it passes 4/4, and I've deleted the leftover folder.

Review digest

Risk-tiered paths

  • High risk: none
  • Normal risk (12 files)
    • packages/core/src/agents/impl/AntigravityAgent.ts (+1/−1)
    • packages/core/src/agents/impl/ClaudeAgent.ts (+3/−1)
    • packages/core/src/agents/impl/CodexAgent.ts (+2/−1)
    • packages/core/src/agents/impl/antigravityNativeGoal.ts (+4/−0)
    • packages/core/src/agents/impl/codexAppServer.ts (+3/−0)
    • packages/core/src/agents/runtime/agentRunLaunch.ts (+6/−0)
    • packages/core/src/agents/runtime/dockerRuntime.ts (+58/−8)
    • packages/core/src/agents/runtime/registry.ts (+36/−4)
    • packages/core/src/agents/runtime/types.ts (+9/−0)
    • packages/core/src/claude/docker/dockerExecutor.ts (+1/−0)
    • packages/core/src/index.ts (+3/−3)
    • packages/core/src/network/egressExecution.ts (+17/−0)
  • Low risk (3 files)
    • docs/docs/architecture/coding-agent-integration.md (+2/−2)
    • test/agentRuntimeRegistry.test.ts (+153/−3)
    • test/nativeGoalLaunchBoundary.test.ts (+74/−2)

Diff size: 15 files changed, +372/−25 lines


🤖 Implementation Details

  • Model: Claude Opus 5.5 (medium)
  • Requested By: @propr-ultrafix
  • Time: 31m 26s
  • Tokens: 8,449,508 (8,448,019 in / 1,489 out)
  • Cost: $2.47
  • 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 all three findings, F1, F2 and F3, and added tests for each. The new tests fail on the original code and pass with the fixes. Typecheck and zero-warning lint pass for `packages/core`. The 22 affected test files pass, apart from one problem in the golden argv test that was already there before this change (below).

**F1: restricted network is now enforced whichever runtime is chosen**
- **New check before launch:** `resolveAgentRunNetworkPolicy` in `network/egressExecution.ts` works out which network policy applies before the runtime is chosen:
  - the run's restricted policy if it has one.
  - otherwise the instance's enforced restricted policy, for runs started outside any run policy.
  - nothing, if the caller marked the container as exempt.

  If the instance policy can't be read, the run fails rather than running with open networking.
- **The policy is passed to the runtime:** `runAgent` adds it to the spec as `network.restriction`, so a runtime that supports restricted networking receives it. The provider's own spec is not changed, and the `docker run` arguments stay the same.
- **Unsupported runtimes are refused:** `assertAgentRuntimeSupports` now rejects a runtime with `supportsRestrictedNetwork: false` when a restriction applies, before it is started.

**F2: `stop()` can no longer report success before the agent starts**
- **The stop reaches the launch:** each Docker run handle now has its own cancellation signal, combined with the caller's signal and passed to the executor. The executor's existing checks during network setup, admission and just before spawning therefore see it.
- **Spawn notification:** the executor now calls an `onSpawn` hook as soon as the `docker` process is spawned.
- **Before spawn:** `stop()` cancels the launch and waits for it to settle; it doesn't run `docker stop` at all.
- **After spawn:**
  - `stop()` runs `docker stop` with the requested signal.
  - If Docker says "No such container", the launch is cancelled, because the container may not have been created yet.
  - If `docker stop` succeeds but the run hasn't exited within 5 seconds, the launch is also cancelled. This covers a container that admission has created but not yet started, where `docker stop` does nothing.
- **When it resolves:** `stop()` only returns once the launch has settled. `wait()` then rejects with the new `AgentRunStoppedError`.

**F3: native goals honour the runtime selection**
- `assertNativeGoalRuntime` checks which runtime is selected and refuses unknown names and anything other than `docker`.
- It runs before every native-goal launch:
  - **Claude:** at the start of the goal and before building each launch's Docker arguments.
  - **Codex:** in `CodexAgent.executeNativeGoal` and `executeCodexAppServerGoal`.
  - **Antigravity:** before each segment, via a new `runtime` field on the launch settings.

  In each case the check comes before git credentials are prepared or anything is spawned.

**Tests and docs**
- `test/agentRuntimeRegistry.test.ts`:
  - **Network:** a restricted run policy and the enforced instance policy both refuse an unsupported runtime; an unreadable policy fails the run; supporting runtimes receive the restriction; exempt runs get none.
  - **Stop:** stopping while preparation is pending, and stopping when the container is not found after spawn.
  - **Caller signal:** a caller's own cancellation still reaches the launch.
  - **Native goals:** the runtime-selection rules.
- `test/nativeGoalLaunchBoundary.test.ts`:
  - The three native-goal paths refuse a non-Docker runtime and an unknown `PROPR_AGENT_RUNTIME` without preparing git access or spawning anything.
  - An end-to-end test through the real executor: stopping during pending network setup spawns nothing.
- **Existing stop test:** it now confirms that `stop()` waits until the run exits.
- **Docs:** `coding-agent-integration.md` now describes all three behaviours.

**Test issues not caused by this change**
- **Golden test hang:** `agentRunSpecGoldenArgv` passes both its tests but never exits, so `timeout` kills it. It does the same on a clean copy of HEAD.
- **Leftover test database:** at first `goalContinuationPublication` failed with "table `system_configs` already exists". The cause was a half-migrated `data/propr.sqlite` left by one of my own interrupted runs. With that removed it passes 4/4, and I've deleted the leftover folder.

PR: #3773
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 24, 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 24, 2026

Copy link
Copy Markdown
Contributor Author

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

Overall Evaluation

The PR introduces a structured runtime interface while preserving existing Docker argument construction. It needs a localized security correction before merge: Docker does not enforce a restriction supplied through the new spec contract.

✅ Compatibility coverage — Golden tests compare provider arguments against legacy builders across task, analysis, MCP, and goal configurations.

✅ Cancellation handling — The handle combines caller cancellation with its own signal, and added tests cover stopping during launch preparation.

✅ Explicit runtime refusal — Native goal paths reject unsupported runtime selections instead of silently launching Docker.

This review is based on static analysis of the supplied code; no commands were run. Current checks report no failures, with three pending.

Merge blockers

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

F4: 🔴 Enforce the spec’s network restriction

  • Category: security

  • Required behavior: AgentRunNetwork.restriction explicitly requires the receiving runtime to confine the run to that policy. Docker advertises support for this capability.

  • Evidence: packages/core/src/agents/runtime/dockerRuntime.ts, DockerRunHandle.constructor; packages/core/src/agents/runtime/registry.ts, withAgentRunNetworkRequirement and runAgent; packages/core/src/agents/runtime/dockerRunArgs.ts, renderDockerRunArgs

    1. A caller supplies an AgentRunSpec with a restricted network.restriction and a bridge network to the exported runAgent API, outside an ambient network-policy context and without an enforced instance policy. This is also reachable by resolving a spec inside a restricted context and launching it afterward.
    2. withAgentRunNetworkRequirement preserves that restriction, and the capability check accepts Docker because it advertises supportsRestrictedNetwork: true.
    3. DockerRunHandle renders the spec, but the renderer uses only spec.network.name; it does not apply the restriction. The constructor passes no corresponding policy context to the executor.
    4. The existing Docker network boundary resolves policy from the ambient context or instance settings, so this launch proceeds with bridge networking rather than the restriction carried by its spec.

    The resulting container has outbound access that the supplied spec forbids. Capability validation only checks the boolean capability; it does not install the policy. The new restricted-network tests establish an ambient policy and mock the executor, so they do not cover enforcement from the spec alone. static trace: the constructor, renderer, registry, and supplied dockerNetworkPolicy.ts excerpts establish this sequence; it was not executed.

  • Minimum fix: Make Docker execution enforce spec.network.restriction through the existing network-policy machinery, preserving any stronger applicable policy. Cover both direct DockerRuntime.start() and runAgent() launches with a restricted spec outside an ambient context.

Suggestions

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

S2: 🟢 Bound stream subscriber buffering

LazyOutputStreams.write() ignores the return value of PassThrough.write(). Once a caller accesses a stream, a paused or slow consumer can accumulate output without a bound. Consider defining a bounded buffering or backpressure policy and testing a slow subscriber. This is optional for the current provider paths, which only call wait() and never create these streams.

S3: 🟢 Document environment helper limits

agentRunEnvironment() combines wrapper variables and explicit variables but does not load envFiles or resolve inherited values. Clarifying this in its documentation would help future runtime implementations avoid overlooking Vibe’s credential env file or name-only MCP variables. Docker already handles these through its rendered arguments, so this is a follow-up.

Score

Strong compatibility and cancellation coverage support the refactor, but the new network-policy contract has an enforcement gap that must be corrected. The supplied current checks show no failures, with three still pending.

Score: 6/10


🤖 Review Details

  • Model: GPT-6 Astra
  • Time: 47s
  • Tokens: 116,493 (115,445 in / 1,048 out)
  • Cost: $1.10

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 F4 S2 S3

🤖 Review by ProPR

@propr-dev

propr-dev Bot commented Nov 24, 2026 •

Copy link
Copy Markdown
Contributor Author

✅ Applied the requested follow-up changes in commit c75a9cb

Addressed 1 AI review comment (IDs: 7119664731)

Addressed finding F4

Summary of Changes

I fixed F4: Docker now enforces the network.restriction a spec carries, even when no network policy is active at launch. The new regression tests fail on HEAD and pass with the fix.

The fix

  • Spec policy installed at launch (packages/core/src/network/agentRunNetworkRestriction.ts): when a spec carries a restriction, the Docker launch runs inside that policy's scope. The executor's existing network handling then swaps the container's network for --network none plus the per-run egress proxy, the same as a run under a workflow or instance policy.
  • A stronger policy is never replaced:
    • If the policy in force at launch (an enclosing restricted run, or the enforced instance policy) is the same as the spec's, the launch simply joins it.
    • If they differ, the run is refused before anything starts. Comparing two allowlists to pick the narrower one isn't reliable, so I refuse rather than guess.
    • An open enclosing scope is tightened to the spec's restriction.
    • If the instance policy can't be read, the run fails rather than running with open networking.
  • Exemptions don't open a restricted spec: DockerRunHandle (packages/core/src/agents/runtime/dockerRuntime.ts) drops a caller's networkPolicyExempt when the spec demands confinement.
  • No change for specs without a restriction: they launch exactly as before, so the docker run arguments the golden tests compare are unchanged.
  • Own module on purpose: the helper is a new file rather than part of dockerNetworkPolicy.ts, because nativeGoalLaunchBoundary.test.ts partially mocks that module and a new export there would break it.

Tests

  • New file test/agentRunSpecNetworkRestriction.test.ts (5 tests): it uses the real executor and egress proxy and captures only the process spawn. It covers:
    • direct DockerRuntime.start() and runAgent() with a restricted spec and no active or instance policy: the container gets --network none, the proxy variables and the socket mount, and the socket directory is cleaned up afterwards.
    • a caller's exemption being ignored.
    • an open enclosing scope being tightened.
    • a conflicting run policy and a conflicting enforced instance policy both being refused before spawn, while a matching instance policy runs.
    • an unreadable instance policy spawning nothing.
  • Existing suites: the 12 other test files touching the runtime, egress and network policy all pass. Typecheck and zero-warning lint pass for the changed packages/core files.
  • Golden test: agentRunSpecGoldenArgv still never exits on its own; it was already hanging on HEAD, and this change doesn't touch the renderer it checks.

Docs: I added a sentence to docs/docs/architecture/coding-agent-integration.md describing this.

Container setup: npm ci failed here at first because /tmp/propr-setup-cache is owned by root. It worked with a writable npm_config_cache. I didn't change any repository setup files for this.

Something to decide separately (not changed): a restriction that comes from a workflow, not one the instance enforces, still falls back to open networking with a warning when the agent can't run behind the proxy. That has always been how the policy behaves, but it is weaker than what the AgentRunNetwork.restriction doc comment promises. Tell me if you want spec restrictions to refuse in that case instead.

There's nothing visual to preview, so I didn't create any.

Review digest

Risk-tiered paths

  • High risk: none
  • Normal risk (2 files)
    • packages/core/src/agents/runtime/dockerRuntime.ts (+9/−3)
    • packages/core/src/network/agentRunNetworkRestriction.ts (added, +45/−0)
  • Low risk (2 files)
    • docs/docs/architecture/coding-agent-integration.md (+1/−1)
    • test/agentRunSpecNetworkRestriction.test.ts (added, +102/−0)

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


🤖 Implementation Details

  • Model: Claude Opus 5.5 (medium)
  • Requested By: @propr-ultrafix
  • Time: 20m 51s
  • Tokens: 3,338,021 (3,318,328 in / 19,693 out)
  • Cost: $1.56

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 F4: Docker now enforces the `network.restriction` a spec carries, even when no network policy is active at launch. The new regression tests fail on HEAD and pass with the fix.

**The fix**
- **Spec policy installed at launch** (`packages/core/src/network/agentRunNetworkRestriction.ts`): when a spec carries a restriction, the Docker launch runs inside that policy's scope. The executor's existing network handling then swaps the container's network for `--network none` plus the per-run egress proxy, the same as a run under a workflow or instance policy.
- **A stronger policy is never replaced:**
  - If the policy in force at launch (an enclosing restricted run, or the enforced instance policy) is the same as the spec's, the launch simply joins it.
  - If they differ, the run is refused before anything starts. Comparing two allowlists to pick the narrower one isn't reliable, so I refuse rather than guess.
  - An open enclosing scope is tightened to the spec's restriction.
  - If the instance policy can't be read, the run fails rather than running with open networking.
- **Exemptions don't open a restricted spec:** `DockerRunHandle` (`packages/core/src/agents/runtime/dockerRuntime.ts`) drops a caller's `networkPolicyExempt` when the spec demands confinement.
- **No change for specs without a restriction:** they launch exactly as before, so the `docker run` arguments the golden tests compare are unchanged.
- **Own module on purpose:** the helper is a new file rather than part of `dockerNetworkPolicy.ts`, because `nativeGoalLaunchBoundary.test.ts` partially mocks that module and a new export there would break it.

**Tests**
- **New file `test/agentRunSpecNetworkRestriction.test.ts`** (5 tests): it uses the real executor and egress proxy and captures only the process spawn. It covers:
  - direct `DockerRuntime.start()` and `runAgent()` with a restricted spec and no active or instance policy: the container gets `--network none`, the proxy variables and the socket mount, and the socket directory is cleaned up afterwards.
  - a caller's exemption being ignored.
  - an open enclosing scope being tightened.
  - a conflicting run policy and a conflicting enforced instance policy both being refused before spawn, while a matching instance policy runs.
  - an unreadable instance policy spawning nothing.
- **Existing suites:** the 12 other test files touching the runtime, egress and network policy all pass. Typecheck and zero-warning lint pass for the changed `packages/core` files.
- **Golden test:** `agentRunSpecGoldenArgv` still never exits on its own; it was already hanging on HEAD, and this change doesn't touch the renderer it checks.

**Docs:** I added a sentence to `docs/docs/architecture/coding-agent-integration.md` describing this.

**Container setup:** `npm ci` failed here at first because `/tmp/propr-setup-cache` is owned by root. It worked with a writable `npm_config_cache`. I didn't change any repository setup files for this.

**Something to decide separately (not changed):** a restriction that comes from a workflow, not one the instance enforces, still falls back to open networking with a warning when the agent can't run behind the proxy. That has always been how the policy behaves, but it is weaker than what the `AgentRunNetwork.restriction` doc comment promises. Tell me if you want spec restrictions to refuse in that case instead.

There's nothing visual to preview, so I didn't create any.

PR: #3773
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 24, 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 24, 2026

Copy link
Copy Markdown
Contributor Author

CI failed: Full Test Suite Shard 1/4

Please investigate and fix this CI failure.

  • Check: Full Test Suite Shard 1/4
  • Result: failure
  • Commit: c75a9cb3472a (c75a9cb3472a890976a3f59597a7249a643c6a5e)
  • Run: View CI failure

Failure evidence

.github:11
Process completed with exit code 1.

.github:41706
Process completed with exit code 1.

.github:2
Node.js 20 is deprecated. The following actions target Node.js 20 but are being forced to run on Node.js 24: actions/checkout@11d5960. For more information see: https://github.blog/changelog/2025-09-19-deprecation-of-node-20-on-github-actions-runners/

@propr-dev

propr-dev Bot commented Nov 24, 2026 •

Copy link
Copy Markdown
Contributor Author

✅ Applied the requested follow-up changes in commit 75d6c59

Summary of Changes

I fixed both failures behind Shard 1/4. Each was a test that didn't keep up with this PR's changes, and none is a bug in the production code.

1. packages/core/test/antigravityConfig.test.ts, "Antigravity analysis inherits reasoning only when enabled"

  • Cause: the test caught the launch arguments by mocking the agent's buildDockerArgs. Since this PR, analyze() calls buildRunSpec instead, so the mock never ran. The analysis then ran for real for about 20 seconds, and the captured arguments came back empty (undefined where 'gemini-3.8-flash-medium' was expected).
  • Fix: the test now mocks buildRunSpec and turns the spec into arguments with renderDockerRunArgs, the same step the Docker runtime takes. It still checks the same --model values.
  • Result: the whole file passes locally, 54 of 54.

2. test/agentRunSpecGoldenArgv.test.ts, timed out after 180s

  • Cause: all 26 subtests passed in CI, but the file never exited. Loading the Antigravity and Vibe agents opens the shared SQLite database connection, and the test never closed it, so the runner killed it at the time limit. I reproduced the hang locally.
  • Fix: the test's after() hook now calls closeConnection(), as vibeAgent.test.ts and antigravityAgent.test.ts already do.
  • Result: the file now passes 26 of 26 and exits in about 2.5 seconds.

I also ran the PR's other new test files (agentRuntimeRegistry, agentRunSpecNetworkRestriction, nativeGoalLaunchBoundary). All pass and exit in about 2 seconds. I ran each changed file on its own, not through the full sharded suite.

The Node.js 20 deprecation line in the CI output is only a warning and didn't cause the failure. There's nothing visual here, so I didn't create any previews.

Review digest

Risk-tiered paths

  • High risk: none
  • Normal risk: none
  • Low risk (2 files)
    • packages/core/test/antigravityConfig.test.ts (+7/−2)
    • test/agentRunSpecGoldenArgv.test.ts (+5/−1)

Diff size: 2 files changed, +12/−3 lines


🤖 Implementation Details

  • Model: Claude Opus 5.5 (medium)
  • Requested By: @propr-dev[bot]
  • Time: 6m 10s
  • Tokens: 1,581,703 (1,575,900 in / 5,803 out)
  • Cost: $0.79

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: 7120376827✓

I fixed both failures behind Shard 1/4. Each was a test that didn't keep up with this PR's changes, and none is a bug in the production code.

**1. `packages/core/test/antigravityConfig.test.ts`, "Antigravity analysis inherits reasoning only when enabled"**
- **Cause:** the test caught the launch arguments by mocking the agent's `buildDockerArgs`. Since this PR, `analyze()` calls `buildRunSpec` instead, so the mock never ran. The analysis then ran for real for about 20 seconds, and the captured arguments came back empty (`undefined` where `'gemini-3.8-flash-medium'` was expected).
- **Fix:** the test now mocks `buildRunSpec` and turns the spec into arguments with `renderDockerRunArgs`, the same step the Docker runtime takes. It still checks the same `--model` values.
- **Result:** the whole file passes locally, 54 of 54.

**2. `test/agentRunSpecGoldenArgv.test.ts`, timed out after 180s**
- **Cause:** all 26 subtests passed in CI, but the file never exited. Loading the Antigravity and Vibe agents opens the shared SQLite database connection, and the test never closed it, so the runner killed it at the time limit. I reproduced the hang locally.
- **Fix:** the test's `after()` hook now calls `closeConnection()`, as `vibeAgent.test.ts` and `antigravityAgent.test.ts` already do.
- **Result:** the file now passes 26 of 26 and exits in about 2.5 seconds.

I also ran the PR's other new test files (`agentRuntimeRegistry`, `agentRunSpecNetworkRestriction`, `nativeGoalLaunchBoundary`). All pass and exit in about 2 seconds. I ran each changed file on its own, not through the full sharded suite.

The Node.js 20 deprecation line in the CI output is only a warning and didn't cause the failure. There's nothing visual here, so I didn't create any previews.

PR: #3773
Comment by: @propr-dev[bot] (ID: 7120376827)
Model: Claude Opus 5.5

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

propr-dev Bot commented Nov 24, 2026

Copy link
Copy Markdown
Contributor Author

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

Overall Evaluation

The PR introduces structured run specifications and a runtime interface while preserving existing Docker launches. It needs a localized security correction before merge: dispatch can silently replace a spec’s network restriction.

✅ Compatibility coverage — Golden tests compare rendered arguments against legacy builders across all five providers and the legacy Claude service.

✅ Cancellation handling — The handle propagates cancellation into launch preparation and waits for settlement; tests cover stopping before spawn.

✅ Explicit runtime refusal — Native goal paths reject unsupported runtime selections instead of silently falling back to Docker.

The supplied current-head status reports 19 passed checks, no failures, and no pending checks. This review uses static analysis only; no commands were run.

Merge blockers

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

F5: 🔴 Preserve explicit network restrictions during dispatch

  • Category: security

  • Required behavior: A spec’s explicit network restriction must remain binding. When it differs from the policy applying at launch, the implementation must refuse the launch rather than silently replace either policy, as documented by this PR.

  • Evidence: packages/core/src/agents/runtime/registry.ts:77, withAgentRunNetworkRequirement; packages/core/src/network/agentRunNetworkRestriction.ts:27, policy comparison.

    1. A caller supplies runAgent with a spec restricted to registry.npmjs.org, inside an enclosing restricted policy allowing example.com.
    2. withAgentRunNetworkRequirement resolves the enclosing policy and unconditionally replaces spec.network.restriction with it.
    3. runAgent passes this rewritten spec to DockerRuntime.start.
    4. executeWithAgentRunNetworkRestriction compares the rewritten restriction against the enclosing policy. They now match, so it launches successfully.
    5. The container can reach example.com, although the caller’s explicit spec forbade that destination. The expected conflict refusal never occurs.

    static trace: The overwrite happens before both capability validation and Docker’s conflict check. The same overwrite occurs for an enforced instance policy outside an enclosing scope. Existing conflict tests call DockerRuntime.start directly; the runAgent restriction test runs without an ambient restriction, so neither exercises this dispatch conflict. No external race or unverified runtime behavior is needed to establish the loss of the original policy.

  • Minimum fix: Before attaching an applicable policy, compare it with any existing spec restriction and reject differing policies. Preserve matching restrictions and retain explicit restrictions when no ambient policy applies. Add regression coverage through runAgent for enclosing-policy and enforced-instance conflicts.

Suggestions

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

S4: 🟢 Bound subscribed output buffering

LazyOutputStreams.write ignores backpressure from its PassThrough streams. Once a consumer accesses a stream, a paused or slow reader can accumulate output indefinitely. Consider a bounded buffering policy or an explicit consumption contract for handle users. This is optional for the current provider integration because runAgent only calls wait() and never creates these streams.

Score

The compatibility work and passing checks support the refactor, but the dispatch path defeats an explicitly documented network-isolation guarantee. A focused policy-preservation fix and regression tests should resolve the blocker.

Score: 6/10


🤖 Review Details

  • Model: GPT-6 Astra
  • Time: 38s
  • Tokens: 117,224 (116,343 in / 881 out)
  • Cost: $1.08

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 F5 S4

🤖 Review by ProPR

@propr-dev

propr-dev Bot commented Nov 24, 2026 •

Copy link
Copy Markdown
Contributor Author

✅ Applied the requested follow-up changes in commit 1882848

Addressed 1 AI review comment (IDs: 7120818191)

Addressed finding F5

Summary of Changes

I fixed F5. When runAgent gets a spec that already has its own network restriction, it no longer swaps in the policy that applies at launch. The new and existing tests pass, and the core package typechecks and lints clean.

The fix (packages/core/src/agents/runtime/registry.ts, withAgentRunNetworkRequirement):

  • No policy applies at launch: the spec's restriction is kept as is.
  • The applying policy is the same: the spec's restriction is kept as is.
  • The applying policy is different: the run is refused with a NetworkPolicyError before any runtime sees it. This covers both an enclosing restricted run and the enforced instance policy. The message matches the one Docker already gives for this conflict.
  • Network exemption: the comparison ignores the caller's exemption, the same way the Docker launch already did. Without that, a different runtime called with an exemption inside a conflicting policy would have started without any check.
  • Specs without their own restriction: behaviour is unchanged; the applying policy is still attached as before.

Other callers: this was the only place in packages/core/src that overwrote a spec's restriction. The Docker-side check in agentRunNetworkRestriction.ts was already correct; it just never got to see the original restriction.

New tests

  • test/agentRunSpecNetworkRestriction.test.ts adds two tests that go through runAgent and the real Docker runtime, with only process spawning faked:
    • An enclosing policy allowing example.com against a spec restricted to registry.npmjs.org: refused, with and without an exemption, and nothing is spawned. A matching enclosing policy still launches with the container confined.
    • An enforced instance policy that differs: refused. A matching one: launches.
  • test/agentRuntimeRegistry.test.ts adds one test with a stand-in runtime that has no conflict check of its own. The spec's restriction is kept when no policy applies or the policy matches, and conflicting runs, including enforced-instance and exempt ones, never reach the runtime.

All 19 tests in those two files pass. With the old registry.ts put back, the three new tests fail and the other 16 still pass.

I also added a sentence to docs/docs/architecture/coding-agent-integration.md saying that dispatch keeps a spec's own restriction and refuses a conflicting one.

I found nothing else outside F5's scope.

Review digest

Risk-tiered paths

  • High risk: none
  • Normal risk (1 file)
    • packages/core/src/agents/runtime/registry.ts (+15/−1)
  • Low risk (3 files)
    • docs/docs/architecture/coding-agent-integration.md (+1/−1)
    • test/agentRunSpecNetworkRestriction.test.ts (+31/−0)
    • test/agentRuntimeRegistry.test.ts (+22/−0)

Diff size: 4 files changed, +69/−2 lines


🤖 Implementation Details

  • Model: Claude Opus 5.5 (medium)
  • Requested By: @propr-ultrafix
  • Time: 5m 4s
  • Tokens: 795,056 (788,807 in / 6,249 out)
  • Cost: $0.57

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 F5. When `runAgent` gets a spec that already has its own network restriction, it no longer swaps in the policy that applies at launch. The new and existing tests pass, and the core package typechecks and lints clean.

**The fix** (`packages/core/src/agents/runtime/registry.ts`, `withAgentRunNetworkRequirement`):
- **No policy applies at launch:** the spec's restriction is kept as is.
- **The applying policy is the same:** the spec's restriction is kept as is.
- **The applying policy is different:** the run is refused with a `NetworkPolicyError` before any runtime sees it. This covers both an enclosing restricted run and the enforced instance policy. The message matches the one Docker already gives for this conflict.
- **Network exemption:** the comparison ignores the caller's exemption, the same way the Docker launch already did. Without that, a different runtime called with an exemption inside a conflicting policy would have started without any check.
- **Specs without their own restriction:** behaviour is unchanged; the applying policy is still attached as before.

**Other callers:** this was the only place in `packages/core/src` that overwrote a spec's restriction. The Docker-side check in `agentRunNetworkRestriction.ts` was already correct; it just never got to see the original restriction.

**New tests**
- `test/agentRunSpecNetworkRestriction.test.ts` adds two tests that go through `runAgent` and the real Docker runtime, with only process spawning faked:
  - An enclosing policy allowing `example.com` against a spec restricted to `registry.npmjs.org`: refused, with and without an exemption, and nothing is spawned. A matching enclosing policy still launches with the container confined.
  - An enforced instance policy that differs: refused. A matching one: launches.
- `test/agentRuntimeRegistry.test.ts` adds one test with a stand-in runtime that has no conflict check of its own. The spec's restriction is kept when no policy applies or the policy matches, and conflicting runs, including enforced-instance and exempt ones, never reach the runtime.

All 19 tests in those two files pass. With the old `registry.ts` put back, the three new tests fail and the other 16 still pass.

I also added a sentence to `docs/docs/architecture/coding-agent-integration.md` saying that dispatch keeps a spec's own restriction and refuses a conflicting one.

I found nothing else outside F5's scope.

PR: #3773
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 24, 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 24, 2026

Copy link
Copy Markdown
Contributor Author

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

Overall Evaluation

The PR introduces structured agent run specifications and a Docker runtime while preserving existing provider launch arguments. It needs a localized correction to output-stream buffering before merge.

✅ Compatibility coverage — Golden tests compare rendered arguments against earlier builders across all five providers and the legacy Claude service.

✅ Network enforcement — Explicit restrictions remain binding, conflicting policies are rejected, and tests exercise confinement through the executor.

✅ Cancellation coverage — Tests cover stopping during launch preparation and reject unsupported runtime selections for native goals.

This was a static review of the supplied code; no commands were run. Current checks show 17 passed, none failed, and one pending.

Merge blockers

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

F6: 🔴 Bound run-handle output buffering

  • Category: correctness

  • Required behavior: The newly exposed output streams must not allow a slow or paused consumer to cause unbounded worker memory growth.

  • Evidence: packages/core/src/agents/runtime/dockerRuntime.ts:LazyOutputStreams.write, and packages/core/src/claude/docker/dockerExecutor.ts output callbacks.

    1. A caller starts a verbose agent and consumes handle.stdout through a slower destination, or pauses consumption after subscribing.
    2. The executor continues receiving child output and calls onOutput for every chunk.
    3. LazyOutputStreams.write() continues writing into its PassThrough, ignoring the return value when the stream exceeds its buffering threshold.
    4. Pending output accumulates without a limit for the remaining run. A sufficiently long, verbose run can exhaust worker memory and interrupt other executions.

    Lazy allocation only protects streams whose getters are never accessed. Once allocated, neither a buffer limit nor backpressure connects the stream to the producer. The added stream test forwards only a few short chunks and does not exercise this condition. static trace: the unconditional executor callbacks feed unconditional PassThrough.write() calls. proposed regression: pause an attached consumer while producing sustained output and verify that buffering remains bounded.

  • Minimum fix: Implement bounded buffering with an explicit overflow policy, or propagate consumer backpressure to the producer. Cover both stdout and stderr with a slow-consumer regression test.

Suggestions

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

S5: 🟢 Trim unrelated golden fixture code

The legacy claudeHelpers.ts fixture copies parsing, logging, Redis persistence, and worktree utilities beyond the argument builder being compared. Retaining only the reference builder and its necessary dependencies would make the compatibility tests easier to maintain. This is optional cleanup; the extra fixture code does not invalidate the comparisons.

S6: 🟢 Document stream subscription semantics

Document on AgentRunHandle.stdout and .stderr that output emitted before accessing the stream is unavailable through that stream, while wait() retains the executor result. The implementation and test intentionally establish this behavior, but the public interface currently leaves it implicit. This clarification is optional.

Score

The compatibility and network tests provide useful coverage, and current CI reports no failures. Unbounded buffering in the new run-handle API requires correction before merge.

Score: 6/10


🤖 Review Details

  • Model: GPT-6 Astra
  • Time: 53s
  • Tokens: 120,727 (119,541 in / 1,186 out)
  • Cost: $1.14

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 F6 S5 S6

🤖 Review by ProPR

@propr-dev

propr-dev Bot commented Nov 24, 2026 •

Copy link
Copy Markdown
Contributor Author

✅ Applied the requested follow-up changes in commit 2a624cc

Addressed 1 AI review comment (IDs: 7121224945)

Addressed finding F6

Summary of Changes

I fixed F6: the run handle's stdout and stderr streams now hold at most 1 MiB each for a reader that falls behind. Past that, output is dropped, and the stream reports how many bytes it lost.

The fix (packages/core/src/agents/runtime/dockerRuntime.ts)

  • I replaced the unbounded PassThrough streams with a stream that has a fixed limit, AGENT_RUN_OUTPUT_BUFFER_LIMIT_BYTES (1 MiB per stream).
  • If a reader is paused or piped into something slower, any chunk that would push the backlog over the limit is dropped and counted.
  • Once the reader catches up, or the run ends, the stream gets one line: [propr: N bytes of agent stdout dropped because the reader fell behind].
  • A chunk is always accepted when nothing is waiting, so the most a stream holds is the limit plus one chunk plus that notice line.
  • I chose dropping over slowing the agent down to match its reader. Pausing the container's output would stall the run and could trip its idle watchdog, or hold up the executor's own output capture.
  • wait() still returns the executor's own capture of the output, whatever the streams dropped.
  • Streams still start carrying output only from their first read.

Same problem elsewhere: I checked the other places that receive the executor's output callbacks. The executor's own capture of stdout and stderr was already bounded, and the only receiver of the callbacks is the handle's streams, so nothing else needed changing.

Tests (test/agentRuntimeRegistry.test.ts): a fake verbose run writes 4 MiB to each of stdout and stderr, four times the limit, in 64 KiB chunks.

  • Paused reader: both streams are opened but never read. The test checks that each holds no more than the bound, and that once read, the output received plus the dropped count adds up to exactly what was produced.
  • Slow destination: both streams are piped into a writer that takes 20 ms per write. The test checks the highest amount each stream held stays within the bound, and the same byte accounting.
  • Both tests failed against the old code, which held about 4 MiB on each stream. They pass with the fix.

Results

  • All 14 tests in agentRuntimeRegistry.test.ts pass.
  • These suites also pass: agentRunSpecNetworkRestriction (7), nativeGoalLaunchBoundary (18), dockerExecutorWatchdog (14) and agentRunSpecGoldenArgv (26).
  • agentRunSpecGoldenArgv needs PROPR_DEMO_MODE=true in this container; without it the file exits early on the "GitHub auth is not configured" message, with or without my change.
  • Typecheck and zero-warning lint pass for packages/core.

I also documented the limit and what happens on overflow on the stdout/stderr fields in types.ts and in docs/docs/architecture/coding-agent-integration.md. Nothing here is visible on screen, so I made no preview.

Review digest

Risk-tiered paths

  • High risk: none
  • Normal risk (2 files)
    • packages/core/src/agents/runtime/dockerRuntime.ts (+67/−8)
    • packages/core/src/agents/runtime/types.ts (+5/−0)
  • Low risk (2 files)
    • docs/docs/architecture/coding-agent-integration.md (+1/−1)
    • test/agentRuntimeRegistry.test.ts (+92/−1)

Diff size: 4 files changed, +165/−10 lines


🤖 Implementation Details

  • Model: Claude Opus 5.5 (high)
  • Requested By: @propr-ultrafix
  • Time: 7m 2s
  • Tokens: 1,621,112 (1,606,705 in / 14,407 out)
  • Cost: $0.95

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 F6: the run handle's `stdout` and `stderr` streams now hold at most 1 MiB each for a reader that falls behind. Past that, output is dropped, and the stream reports how many bytes it lost.

**The fix** (`packages/core/src/agents/runtime/dockerRuntime.ts`)
- I replaced the unbounded `PassThrough` streams with a stream that has a fixed limit, `AGENT_RUN_OUTPUT_BUFFER_LIMIT_BYTES` (1 MiB per stream).
- If a reader is paused or piped into something slower, any chunk that would push the backlog over the limit is dropped and counted.
- Once the reader catches up, or the run ends, the stream gets one line: `[propr: N bytes of agent stdout dropped because the reader fell behind]`.
- A chunk is always accepted when nothing is waiting, so the most a stream holds is the limit plus one chunk plus that notice line.
- I chose dropping over slowing the agent down to match its reader. Pausing the container's output would stall the run and could trip its idle watchdog, or hold up the executor's own output capture.
- `wait()` still returns the executor's own capture of the output, whatever the streams dropped.
- Streams still start carrying output only from their first read.

**Same problem elsewhere:** I checked the other places that receive the executor's output callbacks. The executor's own capture of stdout and stderr was already bounded, and the only receiver of the callbacks is the handle's streams, so nothing else needed changing.

**Tests** (`test/agentRuntimeRegistry.test.ts`): a fake verbose run writes 4 MiB to each of stdout and stderr, four times the limit, in 64 KiB chunks.
- **Paused reader:** both streams are opened but never read. The test checks that each holds no more than the bound, and that once read, the output received plus the dropped count adds up to exactly what was produced.
- **Slow destination:** both streams are piped into a writer that takes 20 ms per write. The test checks the highest amount each stream held stays within the bound, and the same byte accounting.
- Both tests failed against the old code, which held about 4 MiB on each stream. They pass with the fix.

**Results**
- All 14 tests in `agentRuntimeRegistry.test.ts` pass.
- These suites also pass: `agentRunSpecNetworkRestriction` (7), `nativeGoalLaunchBoundary` (18), `dockerExecutorWatchdog` (14) and `agentRunSpecGoldenArgv` (26).
- `agentRunSpecGoldenArgv` needs `PROPR_DEMO_MODE=true` in this container; without it the file exits early on the "GitHub auth is not configured" message, with or without my change.
- Typecheck and zero-warning lint pass for `packages/core`.

I also documented the limit and what happens on overflow on the `stdout`/`stderr` fields in `types.ts` and in `docs/docs/architecture/coding-agent-integration.md`. Nothing here is visible on screen, so I made no preview.

PR: #3773
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 24, 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 24, 2026

Copy link
Copy Markdown
Contributor Author

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

Overall Evaluation

The PR introduces structured run specifications and a runtime registry while preserving the existing Docker execution path. It needs a localized correction to ensure handle control operations address the same Docker daemon as the launch.

✅ Compatibility coverage — Golden tests compare provider arguments against the previous builders, including analysis, MCP policies, and goal variants.

✅ Network enforcement — Explicit spec restrictions are enforced at launch, and conflicting ambient policies are refused rather than silently substituted.

This was a static review of the supplied code; no commands were run. Current checks show 17 passed, none failed, and one pending.

Merge blockers

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

F7: 🔴 Preserve Docker connection settings in handles

  • Category: correctness

  • Required behavior: A run handle’s stop, inspect, and isAlive operations must address the Docker daemon on which its run was launched.

  • Evidence: packages/core/src/agents/runtime/dockerRuntime.ts — DockerRunHandle constructor, stop, and inspect.

    1. A caller starts a run with Docker connection settings in options.extraEnvVars, such as DOCKER_HOST pointing to a separate daemon.
    2. The constructor forwards those options to the executor. The supplied admission implementation explicitly merges extraEnvVars into the environment used by its Docker client.
    3. The handle does not retain those connection settings. Its subsequent inspect and stop calls pass only a timeout, so they address the default daemon instead.
    4. If that daemon lacks the container, inspect() reports not_found and isAlive() returns false despite the run existing on the launch daemon. If it contains another container with the same name, stop() targets that unrelated container.

    The cancellation fallback does not correct the inspection result or undo a stop sent to another daemon. Existing handle tests mock commands without checking connection environments, so they do not cover this mismatch. static trace: constructor option forwarding and control-command option omission, together with the supplied prepareAdmittedAgent environment construction. proposed regression: launch with a distinct DOCKER_HOST and assert that stop and inspection preserve it.

  • Minimum fix: Retain the launch’s Docker connection environment and apply it consistently to stop and inspect; add a regression test checking those options.

Suggestions

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

S7: 🟢 Trim unrelated golden fixture code

The legacy claudeHelpers.ts fixture includes output parsing, Redis persistence, and worktree helpers that the golden argument comparison does not exercise. Keeping only the frozen builder and its necessary dependencies would make the reference easier to audit. This is optional cleanup: the additional fixture code does not itself demonstrate a production regression.

Score

The argument compatibility and network-boundary coverage are strong, and current checks have no failures. The newly exposed handle must preserve its launch connection settings before merge.

Score: 6/10


🤖 Review Details

  • Model: GPT-6 Astra
  • Time: 59s
  • Tokens: 123,560 (122,097 in / 1,463 out)
  • Cost: $1.16

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 F7 S7

🤖 Review by ProPR

@propr-dev

propr-dev Bot commented Nov 24, 2026 •

Copy link
Copy Markdown
Contributor Author

✅ Applied the requested follow-up changes in commit 491ba2d

Addressed 1 AI review comment (IDs: 7121678868)

Addressed finding F7

Summary of Changes

I fixed F7: a run handle now retains the Docker connection settings its run was launched with, so stop, inspect and isAlive reach the daemon that actually holds the container. The new regression test passes, and it fails when run against the unfixed code.

The fix (packages/core/src/agents/runtime/dockerRuntime.ts)

  • When the handle is created, it now keeps a frozen copy of the launch's extraEnvVars. Both ways a run starts give the Docker client process.env with extraEnvVars merged over it: the direct spawn, and admission's prepareAdmittedAgent. Re-applying the same variables reproduces the launch's client environment exactly. That covers DOCKER_HOST, DOCKER_CONTEXT, DOCKER_CONFIG and the TLS settings without keeping a list of Docker variable names.
  • docker stop and docker inspect now pass that copy via extraEnvVars, and isAlive() inherits it because it goes through inspect(). A launch without extra variables behaves as before.
  • Because it's a copy, a caller that changes or reuses its options object after start() can't point the handle at a different daemon.
  • The fallback that cancels a still-preparing launch starts no Docker command, so it needed no change. Within this PR, these two calls are the only control commands the handle issues.

Tests (test/agentRuntimeRegistry.test.ts)

  • New regression test: the run is launched with DOCKER_HOST=tcp://daemon-b:2376, and the mock reports "No such container" to any command that doesn't target that daemon. The test checks that inspect() reports running, isAlive() is true, and inspect and stop both carry the launch's settings even after the caller has changed its own copy. Without the fix it fails, because the handle reports not_found.
  • Second new test: a launch with empty extraEnvVars passes no extra environment to its control commands.
  • All 16 tests in the file pass, and the packages/core typecheck and zero-warning lint are clean. Test files aren't covered by the root lint config.

Separate finding, not changed: when the executor itself tears down a run (on timeout or loss of ownership), it calls runDocker in packages/core/src/claude/docker/dockerContainerControl.ts. That function takes no environment, so those kill/stop/inspect calls also go to the default daemon. That code predates this PR and isn't modified by it, so I didn't touch it. It may be worth a separate finding if launches on non-default daemons are expected.

Review digest

Risk-tiered paths

  • High risk: none
  • Normal risk (1 file)
    • packages/core/src/agents/runtime/dockerRuntime.ts (+17/−2)
  • Low risk (1 file)
    • test/agentRuntimeRegistry.test.ts (+51/−0)

Diff size: 2 files changed, +68/−2 lines


🤖 Implementation Details

  • Model: Claude Opus 5.5 (high)
  • Requested By: @propr-ultrafix
  • Time: 4m 57s
  • Tokens: 1,023,530 (1,015,890 in / 7,640 out)
  • Cost: $0.65

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 F7: a run handle now retains the Docker connection settings its run was launched with, so `stop`, `inspect` and `isAlive` reach the daemon that actually holds the container. The new regression test passes, and it fails when run against the unfixed code.

**The fix** (`packages/core/src/agents/runtime/dockerRuntime.ts`)
- When the handle is created, it now keeps a frozen copy of the launch's `extraEnvVars`. Both ways a run starts give the Docker client `process.env` with `extraEnvVars` merged over it: the direct spawn, and admission's `prepareAdmittedAgent`. Re-applying the same variables reproduces the launch's client environment exactly. That covers `DOCKER_HOST`, `DOCKER_CONTEXT`, `DOCKER_CONFIG` and the TLS settings without keeping a list of Docker variable names.
- `docker stop` and `docker inspect` now pass that copy via `extraEnvVars`, and `isAlive()` inherits it because it goes through `inspect()`. A launch without extra variables behaves as before.
- Because it's a copy, a caller that changes or reuses its options object after `start()` can't point the handle at a different daemon.
- The fallback that cancels a still-preparing launch starts no Docker command, so it needed no change. Within this PR, these two calls are the only control commands the handle issues.

**Tests** (`test/agentRuntimeRegistry.test.ts`)
- **New regression test:** the run is launched with `DOCKER_HOST=tcp://daemon-b:2376`, and the mock reports "No such container" to any command that doesn't target that daemon. The test checks that `inspect()` reports `running`, `isAlive()` is true, and `inspect` and `stop` both carry the launch's settings even after the caller has changed its own copy. Without the fix it fails, because the handle reports `not_found`.
- **Second new test:** a launch with empty `extraEnvVars` passes no extra environment to its control commands.
- All 16 tests in the file pass, and the `packages/core` typecheck and zero-warning lint are clean. Test files aren't covered by the root lint config.

**Separate finding, not changed:** when the executor itself tears down a run (on timeout or loss of ownership), it calls `runDocker` in `packages/core/src/claude/docker/dockerContainerControl.ts`. That function takes no environment, so those `kill`/`stop`/`inspect` calls also go to the default daemon. That code predates this PR and isn't modified by it, so I didn't touch it. It may be worth a separate finding if launches on non-default daemons are expected.

PR: #3773
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 24, 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 24, 2026

Copy link
Copy Markdown
Contributor Author

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

Overall Evaluation

The PR introduces structured run specifications and a Docker runtime while retaining the existing executor’s safeguards. It needs a localized correction before merge: launch and control commands can address different Docker daemons when launch options are reused.

✅ Provider compatibility — Golden comparisons cover task, analysis, inspection, and goal argument construction across all providers.

✅ Network enforcement — Explicit spec restrictions remain binding, conflicting policies are refused, and integration tests exercise confinement through the real executor.

✅ Cancellation coverage — Tests cover stopping during network preparation and refusing unsupported runtimes for native goals.

The supplied current-head checks report 19 passed, none failed or pending. This review used static analysis only, as requested.

Merge blockers

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

F8: 🔴 Snapshot environment for launch too

  • Category: correctness

  • Required behavior: A run handle’s launch, stop, and inspection operations must address the same Docker daemon.

  • Evidence: packages/core/src/agents/runtime/dockerRuntime.ts:138, DockerRunHandle.constructor and controlOptions; test/agentRuntimeRegistry.test.ts, “handle stop, inspect and isAlive address the Docker daemon the run was launched on.”

    1. A caller starts a run with an extraEnvVars object selecting daemon B. The constructor copies that object into dockerEnvironment, but passes the original object through launchOptions to the executor.
    2. While asynchronous launch preparation is pending, the caller reuses the object and changes DOCKER_HOST to daemon C. This exact mutation is exercised by the added test, which explicitly asserts that the launch sees the caller’s mutated environment.
    3. When admission constructs its Docker environment from options.extraEnvVars, it selects C. Subsequent handle inspection and stop commands use the frozen copy selecting B.
    4. Inspection therefore reports the run missing on B, and the explicit stop command targets B instead of the daemon running the agent.

    The snapshot protects only control commands; it does not establish a shared immutable environment for launch and control. Admission leases and cancellation checks do not prevent mutation of this caller-owned object. The added test mocks the executor and checks the two different environments independently, so it does not detect the daemon mismatch.

    static trace: constructor option forwarding, the supplied prepareAdmittedAgent environment merge, and the added environment-mutation test. proposed regression: delay launch preparation, mutate the caller’s object, and assert that launch, inspection, and stop all retain daemon B.

  • Minimum fix: Pass the same captured environment values to the launch executor and control commands. Update the mutation test to require the launch environment to remain unchanged too.

Suggestions

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

S8: 🟢 Document custom runtime obligations

The exported runtime interface accepts replacement implementations, but admission, spend-cap enforcement, extension preparation, and workflow observation remain in the Docker executor. Document these obligations for runtime implementers, ideally with reusable contract tests before another runtime ships. This is optional because Docker remains the only built-in implementation.

S9: 🟢 Align persisted configuration types

The provider AgentConfig gains runtime, while the supplied persisted configuration interface in configManagerAgents.ts lacks it. Aligning these interfaces would make runtime selection easier to discover and maintain. The shown loader returns stored objects directly, so the type discrepancy alone does not demonstrate lost runtime settings.

Score

Strong compatibility and boundary coverage, with all current checks passing. The environment mismatch needs a small correction to make the new handle’s control contract reliable.

Score: 6/10


🤖 Review Details

  • Model: GPT-6 Astra
  • Time: 43s
  • Tokens: 123,849 (122,774 in / 1,075 out)
  • Cost: $1.17

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 F8 S8 S9

🤖 Review by ProPR

@propr-dev

propr-dev Bot commented Nov 24, 2026 •

Copy link
Copy Markdown
Contributor Author

✅ Applied the requested follow-up changes in commit 4db7a6a

Addressed 1 AI review comment (IDs: 7122168663)

Addressed finding F8

Summary of Changes

I fixed F8: the launch, stop, inspect and isAlive of a run handle now all address the same Docker daemon, even if the caller changes its extraEnvVars object while the launch is still being prepared.

Fix (packages/core/src/agents/runtime/dockerRuntime.ts)

  • DockerRunHandle still freezes a copy of the caller's extraEnvVars when the run starts. The launch now uses that same frozen copy instead of the caller's object. Before, only stop and inspect used it, so the launch could read a changed DOCKER_HOST and end up on daemon C while stop and inspect went to daemon B.
  • The launch, stop and inspect each get a fresh copy of it through one helper, dockerClientOptions() (renamed from controlOptions()).
  • An empty {} environment is also no longer passed to the launch. Before, a caller who later added DOCKER_HOST to that empty object would send the launch to another daemon while stop and inspect used the default one. Leaving the empty object out changes nothing else, since the launch code treats it the same as no environment at all.
  • The launch options are now copied when start() runs, not when the delayed network-policy step finally calls the executor.

Regressions (test/agentRuntimeRegistry.test.ts)

  • The mock launch now waits on a gate before reading DOCKER_HOST, the way the real launch only picks its daemon after admission. inspect reports the run only on the daemon the launch actually used, so a mismatch shows up as "not found".
  • Caller reuses its environment: the caller changes DOCKER_HOST and adds DOCKER_CONTEXT while the launch is waiting. The test checks that the launch, both inspections and stop all stay on daemon B, and that the launch never holds the caller's object. This test runs twice: once for a plain spec and once for a spec with its own network restriction, which waits for the network policy before calling the executor.
  • Empty environment filled in later: the launch stays on the default daemon, and neither the launch nor the control commands get an extraEnvVars. This test replaces the earlier version that only checked the control commands.
  • I put the previous dockerRuntime.ts back temporarily: all three new cases failed, and they pass with the fix.

Verification

  • agentRuntimeRegistry passes 17/17.
  • The other runtime suites also pass: agentRunSpecNetworkRestriction, dockerExecutorWatchdog, nativeGoalLaunchBoundary and agentRunSpecGoldenArgv.
  • tsc --noEmit in packages/core passes, and the changed file passes eslint with zero warnings.

Found but not changed (outside F8)

  • The executor's own cleanup (timeout and spend-cap stops, ownership teardown) runs docker stop, kill and rm through runDocker in packages/core/src/claude/docker/dockerContainerControl.ts. That uses only process.env and never sees extraEnvVars. So when a launch picks a daemon through extraEnvVars, those cleanup commands go to the default daemon. That file isn't changed by this PR.
  • If something changes process.env itself (for example DOCKER_HOST) during a run, the launch and later control commands could still disagree. The handle only freezes extraEnvVars, not the whole process environment.

There's nothing visual to preview, so I didn't create any.

Review digest

Risk-tiered paths

  • High risk: none
  • Normal risk (1 file)
    • packages/core/src/agents/runtime/dockerRuntime.ts (+18/−9)
  • Low risk (1 file)
    • test/agentRuntimeRegistry.test.ts (+42/−18)

Diff size: 2 files changed, +60/−27 lines


🤖 Implementation Details

  • Model: Claude Opus 5.5 (xhigh)
  • Requested By: @propr-ultrafix
  • Time: 7m 7s
  • Tokens: 2,267,635 (2,251,152 in / 16,483 out)
  • Cost: $1.20

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 F8: the launch, `stop`, `inspect` and `isAlive` of a run handle now all address the same Docker daemon, even if the caller changes its `extraEnvVars` object while the launch is still being prepared.

**Fix** (`packages/core/src/agents/runtime/dockerRuntime.ts`)
- `DockerRunHandle` still freezes a copy of the caller's `extraEnvVars` when the run starts. The launch now uses that same frozen copy instead of the caller's object. Before, only `stop` and `inspect` used it, so the launch could read a changed `DOCKER_HOST` and end up on daemon C while `stop` and `inspect` went to daemon B.
- The launch, `stop` and `inspect` each get a fresh copy of it through one helper, `dockerClientOptions()` (renamed from `controlOptions()`).
- An empty `{}` environment is also no longer passed to the launch. Before, a caller who later added `DOCKER_HOST` to that empty object would send the launch to another daemon while `stop` and `inspect` used the default one. Leaving the empty object out changes nothing else, since the launch code treats it the same as no environment at all.
- The launch options are now copied when `start()` runs, not when the delayed network-policy step finally calls the executor.

**Regressions** (`test/agentRuntimeRegistry.test.ts`)
- The mock launch now waits on a gate before reading `DOCKER_HOST`, the way the real launch only picks its daemon after admission. `inspect` reports the run only on the daemon the launch actually used, so a mismatch shows up as "not found".
- **Caller reuses its environment:** the caller changes `DOCKER_HOST` and adds `DOCKER_CONTEXT` while the launch is waiting. The test checks that the launch, both inspections and `stop` all stay on daemon B, and that the launch never holds the caller's object. This test runs twice: once for a plain spec and once for a spec with its own network restriction, which waits for the network policy before calling the executor.
- **Empty environment filled in later:** the launch stays on the default daemon, and neither the launch nor the control commands get an `extraEnvVars`. This test replaces the earlier version that only checked the control commands.
- I put the previous `dockerRuntime.ts` back temporarily: all three new cases failed, and they pass with the fix.

**Verification**
- `agentRuntimeRegistry` passes 17/17.
- The other runtime suites also pass: `agentRunSpecNetworkRestriction`, `dockerExecutorWatchdog`, `nativeGoalLaunchBoundary` and `agentRunSpecGoldenArgv`.
- `tsc --noEmit` in `packages/core` passes, and the changed file passes eslint with zero warnings.

**Found but not changed (outside F8)**
- The executor's own cleanup (timeout and spend-cap stops, ownership teardown) runs `docker stop`, `kill` and `rm` through `runDocker` in `packages/core/src/claude/docker/dockerContainerControl.ts`. That uses only `process.env` and never sees `extraEnvVars`. So when a launch picks a daemon through `extraEnvVars`, those cleanup commands go to the default daemon. That file isn't changed by this PR.
- If something changes `process.env` itself (for example `DOCKER_HOST`) during a run, the launch and later control commands could still disagree. The handle only freezes `extraEnvVars`, not the whole process environment.

There's nothing visual to preview, so I didn't create any.

PR: #3773
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 24, 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 24, 2026

Copy link
Copy Markdown
Contributor Author

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

Overall Evaluation

The PR introduces structured agent run specifications and a selectable runtime while preserving existing Docker launch behavior. It is merge-ready within the supplied scope, conditional on the remaining test shard passing. This review used static analysis of the supplied diff and context; no commands were run.

✅ Compatibility coverage — Golden tests compare provider argument rendering against legacy builders, including analysis, MCP policies, and native goal variants.

✅ Network enforcement — Explicit spec restrictions are enforced at Docker launch, conflicting ambient policies are rejected, and unsupported runtimes are refused before dispatch.

✅ Cancellation coverage — Handle cancellation reaches launch preparation, with tests covering cancellation before spawn and container absence after spawn.

Merge blockers

No merge blockers.

Suggestions

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

S10: 🟢 Trim unrelated fixture code

The legacy claudeHelpers.ts fixture copies output parsing, Redis persistence, and other functions unrelated to argument comparisons. Keeping only the reference builder and its dependencies would make the compatibility baseline easier to audit. This is optional cleanup; the additional fixture code does not demonstrate a production regression.

S11: 🟢 Clarify stream buffer documentation

The integration documentation promises a maximum of 1 MiB per stream, whereas BoundedOutputStream.offer() explicitly permits an oversized chunk when its buffer is empty, plus a drop notice. Documenting that allowance would align the stated bound with the implementation. The supplied executor path does not establish a material memory failure from this discrepancy.

Score

The implementation provides substantial compatibility and lifecycle coverage, with no verified merge blocker. Current checks show 17 passed, none failed, and one pending; native goal transport migration remains an explicitly documented limitation.

Score: 8/10


🤖 Review Details

  • Model: GPT-6 Astra
  • Time: 35s
  • Tokens: 124,788 (124,195 in / 593 out)
  • Cost: $1.16

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 S10 S11

🤖 Review by ProPR

@propr-dev propr-dev Bot removed the ultrafix label Nov 24, 2026
@propr-dev propr-dev Bot changed the title 🔨 [3758 by Claude Opus 5.5] Introduce AgentRuntime interface with DockerRuntime adapter (no behaviour change) ✅❽ [3758 by Claude Opus 5.5] Introduce AgentRuntime interface with DockerRuntime adapter (no behaviour change) Nov 24, 2026
@integry
integry merged commit 8141457 into 3758-epic-runtime-abstraction-sc0 Nov 24, 2026
43 checks passed
@propr-dev propr-dev Bot changed the title ✅❽ [3758 by Claude Opus 5.5] Introduce AgentRuntime interface with DockerRuntime adapter (no behaviour change) [3758 by Claude Opus 5.5] Introduce AgentRuntime interface with DockerRuntime adapter (no behaviour change) Nov 24, 2026
propr-dev Bot pushed a commit that referenced this pull request Nov 24, 2026
I fixed F21. I did not fix F20, because the runtimes it needs don't exist on this branch or on its epic base yet.

**F21: idle shutdown is now refused.** The app image on this branch has no idle detector and no `/wake` route (nothing in `src/` or `packages/` reads `PROPR_IDLE_SHUTDOWN`). So `--idle-shutdown` only switched the restart policy to `on-failure` and printed a wake URL nothing serves, while the Machine kept running and billing.
- A new `assertFlyIdleShutdownSupported` check in `prepareFlyDeploy` (`packages/cli/src/commands/deployFly.ts:174`) runs right after the agent-runtime check. It stops a real run or a `--dry-run` before anything is written or sent to Fly, and the error says why and to deploy without the flag.
- The gate is one constant, `FLY_IDLE_SHUTDOWN_SUPPORTED = false`. Once #3770 lands in the image, setting it to `true` turns the existing idle-shutdown config back on. The summary lines for it can't be reached until then.
- I removed the claims that it works from the `--idle-shutdown` help text, the help example, the generated `fly.toml` comment ("ProPR decides when to stop instead"), the CHANGELOG, `propr-cli.md` and `deploy-fly.md`. In `deploy-fly.md` the section is now "Idle shutdown (not available yet)", and the cost section no longer tells Free-plan users to use `--idle-shutdown`.
- I added a test in `deployFly.test.ts` that covers the bare flag as commander parses it, `15m`, a dry run, and a malformed duration. It also checks that without the flag both generated configs stay always-on. I dropped the `idleShutdown` case from the browser sign-in test, because that case now hits the idle refusal first.

**Checks:** all 104 Fly deploy tests pass, and the new test fails when the check is removed. The CLI typecheck is clean, and the docs build passes with the new anchor resolving. Running the real CLI with `--idle-shutdown --dry-run` exits 1 with the new message and writes no files; without the flag, a dry run writes `policy = "always"` and `min_machines_running = 1`.

**F20 (Docker-free deployment) is blocked, not fixed.** The review's fix is to "land the required runtime support", which is #3764 (Sprites) or #3767 (Fly Machines). Both are still open with no PR. Comparing this branch with the epic base shows only #3758, #3759, #3760 and #3761 merged there, and none of them adds those runtimes. They also depend on the AgentRuntime interface (#3773), which is on the epic base but not on this branch. Writing a runtime here would duplicate those issues and conflict with the base, and I can't test it against a live Sprites or Fly account. As the finding asks, unsupported runtimes are still refused. To clear F20 once one of those runtimes merges into the epic:
1. Update this branch from the base.
2. Add the runtime to `FLY_WORKER_AGENT_RUNTIMES`.
3. Check a real deploy with it.

I made no preview images, because the change is CLI and docs text only.

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

ProPR-Agent: claude/claude-opus-5-5
integry pushed a commit that referenced this pull request Nov 24, 2026
…Machine (#3775)

* feat: add `propr deploy fly` to run the control plane on Fly

I've added `propr deploy fly`, which puts the control plane on one Fly Machine. It hasn't been run against a real Fly account, and nothing was tried end to end on a Free-plan org with agents on Sprites. The 55 new and related tests pass, both typechecks are clean, a real `--dry-run` produced a `fly.toml` that parses as TOML, and the docs build passes with no broken links.

What it does
- Layout: the all-in-one app container (`node dist/src/allInOne.js`) and Redis run as two containers in the same Machine. Redis only listens on 127.0.0.1. SQLite and Redis's data files sit on an encrypted Fly volume mounted at `/usr/src/app/data`, the same path the local stack uses.
- Image: it deploys the `propr/app` image from the launcher manifest as-is, with no build and no Docker-in-Docker.
- Size: defaults to shared-cpu-1x with 1 GB and a 1 GB volume. Agents default to Sprites; `--agent-runtime fly-machines` is the other option.
- How it reaches Fly: it uses `flyctl` (or `fly`) when installed: it writes `fly.toml` plus a container config file, creates the app and volume, stages secrets over stdin, and runs `fly deploy --image …`. Without flyctl it calls the Machines API with `--token` or `FLY_API_TOKEN`. Re-running updates the existing deployment in place, and `--dry-run` only writes the files.
- Secrets: it uploads your stack `.env`, minus host paths and the values it sets itself. `SESSION_SECRET` is generated only on the first deploy, so a redeploy doesn't sign everyone out. A GitHub App key is stored as a secret and written to a file in the Machine.
- Connect and relay: it enrolls a GitHub relay token automatically when you're logged in and the stack has no GitHub App or relay token. Connect is enabled with `--tunnel-token`/`--tunnel-url`, which adds a cloudflared container. It deliberately doesn't copy a tunnel token from your local `.env`, because two connectors on one tunnel would split traffic.
- Idle shutdown (your comment on the issue): off unless you pass `--idle-shutdown [after]`. That sets restart `on-failure`, Fly autostop off, autostart on, and prints the `https://<app>.fly.dev/wake` URL.
- Legacy Docker mode: `--legacy-docker` adds a Docker daemon container with the two fixes from the issue. On every boot it removes stale `/var/run/docker*` and `/run/containerd` PID files, then loop-mounts an ext4 image from the volume at `/var/lib/docker` for overlay2. It needs at least 2 GB and a 10 GB volume.

Where it falls short of the issue
- Wake URL not registered with Connect: the registration API (propr-routing#335) doesn't exist yet, so the command only prints the URL.
- Unbuilt pieces: Sprites and Fly Machines agents, and idle shutdown itself, come from #3764, #3767 and #3772, which haven't landed on this branch yet. The command sets their settings (`PROPR_AGENT_RUNTIME`, `SPRITES_TOKEN`, `PROPR_IDLE_SHUTDOWN*`) but they do nothing until those are merged.
- Memory not measured on Fly: the docs reuse the existing figures from the setup guide and Fly's November 2026 `iad` prices: about $6.85/month always on, over the Free plan's $5. They say plainly that the numbers haven't been re-measured on a deployed Machine.
- Four assumptions to check on a real deploy:
  - Containers in one Machine see the Machine-level volume mount.
  - Fly's proxy connects from 172.16.0.0/12, which the API is told to trust for client IPs and HTTPS.
  - The cloudflared container can use a written `/etc/hosts` so Connect's `http://api:4000` reaches the app.
  - The legacy Docker container is allowed to create loop devices and mount filesystems.

The command and runner are in `packages/cli/src/commands/deployFly.ts` and `packages/cli/src/commands/deploy/`. The docs page is `docs/docs/operations/deploy-fly.md`. I added a `loadLauncherManifest()` export in the CLI orchestrator module and a CHANGELOG entry. There are no preview images because the change has no visible UI.

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

* chore: share Fly Machine metadata across backends and pin Redis port

I've fixed both findings. The 39 deploy tests pass and the CLI typecheck is clean. No real Fly deploy was run, and ESLint isn't set up for `packages/cli`, so lint wasn't run.

**F1: the Machine is now recognised whichever backend created it**
- **Shared metadata:** `buildMachineMetadata()` in `flyMachineConfig.ts` is now used both by the API's Machine config and by the flyctl `propr-machine.json`. A Machine created with flyctl now carries `propr-role: control-plane`, so a later `--backend api` deploy updates it instead of creating a second one.
- **Reverse direction:** the same metadata also includes `fly_platform_version: v2` and `fly_process_group: app`. This is so a later flyctl deploy treats an API-created Machine as part of the app. That flyctl behaviour comes from how I understand flyctl to work; I haven't tested it against real flyctl.
- **Volume check:** the API backend now also treats a Machine as the control plane if it already has the deployment's data volume attached, even without the tag. A second Machine could never attach that volume anyway, so updating the first one is the only option that works. The guard against two control-plane Machines uses this same check, so it can now see such a Machine.
- **New tests in `flyDeployRunner.test.ts` and `flyMachineConfig.test.ts`:**
  - A Machine set up from the real flyctl output files is updated, not duplicated, by a later API deploy.
  - An untagged Machine holding the volume is updated.
  - The flyctl JSON and the API config carry the same metadata.

**F2: the session store always uses the Machine's own Redis port**
- `SESSION_REDIS_PORT` is now on the list of settings the deploy controls, so a value from the stack `.env` is no longer uploaded.
- The app container now gets `SESSION_REDIS_PORT` set explicitly to the same port Redis listens on. That port is now one constant, `FLY_REDIS_PORT` (6379), shared by Redis, `REDIS_PORT` and `SESSION_REDIS_PORT`.
- The new test feeds in a stack `.env` with port 6380 and checks it isn't uploaded and that the app and Redis agree on 6379.

I confirmed the new tests catch the bugs: removing the metadata from the flyctl file, dropping the exclusion, or dropping the explicit port each makes the matching test fail.

**Not fixed, related:** the stack `.env` can still upload `REDIS_URL`, `REDIS_USERNAME`, `REDIS_PASSWORD` and `REDIS_TLS`. The Redis client in `packages/core/src/webhook/checkRunHelpers.ts` uses `REDIS_URL` ahead of host and port, so a local value there would send that client somewhere other than the Machine's Redis. It's the same kind of problem but a different consumer from the one F2 names, so I left it.

There are no preview images, since nothing here is visible in a UI.

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

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

* chore: extend undersized reused Fly volumes before secrets and deploy

I fixed F3. Both Fly backends now check the actual size of a reused volume before any secret is uploaded or anything is deployed. An undersized volume is extended, its new size is read back from Fly, and the Docker filesystem is sized from that confirmed figure. The 46 deploy tests pass and both typechecks are clean. None of this has been run against a real Fly account: the `fly volumes extend` command and the `PUT …/volumes/{id}/extend` API call are written from my knowledge of flyctl and the Machines API and checked only against fakes.

**What changed**
- **Reading the size:** both backends now return the volume's size. flyctl reads `size_gb` from `volumes list --json`, where it used to drop it; the Machines API path already had it. If the size can't be read, the deploy stops instead of assuming the volume is big enough.
- **Check and extend (`flyDeployRunner.ts`):** a new step in `runFlyDeploy` runs after the volume is found or created and before secrets. If the volume is smaller than the plan, it calls a new `extendVolume` on the backend, then lists the volumes again to confirm the new size. If Fly still reports less than the plan needs, the deploy stops with the exact `fly volumes extend <id> --size N --app <app>` command to run by hand.
- **Extend calls:** flyctl runs `volumes extend <id> --app <app> --size N --yes`. The Machines API client has a new `extendVolume` method that calls the extend endpoint.
- **Sizing from the real volume:** the deploy now uses the confirmed size, so the `truncate -s …G` in the Docker boot script matches the volume it lives on. On the 1 GB → 20 GB case from the finding, the image is 18 GB on a confirmed 20 GB volume. If the existing volume is larger than requested (say 30 GB), it isn't touched and the image is sized from it (28 GB). The final summary in `deployFly.ts` prints the confirmed size too.
- **Docs:** `deploy-fly.md` now says that a reused volume smaller than requested is extended before any secret is set.

**New tests**
- **flyctl:** a 1 GB volume is extended to 20 GB and re-checked before `secrets import`, giving an 18G Docker image. A volume that is still too small after extending stops the deploy before any secrets or deploy, with the hint. A missing size stops it without extending. A 30 GB volume is kept and gives a 28G image.
- **Machines API:** the same extend-then-confirm order, with the Docker image size taken from the Machine config. A volume still too small after extending stops before secrets.
- **API client:** the URL and body of the extend request.

**Things to know**
- **Extending is automatic and permanent:** Fly volumes can't shrink. Redeploying an existing 1 GB volume with `--legacy-docker` now grows it to 20 GB (about +$2.85/month at Fly's $0.15/GB-month), and that can't be undone.
- **Restart after extending:** Fly may want the Machine restarted after an extend. The deploy that follows restarts it anyway, so I added no separate restart.

One problem I noticed but didn't touch, since it's outside F3: the boot script only creates `docker.ext4` when the file doesn't exist. So if the volume grows after a legacy deploy has already made the image, the image keeps its old size.

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

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

* chore: protect Fly-managed env keys and grow Docker volume on resize

I fixed both findings, F4 and F5. The CLI typecheck is clean and the 54 tests in the deploy and `deployFly` files pass. Nothing was run against a real Fly Machine. CI's PR build check runs only a fixed list of CLI test files, and these aren't on it.

**F4: imported `.env` can no longer override what the deploy sets**
- **Fix:** `FLY_MANAGED_ENV_KEYS` in `flyMachineConfig.ts` is now built from every key `buildAppEnv` can produce, for every agent runtime, with tunnel, GitHub App key, idle shutdown and legacy Docker all on. The host-only settings from the old list are added on top.
- **Keys now excluded:** this picks up the four the finding named: `PROPR_INDEXING`, `SPRITES_CLIENT_SIGNALS`, `GIT_CLONES_BASE_PATH`, `GIT_WORKTREES_BASE_PATH`. Every key the old hand-written list had is still covered.
- **Already handled:** `PROPR_EGRESS_SOCKET_DIR` and `DOCKER_HOST` were already in the old list. `HOST_PROPR_EGRESS_SOCKET_DIR` was already skipped by the `HOST_` rule.
- **Future keys:** a setting added to `buildAppEnv` later is excluded automatically.
- **Tests:** four new regressions:
  - every key the builder produces is in the excluded set.
  - `PROPR_INDEXING=separate` and `SPRITES_CLIENT_SIGNALS` from the `.env` aren't uploaded, and indexing stays `inline`.
  - conflicting clone, worktree and egress paths aren't uploaded, and the paths stay under `/propr-shared`.
  - the same path checked end to end through `collectFlySecrets` with a legacy Docker plan.

  All four fail against the previous code.

**F5: a larger volume now grows the Docker filesystem**
- **Fix:** before mounting, the boot script (`flyLegacyDocker.ts`) now grows an existing `docker.ext4` that is smaller than the requested size. It extends the file, runs a forced `e2fsck`, then `resize2fs`, so pulled images are kept.
- **Never shrinks:** an image larger than requested is left as it is.
- **Interrupted resize:** whether to grow is decided from the filesystem's own size, not the file's, so a resize cut off by a stop finishes on the next boot.
- **Tools:** I checked that `docker:27-dind` installs `e2fsprogs` and `e2fsprogs-extra`, which provide `resize2fs` and `dumpe2fs`.
- **Tests:** they run the generated disk steps against real ext4 scratch images (`mount` is stubbed). They cover a first boot, growing from 1 to 3 GiB with a marker file surviving, a smaller request not shrinking the image, and finishing an interrupted resize. Without the fix, the grow and interrupted-resize tests fail. They skip if the e2fsprogs tools aren't installed.
- **Busybox check:** I also ran the steps by hand under a static busybox shell, which is what `docker:dind` uses. They grew the image correctly there too.

I added a sentence on each fix to `docs/docs/operations/deploy-fly.md` and a line on the F5 change to the CHANGELOG entry.

**Not changed, for you to decide:**
- **Old secrets stay:** the deploy never removes a Fly secret it has already uploaded. A managed key uploaded by an earlier run of this branch, or set by hand with `fly secrets set`, would still override the generated setting. Clearing those on redeploy would need a new "unset secrets" step in both the flyctl and Machines API paths, so I left it.
- **Newer Docker images lack the disk tools:** `docker:27-dind` is end of life, and newer `docker:dind` tags such as 29 no longer include e2fsprogs. Moving `LEGACY_DOCKER_IMAGE` to a newer tag would break the boot script's `mkfs.ext4`, `e2fsck` and `resize2fs` steps.

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

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

* chore: enroll relay token in deploy fly for own-App Connect stacks

I fixed F6: when the tunnel flags turn on Connect and there is no relay token, `propr deploy fly` now enrolls one even if the stack has its own GitHub App. If it can't enroll, it stops before contacting Fly. The 7 new tests and the existing 61 deploy tests pass, and both CLI typechecks are clean. Nothing was run against a real Fly account or a real relay; the tests use stubbed enrollment.

**The fix**
- The relay logic moved out of `deployFly.ts` into a new file, `packages/cli/src/commands/deploy/flyRelay.ts`, as a check step and an enroll step.
- **Own App with Connect and no relay token:** a relay token is enrolled. The GitHub API keeps using the own App: `GH_AUTH_MODE=app` is set unless the stack `.env` already sets a mode. Without that pin, having both a relay URL and token would quietly switch API auth to the relay.
- **Installation for that token:** the own App's `GH_INSTALLATION_ID` belongs to the own App, not to the shared App that relay tokens are tied to. So enrollment uses `--installation` or looks the installation up, and the existing `GH_INSTALLATION_ID` is left alone.
- **Can't enroll:** with the tunnel flags, no relay token, and either no `propr login` or `--no-relay`, the command now fails with a message saying how to fix it. This check runs before anything is sent to Fly, `--dry-run` included. A dry run also says when a real run would enroll a token.
- **Unchanged:** without Connect, an own App still skips automatic enrollment, and explicit `--relay` and the shared-App path behave as before.

**Same problem in a second place:** the API in Connect mode also needs `PROPR_GH_RELAY_URL`, with no fallback to the hosted relay. A stack `.env` that had a relay token but no URL would still have failed to start, so with Connect the command now sets that URL from `--relay-url` or the hosted default.

**Tests** are in `packages/cli/src/commands/deploy/flyRelay.test.ts`. The main one runs own-App credentials and tunnel flags through the real secret collection and env builder. It checks that the Machine env has every variable Connect requires and that GitHub API auth still resolves to the own App. The others cover: `--installation`, an explicit `GH_AUTH_MODE`, both failure cases, an existing token without a URL, own App without Connect, and the shared-App path.

I also updated the `--relay` help text and the relay section of `docs/docs/operations/deploy-fly.md`.

**Separate issue, not changed:** in Connect mode the API sends `GH_INSTALLATION_ID` to Connect when it builds the sign-in URL. With an own App, that value is the own App's installation, which may not match the one the relay token is tied to. That behaviour is in the existing API code, so I left it alone.

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

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

* chore: keep own GitHub App auth and installation in Fly relay deploys

I fixed F7 and F8 in `packages/cli/src/commands/deploy/flyRelay.ts` and added regressions to `flyRelay.test.ts`. All 66 deploy tests pass and the CLI typecheck is clean. I ran the new tests against the previous `flyRelay.ts`: the F7 and F8 cases fail there, along with the two related cases below. Nothing has been tried against a real Fly deploy.

**F7 — own App kept when the relay token already exists.** The decision to keep the own App for GitHub API auth now applies to every Connect plan, not only when a new token is enrolled:
- **Token, no URL:** the deploy now adds `GH_AUTH_MODE=app` along with the relay URL.
- **Token and URL:** the deploy now adds just `GH_AUTH_MODE=app`.
- **A mode already set:** if the stack `.env` sets `GH_AUTH_MODE` itself, it is left alone.
- **`--relay`:** still switches GitHub API calls to the relay.
- **Without Connect:** nothing changes.

The tests check the resulting mode the way both consumers read it: the API server reads `PROPR_GH_RELAY_URL` as is, and core fills in the hosted default. They cover the token with and without a URL, `--no-relay`, and an explicit `app` or `relay` mode.

**F8 — own App's installation not sent to the relay.** Whether `GH_INSTALLATION_ID` belongs to an own App is now decided on its own, without regard to whether the own App keeps API auth. If `GH_APP_ID` is set, the id is treated as that App's and not reused, unless the stack sets `GH_AUTH_MODE=relay` (that's what `propr relay enroll` writes along with a shared-App installation). In that case the deploy uses `--installation` or discovers the installation. The test covers `--relay` with and without Connect, `--installation`, and failing when more than one installation is found.

**Same defect in two other places, also fixed:**
- **App id without its key:** if the stack has `GH_APP_ID` but no key, the own App's installation id was sent to the relay. It is now discovered instead.
- **`GH_AUTH_MODE=relay` with leftover App credentials:** with Connect on and no token, the old code enrolled but left the own App's `GH_INSTALLATION_ID` in place, so the Machine would run in relay mode with an installation id that doesn't match its token. It now switches to relay properly and saves the enrolled installation.

I also updated the relay paragraph in `docs/docs/operations/deploy-fly.md` to match.

**Behaviour change:** a stack with its own App, a relay URL and token, and no `GH_AUTH_MODE` was in relay mode locally, because core fills in the hosted relay URL. Deployed to Fly with Connect, it now uses the own App, as F7 asks. Anyone who wants the relay should set `GH_AUTH_MODE=relay`.

**Found but not changed (outside this PR's changes):**
- `propr relay enroll` (`packages/cli/src/commands/relayCommands.ts`, `resolveContext`) also reuses `GH_INSTALLATION_ID` from the `.env` even when it belongs to an own App. It's the same defect, in code this PR didn't touch.
- The `--dry-run` list of secrets that would be set leaves out the keys the relay step adds (`PROPR_GH_RELAY_URL`, `GH_AUTH_MODE`). This was already the case for the relay URL.

There's no visible UI change, so there are no previews.

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

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

* chore: require browser sign-in and set GH_AUTH_MODE in Fly deploys

I fixed F9 and F10. All 77 deploy tests and both CLI typechecks pass, and the docs build has no broken links. Nothing was run against a real Fly account.

**F9 — default deployment had no way to sign in.** The deploy now works out how browsers will sign in before it contacts Fly, and it stops if there is no way. This applies to `--dry-run` too. A deploy is accepted when it has one of:
- **ProPR Connect:** the tunnel flags are given.
- **GitHub OAuth:** `GH_OAUTH_CLIENT_ID` and `GH_OAUTH_CLIENT_SECRET` are in the stack `.env`. Placeholder values or only one of the two don't count. The command prints the callback URL to register (`https://<app>.fly.dev/api/auth/github/callback`).
- **Demo mode:** `PROPR_DEMO_MODE=true`, which needs no sign-in.

A relay token alone is refused, because Connect's automatic sign-in only works with a loopback callback, and on Fly the callback is always the public URL. When refusing, the error names both fixes. The summary now has a `Sign-in:` line. The docs page leads with the Connect example and has a new "Browser sign-in" section. I also updated the CLI help examples, the CLI feature page and the CHANGELOG. The new check is in `packages/cli/src/commands/deploy/flyBrowserAuth.ts`.

**F10 — redeploys kept an old relay mode.** Fly secrets are only ever added or replaced, so the deploy now sets `GH_AUTH_MODE` on every run that has GitHub credentials, unless the stack `.env` sets it:
- **Own App:** `app`, with or without Connect, unless `--relay` is given.
- **Relay credentials and no own App:** `relay`. Without this, an earlier `app` setting would have won the same way.
- **No GitHub credentials at all:** nothing is set, so an earlier enrollment keeps working.

A related problem showed up once I made the own App's setting apply without Connect. An own App with no `GH_INSTALLATION_ID` in the `.env` would have been paired with the shared App's installation id left behind by an earlier enrollment. The deploy now stops before provisioning in that case and suggests adding the id or using `--relay`.

The regression test in `flyRedeploy.test.ts` runs consecutive deploys against a fake Fly app that keeps its secrets, using the command's real sequence. I moved that sequence into `prepareFlyDeploy` and `deployPreparedFly` so the test and the command share it. Against the old `flyRelay.ts`, three of its four cases fail.

**Behaviour changes to be aware of:**
- A stack with its own App and a relay token, no `GH_AUTH_MODE`, and no Connect now uses the own App on Fly. Before, it was left to work it out from the other settings, which picked the relay. It matches what Connect deploys already did. Anyone who wants the relay should set `GH_AUTH_MODE=relay`.
- An OAuth client uploaded by an earlier deploy doesn't count, because Fly secret values can't be read back. It has to stay in the stack `.env`.

**Found but not fixed:** both have the same cause. The deploy can add or replace Fly secrets but never remove them, and fixing that would mean adding a way to delete them.
- A relay-only stack with no `GH_INSTALLATION_ID`, deployed after an own-App deploy, would send the own App's leftover installation id to the relay.
- A `PROPR_DEMO_MODE=true` left by an earlier deploy keeps the instance in demo mode after the stack drops it.

There are no previews because nothing here changes the UI.

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

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

* chore: keep earlier GitHub App key wired in on Fly redeploys

F11 is fixed. A redeploy without a GitHub App key now keeps the earlier key wired into the Machine.

**The defect.** `runFlyDeploy` built the container config from a plan whose `githubAppKey` flag reflected only the current run's input. Fly secrets are never removed, so the key secret and `GH_AUTH_MODE=app` stayed on the app, but the new container dropped both the key-file declaration and `GH_PRIVATE_KEY_PATH`. App authentication then had no key to sign with.

**The correction** in `packages/cli/src/commands/deploy/flyDeployRunner.ts`:
- After listing the app's existing secret names, the runner sets the deploy plan's key flag when the key secret is either supplied this run or already on the app.
- The reused-key case logs one line so the operator can see the earlier key is still in charge. No secret values are printed.
- Both targets consume this deploy plan, so flyctl's generated machine config and the Machines API update are covered by the same change.

**Sibling check.** The dry-run path cannot know what is on Fly and so still reflects only local input, which is unavoidable without contacting Fly. The relay planner deliberately pins nothing on a credential-free run, so the preserved `GH_AUTH_MODE=app` and `GH_INSTALLATION_ID` already lined up with the restored key path. No other builder derived state from the plan's key flag.

**Regression.** A new consecutive-deployment test in `flyRedeploy.test.ts` deploys with an own App, then redeploys with only OAuth credentials and no GitHub login. It asserts the mode, App id, installation id, `GH_PRIVATE_KEY_PATH`, the key-file declaration on the app container, and that both auth resolvers still pick `app`. Against the unfixed runner it fails on the key path. With the fix it passes.

**Verification**

| Check | Result |
| --- | --- |
| Deploy-related CLI suites | 78 pass, 0 fail |
| CLI `npm run typecheck` (src and tests) | clean |
| New regression on the HEAD runner | fails as intended |

The only failures in the full CLI run are in `agentSkill.forceRace.test.ts`, where the container's Node 22 lacks `t.mock.module`. They are unrelated to this change.

The docs secrets table and the CHANGELOG entry now state that a redeploy without a key keeps the earlier one wired in. No visual preview was created because the change has no user-visible UI.

PR: #3775
Comment by: @propr-ultrafix (ID: 0)
Model: Claude Fable 5.1

ProPR-Agent: claude/claude-fable-5-1

* chore: pass base64 app key and disable demo mode in Fly deploys

Both findings are fixed, with regressions that fail on the old code and pass on the new one. The change is CLI-only, so no visual preview applies.

**F12: a base64 GitHub App key from the stack `.env` now reaches the Machine.** `collectFlySecrets` in `packages/cli/src/commands/deployFly.ts` sets the plan's key flag whenever the upload carries `PROPR_GH_PRIVATE_KEY_B64`, from a key file or straight from the `.env`. That also fixes `--dry-run`, which writes files from the plan without going through the runner. `runFlyDeploy` additionally treats the key in this run's upload as evidence, alongside the plan flag and a key retained on the app, so the "keeping the earlier key" note no longer prints when the key is fresh.

**F13: GitHub or Connect sign-in switches demo mode off explicitly.** `prepareFlyDeploy` uploads `PROPR_DEMO_MODE=false` whenever browser auth resolves to GitHub or Connect and the `.env` does not set the key itself. A `.env` value such as `0` is uploaded as is. Fly never removes secrets, so this is the only way a retained `PROPR_DEMO_MODE=true` stops gating the API's sign-in.

**Sibling check.** The same retained-secret assumption did not show up elsewhere in changed code: `GH_AUTH_MODE` and the relay token are already pinned per run by the relay planner, and the remaining managed keys live in the plain Machine env, which is replaced wholesale on every deploy.

**Tests added**
- Redeploy suite: first deploy with only the base64 key wires the key file and `GH_PRIVATE_KEY_PATH`, both plain and with Connect; demo to GitHub and demo to Connect redeploys end with demo mode off.
- Runner suite: key wired when uploaded this run, when retained, and not when absent.
- Command and browser-auth suites: collector sets the flag without reading a key file; prepare emits `PROPR_DEMO_MODE=false` for GitHub and Connect and keeps an explicit `.env` value.

**Verification.** The six Fly deploy suites pass (68 tests). With the two source fixes reverted, the six new tests fail. CLI `tsc` for source and tests, and the package ESLint run at zero warnings, are clean. The docs table in `docs/docs/operations/deploy-fly.md` notes both behaviours.

PR: #3775
Comment by: @propr-ultrafix (ID: 0)
Model: Claude Fable 5.1

ProPR-Agent: claude/claude-fable-5-1

* fix: fix Fly deploy config, secrets, intake mode and SIGTERM shutdown

I've fixed all four blockers you found. The SIGTERM hang is the only one I could run for real: I reproduced it locally and confirmed the fix. The other three are covered by unit tests and a local `--dry-run` only; nothing was redeployed to Fly.

**1. `machine_config` resolved against the working directory.** `fly.toml` now points at `propr-machine.json` by absolute path, and `fly deploy` also runs from the `--out` directory. A new test uses a fake `flyctl` that resolves the path the way the real one does. It writes the files from a relative `--out`, then deploys from another directory. It also checks that the old relative path fails with the same `open propr-machine.json: no such file or directory` error you saw. A local `--dry-run` from another directory wrote the absolute path.

**2. Secrets not reaching the containers.** As you suggested, the `app` container now lists every secret by name: the ones this deploy sets plus the ones already on the app. The `tunnel` container lists `TUNNEL_TOKEN`, which cloudflared needs. Only names go into the file, never values. The Machines API path uses the same config. The redeploy tests now only let a container see the secrets it lists, and one checks that a key from an earlier deploy is still visible.

**3. Crash loop when there's no relay token.** Every deploy now sets `GITHUB_EVENT_INTAKE_MODE` to something the Machine can run (new `flyIntake.ts`):
- **Demo mode:** `direct_webhook`, the setting you verified on Fly.
- **Relay token:** `routing_websocket`.
- **Your own GitHub App:** `direct_webhook` if `GH_WEBHOOK_SECRET` is set, otherwise `polling`. That also covers your own App plus a Connect relay token, which would otherwise have failed the daemon's own prerequisite check (`routing_websocket` needs relay auth).

If the stack `.env` sets a mode, it's kept only if it passes that same check. A deploy with no GitHub credentials at all stops before any secret is uploaded. I didn't change the all-in-one to keep the API running when the daemon fails to start. The daemon has already started its intervals and Redis subscriptions by then and has no way to close them.

**4. SIGTERM never finishing shutdown.** The cause is in startup, not an open handle:
- Shutdown waits for any component that's still starting.
- Without Docker (you're on Sprites), the worker never finishes starting: it checks every second for an agent image that never becomes ready.
- In your deploy the all-in-one never logged "control plane started", and it didn't locally either.

I reproduced it with a local Redis, demo mode and `direct_webhook`: 20 seconds after SIGTERM the process was still serving `/health`. The fixes:
- Shutdown now cancels that wait. With the fix, the same run exits 0 about 100 ms after SIGTERM, closing the daemon, the API and the task queue.
- There's also a hard deadline, `PROPR_SHUTDOWN_TIMEOUT_MS` (default 50 s, below Fly's 60 s stop timeout). When it's hit, the process logs that and exits 0, so `on-failure` won't restart a Machine that was asked to stop. A component that fails to close still exits 1, as before.
- A new test starts a real child process whose shutdown never finishes, sends SIGTERM, and checks it exits 0 at the 1 s deadline it's given.

**Checks:** all Fly deploy tests in `packages/cli` pass, including the new ones (I updated older runner tests to give their deploys GitHub credentials). The related root suites pass (128 tests), both CLI typechecks and the root typecheck are clean, and eslint on the changed root files passes with zero warnings. I updated `deploy-fly.md` (new "GitHub event intake" section, secret lists, flyctl working directory) and the CHANGELOG.

The Docker image preparation running every ~30 s under Sprites is still there, as you expected, until #3764. Before merging, it's worth redeploying once to confirm bugs 1–3 on Fly, and that `fly machine stop` now ends the Machine cleanly.

PR: #3775
Comment by: @integry (ID: 7124653146)
Model: Claude Opus 5.5

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

* chore: keep Fly redeploy intake valid and skip relay in demo deploys

I fixed F14 and F15. All 98 Fly deploy tests pass and the CLI typecheck is clean. The four new tests fail on the previous `flyIntake.ts` and `flyRelay.ts` and pass with the fix. ESLint skips these files because no lint config covers them, so lint didn't check them.

**F14: a redeploy no longer picks an intake the kept auth mode can't run** (`packages/cli/src/commands/deploy/flyIntake.ts`)
- **The cause:** Fly can't return secret values, so when this run doesn't set `GH_AUTH_MODE`, an earlier one on the app is known by name only. If the app also holds both a relay token and an own App, it could be either `app` or `relay`. The old code assumed `relay` and pinned `routing_websocket`, which the daemon rejects under App auth.
- **The fix:** in that case only, the deploy keeps the intake mode the earlier deploy set next to that auth mode and uploads nothing new. If there is no earlier intake mode, it sets `polling`, which starts under either auth mode.
- **An intake mode set in the stack `.env`** now has to pass the daemon's startup check under both possible auth modes. If it doesn't, the deploy stops before uploading and asks for `GH_AUTH_MODE` in the `.env`.
- **Unchanged:** when this run sets `GH_AUTH_MODE` itself, or only one kind of credential exists, the mode is chosen as before.
- **Tests:** the redeploy scenario from the finding, run with and without a webhook secret: first deploy is own App plus Connect, then a redeploy with only an OAuth client, no tunnel flags and no login. Each time `GH_AUTH_MODE=app` survives, the intake is kept, and the daemon's own startup check passes. There are also unit tests for the selector.

**F15: demo deploys no longer try relay enrollment by default** (`packages/cli/src/commands/deploy/flyRelay.ts`)
- `planFlyRelay` now skips automatic enrollment when `PROPR_DEMO_MODE` is on and Connect is off. `--relay` and Connect still enroll as before.
- **Tests:** a demo deploy with a local GitHub login where installation discovery throws now succeeds, with no relay token and the passive intake. `--relay` still enrolls and so still hits that failure. There is also a unit test for the planner.

I also added one sentence for each change to `docs/docs/operations/deploy-fly.md`.

One related case I left alone because it's outside these two findings: a redeploy with a `propr login` token but no own App in the `.env` still enrolls a relay token automatically. That switches an app that was on its own App over to relay auth and replaces its `GH_INSTALLATION_ID`. Both values are pinned explicitly, so the Machine still starts, but it's a mode switch nobody asked for.

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

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

* test: fix type error in flyRedeploy test env array typing

I fixed the CI failure: it was a type error in a test added in the last commit. The CLI package typecheck is now clean, and the CI step's tests pass locally with the edited test file added (85 pass, 1 skipped, 0 fail).

**Cause:** the job log showed that only the "Typecheck and test the CLI Agent Skill" step failed. The other three parts of the job passed. The error was in `packages/cli/src/commands/deploy/flyRedeploy.test.ts:229`:

```
error TS2345: Argument of type '{ GH_WEBHOOK_SECRET?: undefined; ... } | { GH_WEBHOOK_SECRET: string; ... }' is not assignable to parameter of type 'Record<string, string>'.
```

The test loops over `[{}, { GH_WEBHOOK_SECRET: "whsec" }]`. TypeScript treats the empty object in that array as having `GH_WEBHOOK_SECRET?: undefined`. The spread object then can't be passed as `Record<string, string>`. The test checks are typechecked in CI by the second `tsc` command in `npm run typecheck`, so CI caught it even though the test itself ran fine.

**Fix:** I declared the array as `Record<string, string>[]` before the loop. This is a 2-line change in that test file and doesn't change what the test checks.

There are no preview images because nothing visible changed.

PR: #3775
Comment by: @propr-dev[bot] (ID: 7125634057)
Model: Claude Opus 5.5

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

* chore: refuse Fly deploys without Docker agent and check GH auth…

I fixed both findings. F17 works as asked; F16 is fixed by refusing the default runtime, so `propr deploy fly` now needs `--legacy-docker` until Sprites and Fly Machines agents land. All 9 Fly deploy test files pass and the CLI typecheck is clean. I didn't run the docs build.

**F16: Sprites and Fly Machines deploys now stop before touching Fly.** There is no Sprites or Fly Machines agent support anywhere in this branch's worker. It always waits for the Docker agent image, so a Machine without Docker would never take a task. Fixing that properly is #3764/#3767, which is out of scope here, so I took the other option the finding allows: refuse the deploy up front.
- `prepareFlyDeploy` calls a new `assertFlyAgentRuntimeSupported`, which only accepts `docker` (`FLY_WORKER_AGENT_RUNTIMES`). It fails before anything is written or sent to Fly, `--dry-run` included. The error tells you to use `--legacy-docker`.
- That means a bare `propr deploy fly --app x` is now refused, because Sprites is still the default. I checked this with a real `--dry-run` from a scratch directory: it fails with that message.
- I updated the CLI help examples, `deploy-fly.md` (a warning box plus examples), `propr-cli.md` and the CHANGELOG to match. When those runtimes land, adding them to the accepted list turns them back on.

**F17: an explicit `GH_AUTH_MODE` must have its credentials.** In `flyIntake.ts` the check now runs separately from the intake mode, before any secret is uploaded:
- `app` needs `GH_APP_ID`, the App private key and `GH_INSTALLATION_ID`.
- `relay` needs `PROPR_GH_RELAY_TOKEN`.
- Secrets kept from an earlier deploy count by name; a value cleared in this run doesn't count.
- Same defect in the inferred path: App mode was assumed without `GH_INSTALLATION_ID`. The daemon's own auth check treats that as no credentials, so the deploy now refuses it too.

**Tests:**
- New regressions cover both modes, with polling and default intake, through the full deploy sequence, and check that no secrets were uploaded. They fail on the previous `flyIntake.ts`.
- A new test refuses `sprites`, `fly-machines`, the default and `--dry-run`.
- I had to update some existing tests:
  - App fixtures that had no installation id are exactly the configuration that is now refused, so they gained one.
  - The sign-in and redeploy test helpers now use `--legacy-docker`.
  - The fake Fly volume now reports the requested size.

No previews, since nothing here is visual.

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

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

* test: fix Fly test typecheck errors by typing env loop lists

I fixed the type error that was failing `CLI Agent Skill (Node 24)`. That same error also failed the Darwin job.

**Cause:** the job's first step runs `npm run typecheck -w @propr/cli`, and that now also checks test files. Two of the new Fly tests loop over `[{}, { GITHUB_EVENT_INTAKE_MODE: "polling" }]`. TypeScript reads that list as allowing `GITHUB_EVENT_INTAKE_MODE` to be `undefined`, so the spread objects didn't fit the `Record<string, string>` parameters:

- `packages/cli/src/commands/deploy/flyIntake.test.ts:60` and `:64`
- `packages/cli/src/commands/deploy/flyRedeploy.test.ts:199`

**Fix:** I typed the loop list as `Record<string, string>[]` in both files (`flyIntake.test.ts:58`, `flyRedeploy.test.ts:196`). Only the tests changed; the deploy code is untouched.

**Verified locally:**
- `npm run typecheck -w @propr/cli` now exits 0 with no errors.
- The two Fly test files pass (21 tests).
- The CI step's own test set (`agentSkill`, `agentSkill.forceRace`, `setupCommand`) passes 72 of 72.

There are no previews because nothing changed on screen.

PR: #3775
Comment by: @propr-dev[bot] (ID: 7126486751)
Model: Claude Opus 5.5

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

* chore: always set polling intake on Fly redeploy with ambiguous auth

I fixed F18: when an app's auth could be either relay or App, a redeploy now always sets polling for event intake. Before, it kept whatever intake an earlier deploy had set.

**Why it broke.** Fly can't read secret values back. So when an app holds both relay and App credentials next to an earlier `GH_AUTH_MODE`, the deploy can't tell which auth mode is live, and it can't read the earlier intake either. That earlier intake may have come from a demo deploy, which sets `direct_webhook` because demo mode skips the daemon's boot checks. Once demo mode is off, App auth without `GH_WEBHOOK_SECRET` fails those checks and the all-in-one process goes down. Polling passes the checks under both relay and App auth. I couldn't find a way to confirm that an unreadable earlier intake would still work, so it is always replaced.

**Changes**
- **`packages/cli/src/commands/deploy/flyIntake.ts`:** removed the branch that kept the earlier intake, so the existing "both kinds of credentials → polling" rule applies. The header comment now says why the old intake isn't kept.
- **`flyRedeploy.test.ts`:** a new test runs the three deploys from the finding: own App with Connect and no webhook secret (polling), then demo mode (`direct_webhook`, with `GH_AUTH_MODE=app` left on Fly), then OAuth client only. It checks that the third deploy sets polling and passes the daemon's boot checks.
  - The older "own App + Connect, redeployed with only an OAuth client" test now expects polling rather than the earlier intake.
- **`flyIntake.test.ts`:** the test that expected the earlier intake to be kept now expects it to be replaced with polling.
- **Docs and changelog:** `docs/docs/operations/deploy-fly.md` and `CHANGELOG.md` now describe the new behaviour.

**Checks**
- All 102 Fly deploy tests pass, and both typechecks (`tsconfig.json` and `tsconfig.test.json`) are clean.
- I ran the new test against the old selector and it fails there (`direct_webhook` instead of `polling`), so it does catch this bug.
- ESLint reported nothing because these test and source files aren't covered by its config ("File ignored" warnings only).

I checked the other places that set the intake. The selector in `flyIntake.ts` was the only place that kept an earlier intake without checking it, so nothing else needed changing. I found no separate problems.

There are no previews because nothing here is visible in a UI.

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

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

* chore: validate the same secrets in Fly dry-run as a real deploy

I fixed F19: `--dry-run` now validates the same secrets a real deploy would set. In the finding's case (own App, existing relay token, `GH_WEBHOOK_SECRET`, `GH_AUTH_MODE` unset), it now picks `GH_AUTH_MODE=app` and accepts `direct_webhook`. Before, it inferred relay auth and rejected the plan.

**What changed**
- **`flyRelay.ts`:** a new `plannedFlyRelaySecrets(plan, secrets)` returns the auth mode and, for Connect, the relay URL, for any plan that doesn't enroll a token. It makes no network calls. `resolveFlyRelaySecrets` now uses it too, so dry-run and real runs share one code path for these cases.
- **`deployFly.ts`:** a new `planFlyDryRunSecrets(prepared, generatedSecrets)` adds those secrets first, then runs the intake check, in the same order as a real deploy. The dry-run branch of `runDeployFly` calls it. Enrollment stays off in dry-run, and when a real run would enroll a token, the intake check is still skipped as before.

**Same defect elsewhere:** with Connect and an existing relay token, dry-run also left out the `PROPR_GH_RELAY_URL` a real run adds. The same change fixes that, and the new test covers it. I found no other dry-run path that validates different secrets from the real run.

**Test:** the new test in `flyRedeploy.test.ts` uses `--legacy-docker` with an own App and an existing relay token in three cases: intake left unset, explicit `direct_webhook`, and Connect. For each, it checks that the dry-run secrets exactly match what a real first deploy against a fake Fly app sets: `GH_AUTH_MODE=app`, `direct_webhook`, and a Machine env that passes the daemon's boot check. With the old dry-run logic put back, this test fails.

**Verification:** all 103 Fly deploy tests pass, and both CLI typechecks are clean. ESLint has no config that covers `packages/cli`, so lint didn't check these files.

Nothing visible changed, so there are no previews.

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

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

* feat: refuse Fly --idle-shutdown until the image supports it

I fixed F21. I did not fix F20, because the runtimes it needs don't exist on this branch or on its epic base yet.

**F21: idle shutdown is now refused.** The app image on this branch has no idle detector and no `/wake` route (nothing in `src/` or `packages/` reads `PROPR_IDLE_SHUTDOWN`). So `--idle-shutdown` only switched the restart policy to `on-failure` and printed a wake URL nothing serves, while the Machine kept running and billing.
- A new `assertFlyIdleShutdownSupported` check in `prepareFlyDeploy` (`packages/cli/src/commands/deployFly.ts:174`) runs right after the agent-runtime check. It stops a real run or a `--dry-run` before anything is written or sent to Fly, and the error says why and to deploy without the flag.
- The gate is one constant, `FLY_IDLE_SHUTDOWN_SUPPORTED = false`. Once #3770 lands in the image, setting it to `true` turns the existing idle-shutdown config back on. The summary lines for it can't be reached until then.
- I removed the claims that it works from the `--idle-shutdown` help text, the help example, the generated `fly.toml` comment ("ProPR decides when to stop instead"), the CHANGELOG, `propr-cli.md` and `deploy-fly.md`. In `deploy-fly.md` the section is now "Idle shutdown (not available yet)", and the cost section no longer tells Free-plan users to use `--idle-shutdown`.
- I added a test in `deployFly.test.ts` that covers the bare flag as commander parses it, `15m`, a dry run, and a malformed duration. It also checks that without the flag both generated configs stay always-on. I dropped the `idleShutdown` case from the browser sign-in test, because that case now hits the idle refusal first.

**Checks:** all 104 Fly deploy tests pass, and the new test fails when the check is removed. The CLI typecheck is clean, and the docs build passes with the new anchor resolving. Running the real CLI with `--idle-shutdown --dry-run` exits 1 with the new message and writes no files; without the flag, a dry run writes `policy = "always"` and `min_machines_running = 1`.

**F20 (Docker-free deployment) is blocked, not fixed.** The review's fix is to "land the required runtime support", which is #3764 (Sprites) or #3767 (Fly Machines). Both are still open with no PR. Comparing this branch with the epic base shows only #3758, #3759, #3760 and #3761 merged there, and none of them adds those runtimes. They also depend on the AgentRuntime interface (#3773), which is on the epic base but not on this branch. Writing a runtime here would duplicate those issues and conflict with the base, and I can't test it against a live Sprites or Fly account. As the finding asks, unsupported runtimes are still refused. To clear F20 once one of those runtimes merges into the epic:
1. Update this branch from the base.
2. Add the runtime to `FLY_WORKER_AGENT_RUNTIMES`.
3. Check a real deploy with it.

I made no preview images, because the change is CLI and docs text only.

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

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

---------

Co-authored-by: propr-dev[bot] <1316198+propr-dev[bot]@users.noreply.github.com>
propr-dev Bot pushed a commit that referenced this pull request Nov 24, 2026
F21 is addressed. The unrelated runtime, credential, workspace-transport and compute-accounting code is gone from this PR, and every check I ran is green.

**What was wrong.** The last commit on the branch, "fix: stop the whole Fly Machine on idle shutdown", could not merge the epic base branch because the git directory is read-only, so it copied the epic's files into the working tree instead. GitHub diffs a PR against the merge-base, so the copied files from five epic PRs showed up as content of this PR: the AgentRuntime interface and DockerRuntime adapter (#3773), clone-in-sandbox workspace transport (#3776), the per-run credential broker and provider manifests (#3777), restricted network mode as a runtime capability (#3778), and compute usage accounting with its migration, cost export, MCP and task UI consumers (#3783).

**What I changed.** I classified all 242 files in the diff against the merge-base by comparing blobs with the epic branch and attributing each copied file to the epic commit that produced it.

- 132 files that were byte-identical copies from those five epic PRs were reverted to the merge-base: 55 new files deleted, 77 modified files restored. This includes the files the finding names and all of their consumers and tests.
- Three mixed files that carried both idle-shutdown edits and copied epic hunks were rebuilt as merge-base plus this branch's own changes with a three-way merge, with no conflicts: the OpenAPI spec, the generated client types, and the core package index. The core index now adds only the two idle-shutdown exports.
- I kept the `propr deploy fly` files from #3775 and the all-in-one process changes it made. The branch's deployment enablement (the `--idle-shutdown` flag, the Machine stop token, Fly stop integration) edits those files and imports them, so they are demonstrably necessary and fall under the retained scope. They remain in the diff as whole-file additions until ProPR merges the epic base into the branch, at which point they collapse to this branch's own edits.

The PR diff against the merge-base went from 242 files and about 23,500 insertions to 110 files and about 12,500 insertions, of which 300 lines are the OpenAPI spec and most of the rest are idle-shutdown source, docs and tests.

**Verification.** I deleted the core and shared `dist` directories before rebuilding so the stale compiled epic modules and the copied migration could not survive in the build output. Then:

- typecheck: root, core, api, cli, client and web UI all pass
- lint: root, core, api, cli and web UI all pass with zero warnings
- OpenAPI generation check and client contract check pass
- CLI node tests for deploy-fly, idle check and GitHub app commands: 181 pass
- root tests for idle shutdown, all-in-one config, Fly host stop, orchestrator profile and the Ultrafix sweep: 86 pass
- root tests covering files restored to the merge-base (worker agent preparation, native goal launch, LLM metrics, OpenCode log, agent versions, MCP grant client): 57 pass
- API tests for idle routes, status, cost export, admission, MCP surface and OpenAPI conformance: 101 pass
- core idle detector, signals, controller and antigravity config tests: 101 pass
- web UI unit tests for TaskDetails and SettingsPage: 864 pass

**Independent observation, not acted on.** The all-in-one process and its config still carry the epic's startup abort signal and the shutdown timeout setting from #3775, merged by the previous commit. They are not among the four features F21 names, and separating them would conflict with the kept Fly stop code, so I left them. When ProPR merges the epic base, the deploy-fly files and the all-in-one files will show add/add or content conflicts; this branch's versions should be kept in each case.

No visual preview was created: this change only removes code and nothing new is visible in the UI.

PR: #3772
Comment by: @propr-ultrafix (ID: 0)
Model: Claude Fable 5.1

ProPR-Agent: claude/claude-fable-5-1
integry pushed a commit that referenced this pull request Nov 24, 2026
…ol plane (#3772)

* feat: add opt-in idle shutdown and wake for the control plane

I've added opt-in idle shutdown for the control plane. It is off by default, so nothing changes unless an operator turns it on. The new tests and the existing suites I re-ran pass, and lint, typecheck and the OpenAPI check are clean. Nothing has been tried on a real deployment: no actual stop and wake on a Fly Machine or under systemd, and no run against a live Connect relay.

Setting. `PROPR_IDLE_SHUTDOWN=off|on` and `PROPR_IDLE_SHUTDOWN_AFTER` (`1m` to `24h`, default `15m`). It can be set in `.env` or in a new Web UI section, Settings → Maintenance → Idle shutdown, for instance admins. If either variable is set in the environment, it wins and the Web UI shows it read-only. A typo in `PROPR_IDLE_SHUTDOWN` never turns it on; it shows up as a warning instead.

What keeps the instance awake. The daemon checks every 30 seconds. Each blocker below is named in the status, so you can see why it isn't stopping:
- jobs waiting, paused or running in any BullMQ queue (all queues found in Redis, not a fixed list).
- active agent runs, running goals, follow-up handoffs still owned by a worker, and Ultrafix loops waiting on CI.
- open Web UI sessions and in-flight MCP or HTTP requests; the API publishes these to Redis, and any request restarts the idle period.
- Connect deliveries not yet acknowledged.
- scheduled work due within the idle window: automations, deferred automation runs, delayed jobs, Ultrafix retries and polling.

A signal that can't be read counts as busy, so it fails safe.

How it stops. In order: send the wake hint to Connect, stop intake so in-flight deliveries finish and get acknowledged, then check once more. If work arrived during the drain, it reconnects and stays up. Otherwise it writes the wake hint to `<DATA_DIR>/idle-wake-hint.json` and records the shutdown. It then tells the API, workers and indexing worker to run their normal shutdown, closes Redis and SQLite, flushes logs and exits with code 0.

How it wakes. There is a new public `POST /wake` endpoint for the Connect wake ping; it only records that it was called. On start, the daemon asks Connect once to replay deliveries cached while stopped. It records what woke it (HTTP request, Connect ping, schedule, or unknown) and the cold-start time, and marks the hint file as used so a later plain restart isn't counted as a wake. Missed automation slots already collapse into one run at startup, so scheduled work resumes at most once.

Where to see it. `propr check`, the `idleShutdown` field of `GET /api/status`, `GET/PUT /api/admin/idle-shutdown`, the Settings section, and daemon log lines for each stop, wake and aborted drain.

Things you should know before merging:

- Connect replay is not automatic today. The current relay keeps deliveries for a disconnected instance (free: newest 25 for 1 hour; paid: 500 for 24 hours) but replays them only through `POST /v1/replay`, one delivery at a time, with an OAuth or installation token. Automatic replay on reconnect is part of propr-routing#335. To cover both cases, ProPR sends a `replay` frame after an idle wake, and duplicate deliveries are already dropped by delivery ID.
- The two new Connect frames are my own names. `wake_hint` (`{type, reason, nextDueAt}`) and `replay` (`{type, reason, since}`) are not yet agreed with propr-routing#335, so check them against what that issue settles on. They are sent only during an idle stop or wake, and a relay that doesn't know them just answers with an error frame, which is logged. I didn't add them to the hello's capability list, because existing tests pin that list exactly.
- Polling intake never goes idle. The next poll is always within the window. `propr check` warns about this.
- The bundled `docker-compose.yml` defeats it. Its services use `restart: unless-stopped`, so an exit with code 0 restarts immediately. The docs say to use an `on-failure` restart policy (Fly, systemd).
- `propr deploy fly` (#3768) doesn't exist yet. The new docs page gives the `fly.toml` settings by hand: `auto_stop_machines = "off"`, `auto_start_machines = true` and restart policy `on-failure`. That page is `docs/docs/operations/idle-shutdown.md`, which also covers systemd, the 5–10 s cold start and troubleshooting.
- Uptime monitors keep it awake. Only `/health` and `/wake` are ignored, so a monitor polling `/api/status` will stop it from ever going idle.

Most of the new code is in `packages/core/src/idle/`, `src/daemon/idleShutdown.ts` and `idleSignalSources.ts`, plus new API, Web UI and `propr check` files. I also updated the generated OpenAPI spec and client types, the configuration reference, settings locations, `.env.example` and the changelog. To make the new section show up, I updated a test mock in `demoViewer.test.tsx` and the Maintenance category description and guide.

Tests added:
- detector unit tests for each signal, plus config parsing.
- controller integration tests showing a queued job, an open UI session or a due schedule prevents shutdown, and covering an aborted drain and the default-off case.
- collector tests against fake Redis and SQLite.
- a restart-recovery test (replay request, wake source, hint consumed once).
- API route and `/wake` tests, a `propr check` test, Web UI component tests and a Playwright test.

I also captured desktop and mobile screenshots of the new Settings section.

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

* chore: use shared date formatter in idle shutdown settings

I fixed the Shard 3/4 failure. The new Idle shutdown settings section formatted its timestamps with `date.toLocaleString()`. A guard test (`src/utils/dateFormat.guard.test.ts`) requires every timestamp in the UI to go through the shared formatter in `utils/dateFormat.ts`, so it failed.

**Fix:** in `propr-ui/src/pages/SettingsPage/IdleShutdownSection.tsx`, the section's time helper now uses the shared `formatDateTime`. Empty values still show `—`, and a value that isn't a valid date is still shown as the raw string.

**Checks:** the guard test and the section's own tests pass (6 of 6), and eslint with zero warnings and the `propr-ui` typecheck are clean. I didn't re-run the full shard.

**Visible change:** times in the section ("Stops at", next scheduled work, last idle shutdown, last wake) now use the app's standard date format, e.g. `Nov 24, 2026, 1:26:00 AM`. Before, the format depended on the browser's locale. That's the only difference, so I didn't capture new screenshots; the existing previews still show the section correctly.

PR: #3772
Comment by: @propr-dev[bot] (ID: 7119096429)
Model: Claude Opus 5.5

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

* chore: require relay and process acks before idle-stopping daemon

All five findings (F1–F5) are fixed. With today's Connect relay, an instance on Connect intake will now never idle-stop. That follows from F1: the relay has to acknowledge the wake hint, and the current relay doesn't. The new ack frames (`wake_hint_ack`, `replay_ack`) are names I made up, like `wake_hint` and `replay` before them, so they need to be settled in propr-routing#335.

The new and changed tests pass, and typecheck and lint are clean. Nothing was tried against a live relay or a real Fly/systemd stop.

**F1 – relay acceptance.** Sending a frame no longer counts as acceptance.
- **Shutdown:** before stopping anything, the daemon sends `wake_hint` and waits up to 10 s for `wake_hint_ack` on the same socket. With no ack it stays up with intake untouched. The status then shows `could not read Connect idle wake support`, which clears on the next reconnect.
- **Wake:** a stop with Connect intake writes `connectReplay: "pending"` into the hint file. On the next start it only becomes `accepted` after a `replay_ack`. If the relay doesn't answer, or Connect intake isn't running, it stays pending and the next start asks again. A socket that drops before the answer is retried on the next connection.
- **Other intake modes:** the hint file is still the wake arrangement, and F5 now guarantees it gets written.

**F2 – missing activity.** Every API, worker and indexing-worker process now registers in Redis and sends a heartbeat every 15 s. A registered process whose heartbeat is missing, older than 45 s or malformed blocks shutdown as unavailable. For API processes the same applies to their activity record. Partial records are no longer read as zero. Only two things count as "confirmed stopped":
- the process removed its own entry on a clean stop, or
- the daemon sees the pid is gone on the same host, boot and pid namespace.

**F3 – producers.** After the relay accepts, the daemon stops Connect intake and asks each API process to quiesce. New requests get `503` with `Retry-After: 5` and still count as activity, then each API process waits up to 10 s for its in-flight requests and confirms. The daemon gives the API processes up to 30 s to confirm. Only after that does it check again. If work or a request shows up, it withdraws the request: the API admits requests again and Connect reconnects.

**F4 – lost broadcast.** The drain request is now stored in Redis and refreshed for the whole drain. Processes read it every 5 s and on every reconnect, and each one acknowledges it. The daemon exits only when every registered process has acknowledged or is confirmed stopped. Until then it stays up, keeps re-announcing, and logs which processes it's waiting for. A failed subscribe is logged, and the process falls back to polling. The daemon clears a leftover request at startup, so processes starting after a crash aren't stopped.

**F5 – hint write failure.** If the hint file can't be written, the drain aborts: intake resumes and no stop request is sent. Each write now uses its own temp file name, because two writes in one process could collide (a test run hit this).

**Other changes:**
- Workers now deregister at the end of their shutdown, and the indexing worker now deregisters after its jobs drain instead of first.
- The docs page and changelog describe the new order and the ack contract.

**Tests:** a new daemon drain test covers relay not acking, a request arriving during quiesce, the hint write failing, a worker that never acknowledges (daemon doesn't exit), and the full ordered stop. A new core test covers stale and malformed registrations, the stop request reaching a process after it reconnects, quiesce/resume, and the relay ack exchange. I also updated the recovery, collector and API middleware tests. The existing routing intake, protocol and delivery-interest suites still pass (82/82).

**Not fixed (outside F1–F5):** the daemon's own timer sweeps (Ultrafix resume, auto-merge, merge-conflict and others) aren't paused before the final check. One that runs during the drain could queue a job after the check. The job stays in Redis and runs on the next wake, but nothing triggers that wake. Pausing and restarting those timers would mean restructuring how `daemon.ts` creates them.

The UI doesn't change visibly, so there are no previews.

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

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

* fix: collapse routingService stop in daemon close to one line

I fixed the Validate Changes failure. The core lint step failed because `src/daemon.ts` had 401 code lines, one over the 400-line `max-lines` limit, and the gate allows zero warnings.

In the daemon's `close()` handler, I turned the three-line `if (routingService) { await routingService.stop(); }` into one line, the same style as the `routingStatusPublisher` stop right below it. Nothing else changed.

`eslint src/ --max-warnings 0` now passes locally. Every other stage in that CI run had already passed, so I only re-ran the core lint. There's no visual change, so I made no previews.

PR: #3772
Comment by: @propr-dev[bot] (ID: 7120562264)
Comment by: @github-actions[bot] (ID: 7120562560)
Model: Claude Opus 5.5

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

* chore: skip idle-shutdown status reads in propr check when unneeded

I fixed the Shard 4/4 failure. It was a real failure caused by this PR, not a flaky test.

**Cause.** Only one of the shard's 283 test files failed: `packages/cli/src/commands/githubAppCommands.test.ts`, test 67. That test requires a plain `propr check` (without `--verify`) to make no network requests. The new idle-shutdown row in `propr check` read `/api/status` on every run. The CLI client retries a failed read, so the stopped test backend got three `http://localhost:4000/api/status` calls. The same thing would make every `propr check` on a stopped stack pause for about a second.

**Fix.**
- `packages/cli/src/commands/idleShutdownCheck.ts` now reads the daemon's live status only in two cases:
  - idle shutdown is turned on in the environment.
  - the stack uses Connect (`routing_websocket`, the default intake).
- In the Connect case, the routing check already reads `/api/status` anyway. In `checkCommands.ts` both checks now share one read, so a stopped backend is contacted at most once per run, not once per check.
- A direct-webhook or polling stack that hasn't set idle shutdown in the environment no longer contacts the backend during an ordinary check. That is the case the failing test covers.

**Trade-off.** If a direct-webhook stack turns idle shutdown on only in the Web UI, `propr check` won't show its live status (blockers, last stop, last wake). The offline row still says the setting is off unless turned on in Settings → Maintenance → Idle shutdown. On default (Connect) stacks and stacks that set the environment variable, the live rows still appear.

I added a test in `idleShutdownCheck.test.ts` that checks when the status is read and when it isn't.

**Verification.**
- `githubAppCommands.test.ts` and `idleShutdownCheck.test.ts` pass (72 tests), including the test that failed in CI.
- `checkCommands.test.ts` and the other CLI suites that call these checks pass (setup, image presence, desktop local setup, host actions).
- The CLI typecheck is clean.
- ESLint has no config for `packages/cli`, so those files aren't linted.

I didn't create a preview because nothing visible changed.

PR: #3772
Comment by: @propr-dev[bot] (ID: 7120913160)
Model: Claude Opus 5.5

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

* test: expect Idle shutdown section in 390px Maintenance e2e test

I fixed the failing Playwright check. The 390px test in `propr-ui/e2e/held-followups.pw.ts` was written before this PR added the Idle shutdown section. It expected the Maintenance panel to hold only the Held follow-ups and Instance data sections, so the new section broke it. That section is meant to be there, so I updated the test rather than the UI.

- **Change:** the expected section order at `propr-ui/e2e/held-followups.pw.ts:90` is now `['maintenance', 'instance-storage', 'idle-shutdown']`. The test still checks that Held follow-ups comes first, and I updated the comment above it to match.
- **Verification:** all 3 tests in `held-followups.pw.ts` pass locally, including the 390px one that failed in CI. I also ran the other Playwright specs that open the Maintenance tab (`idle-shutdown`, `instance-storage`, `settings-layout`), and all 15 of their tests pass.

I didn't create preview images because this only changes a test, so nothing looks different to a user.

PR: #3772
Comment by: @github-actions[bot] (ID: 7121365279)
Comment by: @propr-dev[bot] (ID: 7121365474)
Model: Claude Opus 5.5

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

* fix: fix idle shutdown in all-in-one and stale stop requests

I've fixed F6, F7 and F8. The idle, all-in-one and route suites pass (85 tests), and typecheck and the zero-warning lint pass. Each new regression test fails when its fix is reverted. As before, none of this has been tried on a real deployment.

**F6: idle shutdown now works in all-in-one.** It is connected to the all-in-one process's normal shutdown instead of being skipped.
- `src/allInOne.ts` marks the process as all-in-one and passes its existing graceful shutdown to `startDaemon` as `idleShutdownStop`. That is the same code a signal runs: it closes components in the usual order and exits 0 (1 if any component failed to close).
- `src/daemon.ts` now starts the idle controller in that case too.
- When stopping, the API, worker and inline indexing worker in that process only acknowledge the stop request instead of each sending SIGTERM. Several signals at once used to make the process exit immediately with code 1.
- After every acknowledgement the daemon runs that one shutdown, and it skips waiting for its own in-process components to deregister. An indexing worker run separately (`PROPR_INDEXING=separate`) still stops itself as before.

**F7: a leftover stop request no longer stops a newly started process.**
- A stop request now lists the processes registered when it was sent, by name and start time.
- A process only acts on a stop that lists it with its own start time. So a restart that reads a request left behind by a crashed daemon keeps running, even under the same name (a container restart often reuses the pid).
- An original process that just reconnects still matches and stops.
- The daemon now waits only for the processes it listed. The "stop admitting requests" step is unchanged, so an API started during a drain still pauses requests.

**F8: a replay still owed is no longer lost when the instance stops again.**
- Before writing a new wake hint, the daemon reads the current one. If an earlier replay is still `pending`, the new hint stays `pending` and records `replaySince`, the earlier stop's time. On the next start, the replay request asks for everything since then.
- **Related gap I also closed:** wake recovery runs alongside the idle checks, so it could overwrite a newer stop's hint with stale data. Reads and writes of the hint file are now done one at a time, and recovery only updates a hint from the same stop.
- If Connect accepts the older replay after a newer stop has replaced the hint, the newer hint stays `pending` for its own stop's deliveries.

**Tests and docs:**
- **New tests:** a stop request ignored by a process started afterwards (including one reusing the same name), the all-in-one stop path with no SIGTERM, the replay cursor kept across a second stop, and recovery not overwriting a newer stop's hint.
- **Updated tests:** the existing stop-request tests now list their target processes, and the all-in-one source check expects `idleShutdownStop`.
- **Docs:** `docs/docs/operations/idle-shutdown.md` now covers all-in-one behaviour, targeted stop requests and `replaySince`.

There's no visual change, so I made no preview.

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

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

* chore: replay missed deliveries after drain and block idle on poll

I've fixed F9, F10 and F11. The idle, all-in-one, route and `propr check` suites pass (91 tests), and root and core typecheck and the zero-warning lint pass. I reverted each fix in turn, and every new regression test failed without it. As before, none of this has been tried on a real deployment or against a live Connect relay.

**F9: deliveries cached while a drain has intake disconnected can now be replayed.**
- The daemon notes the time just before it stops Connect intake. That time is saved in the wake hint as `intakeStoppedAt`, and replay now starts from there instead of from `shutdownAt`. A replay still owed from an earlier stop keeps that earlier start time.
- **On a successful stop:** the next start asks for everything since `intakeStoppedAt`, so a delivery that arrived during the drain is included.
- **On an aborted drain:** if intake had already been stopped, the daemon first writes a pending replay to the hint file. That hint has `wokeAt` set, so the next plain start isn't counted as a wake. Then it reconnects and asks Connect for that replay.
- The replay stays `pending` until Connect acknowledges it. If Connect refuses, or intake stops before it answers, the next drain carries the start time forward and the next start asks again.
- The replay bookkeeping moved into a new file, `src/daemon/idleReplayObligation.ts`. When Connect accepts an older replay after a newer stop has replaced the hint, the newer stop still owes its replay from its own disconnect time.

**F10: polling intake now always blocks idle shutdown.**
- It no longer reports a poll deadline worked out from the time of each check. The blocker reads "GitHub polling intake … never idles", whatever `POLLING_INTERVAL_MS` is.
- It adds nothing to `nextDueAt`, so no made-up poll time reaches the wake hint.
- The now-unused `pollingIntervalMs` input to the idle code is gone.

**F11: a setting that can't be read no longer allows a stop.**
- On a failed read, that check does not stop the instance and the idle period starts over.
- The status still shows the last known setting, with the blocker `could not read the idle shutdown setting`.
- I also made the last check before stopping read the setting again. If that read fails, or the setting was turned off or its window changed, the stop is cancelled. This closes the same gap for a read that fails between that check's first read and the stop.

**Tests and docs:**
- **New tests:**
  - **Drain:**
    - the replay start time is taken before intake disconnects.
    - an aborted drain records the replay, requests it and marks it `accepted` once acknowledged.
    - a refused replay stays `pending` and keeps the earlier start time.
    - no replay is owed when intake was never stopped.
  - **Recovery:** the replay starts at `intakeStoppedAt`, and a newer stop keeps its own start time.
  - **Controller:** an unreadable setting blocks the stop and restarts the idle period, and the last check reads the setting again.
  - **Polling:** a new `test/idleSignalSources.test.ts` covers a 1-hour poll interval with a 15-minute window, and the polling detector test was updated.
- **Updated tests:** two existing abort tests now also expect the replay request after intake reconnects.
- **Docs:** `idle-shutdown.md` and the changelog cover the replay start time, replay after an aborted drain, the unreadable setting and polling.

**Found separately (not changed):**
- The replay start time comes from this instance's clock, but Connect applies it. Any clock difference between the two moves the replay start. Nothing on the ProPR side can make that exact, so I didn't try.
- If a drain begins while the replay requested at startup is still waiting for Connect's answer, stopping intake cancels that request. It is still recovered, because the request stays `pending` and the next stop carries its start time.

There's no visual change, so I made no preview.

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

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

* chore: acknowledge idle quiesce only after activity is published

I fixed both findings. Each new regression test fails on the old code and passes with the fix.

**F12: quiescence is only acknowledged after the activity record is published**
- `packages/api/idleShutdownIntegration.ts`: the API's quiesce callback now throws when `publisher.publish()` returns `false`. Before, it only logged the failure and carried on.
- `packages/core/src/idle/idleShutdownListener.ts`: the listener now records separately when the quiesce callback has finished successfully. It only acknowledges after that. A failed callback is not acknowledged and runs again on the next poll (every 5 s). The API keeps refusing new requests in the meantime. If publication keeps failing, the daemon's existing 30 s quiesce timeout aborts the drain. Withdrawing or replacing the drain request clears the new state.
- I checked the other places this could happen. Workers don't take part in quiesce. The stop phase and the composed (all-in-one) path don't depend on this publication. The daemon only re-checks activity after it has an acknowledgement, so it can no longer re-check against an older record.
- New tests:
  - `packages/core/test/idleShutdownCoordination.test.ts`: a callback that keeps failing is retried and never acknowledged, then acknowledged once it succeeds, and not run again after that.
  - `packages/api/test/idleShutdownRoutes.test.ts`: this follows the finding's scenario. Writes to the activity key are rejected while acknowledgement writes still work, and a Web UI session opens. The daemon gets no acknowledgement and the old quiet record stays. Once writes recover, the retry publishes `uiSessions: 1` and acknowledges.
  - An earlier test in that file left a request in flight, which held the API's drain wait at 10 s. That hid the old behaviour, so my first version of the test also passed on the old code. That test now closes its request, and the new test checks nothing is in flight before it starts.

**F13: `propr check` now reads the live status for every intake mode**
- `packages/cli/src/commands/idleShutdownCheck.ts`: I removed the rule that skipped the status read unless idle shutdown was on in the environment or the stack used Connect. The read is still the shared one with a 1 s timeout. If it fails, only the row from the environment setting is shown.
- `idleShutdownCheck.test.ts`: I replaced the test that asserted the request was skipped. New tests cover:
  - Idle shutdown turned on in Settings with the environment unset, for both `direct_webhook` and `polling`. The live rows appear, and the polling-intake warning appears only for `polling`.
  - A failed read, which falls back to the environment row in every intake mode.
- The docs already say `propr check` shows the effective setting, so they needed no change.

**Checks run:** the idle suites (drain, recovery, signal sources, detector, controller, coordination) plus `statusRoutes` gave 119 passed, 0 failed. The API route tests passed 10 of 10 and the CLI tests 7 of 7. Core and CLI typechecks pass, and the API test file typechecks with a temporary tsconfig. Lint is clean on the changed core and API files; the CLI files and core test files aren't covered by any lint config. I rebuilt the core `dist` because the API tests import from it.

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

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

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

* test: limit GitHub app test to GitHub requests, not backend status reads

Both CI failures are dealt with. The real one was caused by this PR and is fixed; the other is a CI stall that I can't reproduce here and can't change in code.

**Shard 4/4: `packages/cli/src/commands/githubAppCommands.test.ts` (real failure).** The last commit (F13) made `propr check` read the backend's live idle-shutdown status in every intake mode. That review fix reversed the earlier fix, which had kept this test passing. On a stopped test backend the client retries, so a plain `propr check` made three requests to `http://localhost:4000/api/status`. The test asserted that a plain check makes no requests at all.

Its own message says what it is really guarding: a plain check must not mint a token or contact GitHub. A best-effort read of your own local backend does neither. Connect stacks already did that same read before this PR. So I kept F13's behaviour and narrowed the test:
- In `packages/cli/src/commands/githubAppCommands.test.ts`, the fake `fetch` now records only `https://api.github.com/` requests. Any other URL behaves as if the stack is stopped.
- The checks are unchanged: a plain check makes no GitHub requests, `--verify` makes exactly three installation requests, and a key path that exists only inside the container makes none.

I confirmed the test failed with the old code, and the error showed those three `/api/status` reads. `githubAppCommands.test.ts`, `idleShutdownCheck.test.ts` and `checkCommands.test.ts` now pass: 83 tests, 0 failures.

**Shard 1/4: `test/epicPRService.test.ts` timed out at 180 s (not caused by this PR).** This file tests a few branch-name helpers imported directly from `packages/core/src/services/epicPRService.ts`, and this PR doesn't touch it. It runs all 79 tests in about 1.3 s here, every time across four runs, and exits cleanly. The 180 s timeout looks like the shard stalling rather than a problem in the code, so I made no change for it. If it fails again, re-running the shard should clear it.

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

PR: #3772
Comment by: @propr-dev[bot] (ID: 7123629768)
Comment by: @github-actions[bot] (ID: 7123651719)
Model: Claude Opus 5.5

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

* chore: persist Connect replay obligation before intake disconnect

I fixed F14: the daemon now saves the Connect replay obligation to the wake hint file before it disconnects intake. If it crashes mid-drain, the next start asks Connect to replay everything cached since just before the disconnect. The drain and recovery tests (24) and the signal-sources tests pass, and typecheck and lint on `src/daemon` are clean. I tested this with fakes and a real hint file in a temp directory only, not against a live Connect relay.

**What changed in the drain** (`src/daemon/idleShutdown.ts`)
- A new step, `disconnectIntakeOwingReplay`, notes the disconnect time, writes the pending replay record, and only then calls `routing.stop()`.
- If that write fails, the drain aborts with intake still connected, so the relay caches nothing and nothing is owed.
- The record is marked so it doesn't look like a finished idle shutdown. Its reason is `idle drain in progress` and `wokeAt` is set, so the next start isn't counted as a wake. No last-shutdown record is written for it.
- If the drain succeeds, `persistStopHint` replaces this record with the final hint. If the drain aborts, the record is relabelled `idle shutdown aborted`.

**Earlier replay cursors** (`src/daemon/idleReplayObligation.ts`)
The new `recordDrainReplayObligation` keeps any replay cursor that is still owed. Saving the record early opened a new gap, which I closed in the same change:
- **The gap:** if a replay owed from an earlier wake was accepted by the relay during the drain, that acceptance would have cleared this drain's obligation too. The earlier replay doesn't cover deliveries cached after this disconnect.
- **The fix:** this drain's record carries the earlier cursor in `replaySince` but keeps its own `intakeStoppedAt`. `recordAcceptedReplay` now clears a record only when both `shutdownAt` and `intakeStoppedAt` match; otherwise it only drops the earlier cursor.

**Tests** (`test/idleShutdownDrain.test.ts`)
- **New:**
  - A crash right after the disconnect, starting from no hint file and from a used hint whose replay was already accepted. After restart, the replay is requested from before the disconnect, and it isn't recorded as a wake or a shutdown.
  - A crash that keeps an earlier owed cursor.
  - A failed record write, which leaves intake connected.
  - An earlier replay accepted mid-drain, which doesn't clear this drain's obligation.
- **Updated:**
  - The "hint file cannot be written" test now fails only the final write.
  - Tests that read the final hint now use the last write.
  - The test with an earlier owed replay now expects that replay's cursor to carry over into this drain's record.

With the old code put back, 6 tests fail: the two crash cases, the failed-write case, and the three updated tests. The other two new tests also pass on the old code; they protect the new design.

I also updated the drain order in `docs/docs/operations/idle-shutdown.md` and the changelog entry. Nothing in the UI changed, so there are no previews.

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

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

* chore: treat malformed idle-shutdown settings as unreadable, not absent

I fixed F15: a stored idle-shutdown setting that is valid JSON but has the wrong shape now counts as unreadable instead of absent. On an instance with `PROPR_IDLE_SHUTDOWN=on`, a value like `{"enabled":true,"afterMs":"invalid"}` no longer falls back to the default 15-minute window. The new and existing idle-shutdown tests pass (60 of 60), and typecheck and lint are clean.

**The fix**
- **`packages/shared/src/idleShutdown.ts`**: a new `readStoredIdleShutdownSetting` returns `null` only when nothing is stored, and throws when a setting is present but malformed. `resolveIdleShutdownConfig` now uses it, so no caller of the resolver can quietly treat a malformed setting as missing. The old lenient parser is still there for other uses.
- **`packages/core/src/idle/idleShutdownSetting.ts`**: `loadStoredIdleShutdownSetting`, and through it `loadIdleShutdownConfig`, now throws on a malformed setting. The controller then treats it like any other unreadable setting: it doesn't stop, it starts the idle period over, it shows "unavailable" as a blocker, and the read just before stopping also refuses.

**Same defect elsewhere**
- **`GET /api/admin/idle-shutdown`** used to report a malformed setting as the default. It now returns 503 `SETTINGS_UNAVAILABLE`.
- **`PUT` on the same route**: because the loader now throws, a `PUT` would have failed with 503 every time, so a malformed setting could never be overwritten through the API. The route now reads the stored setting only when the request leaves `after` out and needs the stored window. A `PUT` that includes `after` replaces the bad value.

**Regressions added**
- **`packages/core/test/idleShutdownSetting.test.ts`** (new): uses a real temporary SQLite database. It covers an absent setting and a valid one, and six malformed shapes, each of which is rejected by both loaders even with the environment switch on. The main case is an environment-enabled controller with `afterMs: "invalid"`: it never stops across 40 minutes, then counts a fresh window once the setting is repaired.
- **`packages/core/test/idleDetector.test.ts`**: checks that the shared reader and resolver tell apart no setting, a valid one and a malformed one.
- **`packages/api/test/idleShutdownRoutes.test.ts`**: checks the 503 on `GET`, the 503 on a `PUT` without `after`, and that a `PUT` with `after` overwrites the malformed setting.

With the fix temporarily reverted, the three shared and core regressions fail as expected; I didn't do that check for the route test.

**Found separately, not fixed:** when `GET` fails, the Settings → Maintenance → Idle shutdown section disables its controls. An operator with a malformed stored setting therefore can't repair it from the Web UI, only through `PUT /api/admin/idle-shutdown` with `after` or by editing the database. That is outside F15.

There's no visible UI change, so I didn't capture previews.

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

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

* fix: bound all-in-one shutdown so SIGTERM and idle stop exit

Yes, this PR's idle exit went through the same handler and hung the same way. It now ends in a bounded `process.exit(0)` on both SIGTERM and idle shutdown, and I checked both against a real all-in-one process.

**Cause.** I reproduced it first. I ran `src/allInOne.ts` against a local Redis and sent SIGTERM. It logged "all-in-one received SIGTERM, shutting down gracefully..." and was still polling a minute later.

- The worker's startup (`prepareAgentRegistryAtStartup`) loops until the agent image is ready. Here, as on a Machine where the image never becomes ready, that never happens, so the worker never finishes starting.
- The shutdown first waited for any component still starting, so it never got as far as closing anything or exiting.
- The idle stop in all-in-one (`idleShutdownStop` → `closeAndExit`) uses that same shutdown, so it would have hung too. I saw the hang only for SIGTERM; for the idle stop I'm going by the shared code.

**Fix.**
- **Startup wait:** a component still starting gets 10 seconds, then the components that did start are closed without it (`src/allInOneConfig.ts`).
- **Exit deadline:** SIGTERM and idle stop now share one exit with a 30-second deadline. If shutdown hasn't finished by then, it logs the step it was still closing and exits 0. Logs are flushed first, with a time limit. A shutdown where a step fails still exits 1, as before.
- **Standalone daemon:** its idle exit is bounded the same way. If its close hangs or fails, it exits 0 after 30 seconds, since the stop is already recorded by then.
- **Not changed:** the standalone daemon's SIGTERM handler, which is the same as on `main`.

**Checks against the real process** (same setup, worker stuck starting):
- **SIGTERM:** exit code 0 after 10 seconds. The log shows the 10-second wait running out, then daemon, API and the shared queue closing.
- **Idle shutdown:** I set `PROPR_IDLE_SHUTDOWN=on` and `PROPR_IDLE_SHUTDOWN_AFTER=1m` with webhook intake, because polling never goes idle. After 60 seconds idle it drained, wrote the wake hint file, recorded the stop, closed every component and exited 0 on its own.

I couldn't test the case where the worker does start, because this container has no Docker. Nothing here ran on Fly, and I couldn't read item 4 of the #3775 comment because GitHub's rate limit was hit, so I worked from your description.

**Tests:** new tests cover the stuck component, a shutdown that never finishes (exits 0 once), the exit codes, both entry paths, and a hanging or failing standalone close. `allInOneConfig` (15) and the three idle-shutdown suites (17, 8, 2) pass, and lint and typecheck are clean.

The idle-shutdown docs and changelog now mention the 10- and 30-second limits. I also moved the log-flush helper into `src/shared/flushLogs.ts` so both exits use it. Nothing changes visually, so there are no previews.

PR: #3772
Comment by: @integry (ID: 7124662651)
Model: Claude Opus 5.5

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

* chore: pause daemon sweeps and honor wake time during idle drain

I fixed F16. The daemon now stops its own scheduling before the final check. It also no longer waits past the time it told Connect to wake it, and it doesn't exit 0 while work is still queued.

The finding was raised against an older commit (8b17ddb); the branch is 14 commits further on. I confirmed the bug was still there at the current HEAD by running the new tests against HEAD's drain code: the scenario from the finding hangs (the wait never ends) and the other new drain tests fail. With the fix they all pass.

**What changed**
- **Daemon sweeps pause before the final check (step 2).** These are the daemon's sweeps that queue work: scheduled automations and agent runs, Ultrafix resume, auto-merge, merge conflicts, epic progress retry and no-change recovery. They are paused, and the drain waits for any run already in progress. A sweep still running after 30 seconds aborts the drain. Any abort resumes them, and a resumed sweep never overlaps its earlier run. The pausable set is in the new `src/daemon/workProducers.ts`. Each scheduler now returns a stop function that waits for its current run. The merge-conflict sweep moved out of `src/daemon.ts` into `src/daemon/mergeConflictSweep.ts`.
- **The stop has to finish before the wake.** The wake time is the `nextDueAt` Connect accepted, or the one in the hint file. The wait for stop acknowledgements ends 60 seconds before it, which leaves room for the deregistration wait and the close. If a process still hasn't acknowledged by then, the stop is "called off":
  - the daemon withdraws the stop request, so a process that hasn't stopped keeps running.
  - it marks the hint file so the next start isn't counted as a wake (the owed Connect replay stays pending).
  - it exits with code 1. The on-failure supervisor restarts it, and that start runs the due automation.

  If the scheduled work is too close to leave time for the stop, the drain aborts before stopping anything. With nothing scheduled it still waits as long as it takes, as before.
- **One more work check after every process has stopped.** A job queued during the stop, an automation due before the arranged wake, or work signals that can't be read now call the stop off instead of exiting 0. This also catches a lagging process that queues work just before acknowledging.
- **All-in-one** passes the exit code through its coordinated close, so a called-off stop exits 1 there too.
- I updated the docs page and the changelog entry to match.

**Tests**
- New drain tests, including the finding's own scenario: one acknowledgement is held past an automation's due time, the daemon calls the stop off before that time, its scheduler queues nothing, and the late process keeps running after it reconnects. Other new tests cover the post-stop work check, the all-in-one exit 1, and pausing and resuming the sweeps.
- New unit tests for the producer set in `test/daemonWorkProducers.test.ts`.
- The related idle-shutdown suites (58 tests) and the neighbouring daemon suites (389 tests) pass. The drain file passed with four copies running at once.
- Root typecheck and the zero-warning lint pass.
- One type error remains in `test/idleShutdownDrain.test.ts` (a `recordAcceptedReplay` call); it was already there, and root tests aren't typechecked by the project config.

**Behaviour changes to know about**
- **Exit 1 only brings everything back if one supervisor runs the whole control plane** (all-in-one on Fly, or a single systemd unit). If each process is supervised on its own, processes that already exited 0 stay down.
- **The daemon's normal close now waits for each sweep's run in progress.** Before, only the agent run sweeps were waited for.

No visual preview: nothing in this change is visible in the UI.

**Separate problems I found but didn't fix**
- **API processes keep their own timers running while the drain waits.** The API's Ultrafix sweep and its delayed-reindex timer run until each API process stops. The delayed reindex isn't an idle signal at all, so it is never treated as scheduled work. The new post-stop check does catch any job these timers queue before the stop finishes.
- **A Connect wake ping can be lost during a long stop.** A `/wake` ping that reaches a still-running API during the stop is used up, and the daemon then exits 0. Step 5 also deletes the wake-signal key, which would discard a ping recorded between the intake disconnect and that step.

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

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

* chore: limit idle shutdown to all-in-one and enforce wake deadlines

I fixed F17 and F18. F17 uses the review's alternative fix: idle shutdown now only stops the single-process control plane (all-in-one). The idle suites, lint, typechecks and the OpenAPI check all pass; nothing was tried on a real Fly or systemd deployment.

**F17: separate services left stopped.** The daemon has no way to restart an API or worker that already exited with code 0. Making that work would need the processes to agree on exit codes through Redis, and some failure windows there can't be closed. I took the alternative instead:
- **Standalone daemon:** it never stops. It reports a new `separate_processes` blocker naming the reason.
- **All-in-one with a process outside it:** this covers `PROPR_INDEXING=separate` and any extra API or worker process. The instance stays up, and the blocker names that process.
- **Mid-drain:** if such a process registers while draining, the drain aborts before any component is asked to stop.

So a called-off stop exits the one process with code 1, and the supervisor restarts every component together.

The trade-off: the multi-container `full` profile and `PROPR_INDEXING=separate` lose idle shutdown. That profile's `restart: unless-stopped` already defeated it, and the Fly setup in the docs runs one process. Supporting separate processes again would need the cross-process restart described above. The blocker also shows in Settings and `propr check` while idle shutdown is off, as the other blockers do, so a full-profile operator sees up front why turning it on wouldn't stop the instance.

**F18: late acknowledgements missing the wake.**
- **Acknowledgements:** they must be read by `confirmBy`. A read still outstanding at the deadline isn't waited for, and one that finishes late doesn't count even if it saw every acknowledgement. `finishStop` checks this again.
- **Final check:** the deregistration wait and the last check for work must finish 30 seconds before the arranged wake, so the close still fits. If they don't, the stop is called off with exit 1.
- **Close:** the arranged wake is now a hard limit on the all-in-one close and on the standalone daemon close. A close still running when the wake comes exits 1, not 0, and the log flush only gets the time left before it.
- **Related gap:** right before the stop request is stored, the daemon re-checks that the wake is still far enough off, since writing the hint file and records takes time.

Other changes:
- The "last idle shutdown" record is now written only once the stop request is stored. Before, the existing "could not record the stop request" abort, and now the new aborts, would have left a record of a shutdown that never happened.
- I moved `stopDaemonProcess` into a new `src/daemon/idleStopExit.ts`, because the edits pushed `idleShutdown.ts` past the 400-line lint limit.
- The new signal value meant regenerating the OpenAPI spec and client types. I also updated the idle-shutdown docs page, the configuration reference, `.env.example` and the changelog.

**Tests added:**
- a late or hanging acknowledgement read, including one that answers after the clock has passed the deadline.
- the new blocker for a standalone daemon and for outside processes.
- an outside process registering mid-drain.
- a late acknowledgement and a hanging final check, both now ending in exit 1 before the wake.
- the wake passed to the all-in-one close as its exit deadline.
- both closes exiting 1 when the wake comes first.

I undid each fix in turn and confirmed its test fails on the old code: the late-acknowledgement case exits 0 there, and the hanging final check times out.

I ran the idle suites in `test/` and `packages/core/test/`, the all-in-one, API idle, status and OpenAPI tests, and the docs-manifest tests, not the full suite. There are no screenshots, since the UI code is unchanged.

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

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

* refactor: recheck wake after flush and bound drain cleanup before exit

Both findings are fixed, with regressions that fail on the previous code and pass now.

**F19, wake recheck after the flush.** Both exit helpers now check the arranged wake once more right before the actual exit. In `createBoundedExit` the final callback after the flush upgrades a chosen exit 0 to exit 1 when the wake has been reached, with an error log naming the cause. The standalone helper in `src/daemon/idleStopExit.ts` does the same after its flush. That helper gained an optional injectable flush so the crossing can be tested without timing luck. A called-off exit 1 and an exit 0 with no wake arranged are untouched by a slow flush.

**F20, bounded cleanup before the fallback exit.** In `callOffStop` the clean-up deadline is set before anything is attempted. The intent withdrawal and the hint-file update each get at most the close allowance, then the coordinated exit 1 goes ahead with them still outstanding. Each timeout is logged, noting the stored request expires on its own.

**Sibling occurrences of the same assumption, corrected.** Three other awaited Redis commands in the drain sat between a quiesced control plane and a bounded exit with no bound of their own:
- the intent withdrawal in the drain's abort path, before intake and the sweeps are resumed.
- the two informational writes right after the stop request is stored.
- the intent delete before the exit 0 close, which was bounded only when a wake was arranged.

All three now run under the same close allowance. Nothing else was changed.

**Tests added.**
- Bounded exit: a flush that resolves after the wake yields exit 1 with the new log line; exit 1 and unbounded exit 0 stay as chosen.
- Standalone daemon: same crossing through the injected flush, and the flush is only given the time left until the wake.
- Drain: Redis stops answering from the first stop-acknowledgement read onward. The stop is called off and exits 1 within the acknowledgement timeout plus the bounded clean-up and close, with the request left stored.

Verification: the two affected test files pass in full (51 tests), root typecheck passes, and lint on the three changed sources is clean at zero warnings. All three new tests fail against the previous sources.

Not visually perceptible, so no preview files were created.

PR: #3772
Comment by: @propr-ultrafix (ID: 0)
Model: Claude Fable 5.1

ProPR-Agent: claude/claude-fable-5-1

* chore: exit 1 when a hung daemon close reaches the arranged wake

I fixed the Shard 1/4 failure. It was a real bug in this PR's standalone-daemon idle exit, not a flaky runner.

**What failed.** The PR comment names `test/epicPRService.test.ts`, but that summary is from an earlier run. In the run you linked, the shard's test-output artifact shows one failing file: `test/idleShutdownDrain.test.ts`, test 30, "a standalone daemon close still running at the arranged wake exits 1, not 0". It got exit code `0` instead of `1`.

**Cause** (`src/daemon/idleStopExit.ts`). When the daemon's close hangs, it waits until the arranged wake time. It then decided whether to exit 1 by checking `Date.now() >= exitBy`. Node timers can fire about a millisecond before `Date.now()` reaches the target. When that happened, the check missed and the daemon exited 0 while still closing at the wake. That's exactly what the fix is meant to prevent: the process stops for good and the scheduled work never runs.

**Fix.** If the wake is the deadline that ended the wait, reaching it now counts as the wake. The daemon exits 1 regardless of what `Date.now()` reads. The all-in-one path (`createBoundedExit` in `src/allInOneConfig.ts`) already worked this way, so it didn't need a change.

**Verification:**
- A throwaway probe that makes the timer fire early reproduced the CI failure on the previous code (exit 0) and passed on the fix (exit 1).
- `test/idleShutdownDrain.test.ts` passed 32/32 in three runs. `idleShutdownRecovery`, `idleSignalSources` and `allInOneConfig` passed 31/31.
- Lint on the changed file and `tsc --noEmit` are clean.

**Other failures in the PR comment:**
- **`test/epicPRService.test.ts` timeout:** it tests only pure functions, none of its imports touch files this PR changes, and it passes in about 1.5 s locally. That looks like a CI pipe stall.
- **Shard 4 failure (`packages/cli/src/commands/githubAppCommands.test.ts`):** you didn't ask about it, so I haven't looked into it.

The change isn't visible in the UI, so there are no previews.

PR: #3772
Comment by: @propr-dev[bot] (ID: 7129221499)
Model: Claude Opus 5.5

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

* fix: stop the whole Fly Machine on idle shutdown

I've built the first option: on Fly, the idle stop now asks the Machines API to stop the whole Machine before the app exits. I also flipped `FLY_IDLE_SHUTDOWN_SUPPORTED` to `true`. The new and affected test files pass (runtime, daemon and CLI deploy), and typecheck, lint and the OpenAPI check are clean. Nothing has been run on a real Fly Machine yet.

**Why the first option.** Moving Redis under the app's supervisor wouldn't fix it: the cloudflared and legacy Docker containers would still keep the Machine `started`. A Machine stop works whatever containers it has.

**How the idle stop works on Fly.** It only applies when `FLY_MACHINE_ID` is set, so systemd and other hosts behave as before. The code is in `src/flyMachineStop.ts` and `src/allInOneConfig.ts`.
- After everything has closed, it sends `POST /v1/apps/$FLY_APP_NAME/machines/$FLY_MACHINE_ID/stop` to `http://_api.internal:4280`. It authenticates with the `PROPR_FLY_MACHINE_STOP_TOKEN` secret.
- If the API accepts, it exits 0. If Fly sends SIGTERM while that request is still open, it counts the stop as accepted and also exits 0.
- If the API refuses, doesn't answer within 10 s, or the scheduled wake time is reached first, it exits **1**. The app then restarts and the Machine stays reachable instead of sitting started but dead.
- A Fly Machine without the token never goes idle. The status shows a blocker saying the token is not set.
- For idle deploys the app container also gets `restart: on-failure` (10 retries), so that exit 1 really restarts it.

**`propr deploy fly`.**
- `--idle-shutdown` is accepted now.
- With flyctl, the first idle deploy creates an app-scoped token with `fly tokens create deploy --app <app> --name "propr idle stop"`. Redeploys keep it.
- The Machines API can't create tokens, and the `--token` you deploy with may cover the whole org, so it is never stored. With `--backend api` you pass an app-scoped token with the new `--machine-stop-token`. Without one, the deploy stops before uploading any secret.
- A stop token in the stack `.env` is never uploaded.

**Stop-contract tests** (`test/allInOneIdleHostStop.test.ts`). They spawn a real child process, with a local HTTP server standing in for `_api.internal:4280`:
- the API returns 200: exactly one POST to the right path with the token, then exit 0
- the server sends SIGTERM before answering: exit 0
- the API returns 401: exit 1, and the token is not in the output
- the API never answers: exit 1 at the timeout
- not on Fly: no request, exit 0

**Branch base.** `deployFly.ts` only exists on the epic branch, and I can't merge here because the git directory is read-only. So I copied the epic's files into the working tree. This commit therefore also carries the epic changes up to #3775.
- `src/allInOne.ts`, `src/allInOneConfig.ts` and their test truly conflicted: both sides had fixed the SIGTERM hang separately. I kept this branch's bounded exit and added the epic's startup abort signal and `PROPR_SHUTDOWN_TIMEOUT_MS`. The default drain limit is therefore now 50 s instead of 30 s. The epic's signal handler now goes through the same bounded exit, and its real-process SIGTERM test still passes.
- When GitHub merges the epic, `deployFly.ts` and the other deploy files I edited will show conflicts. Keep this branch's version of each.

**Not yet confirmed on Fly:**
- that a deploy token is allowed to stop the Machine through `_api.internal`
- that `fly tokens create deploy` prints the token on its own line starting `FlyV1`
- that Fly honours a `restart` setting on a single container inside a multi-container Machine

The next live test should cover all three. I also updated the docs (idle shutdown, deploy to Fly, configuration reference), the CHANGELOG and the help text. There are no previews, since nothing here is visible in the UI.

PR: #3772
Comment by: @integry (ID: 7129665619)
Model: Claude Opus 5.5

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

* chore: remove unrelated epic code copied into the idle-shutdown branch

F21 is addressed. The unrelated runtime, credential, workspace-transport and compute-accounting code is gone from this PR, and every check I ran is green.

**What was wrong.** The last commit on the branch, "fix: stop the whole Fly Machine on idle shutdown", could not merge the epic base branch because the git directory is read-only, so it copied the epic's files into the working tree instead. GitHub diffs a PR against the merge-base, so the copied files from five epic PRs showed up as content of this PR: the AgentRuntime interface and DockerRuntime adapter (#3773), clone-in-sandbox workspace transport (#3776), the per-run credential broker and provider manifests (#3777), restricted network mode as a runtime capability (#3778), and compute usage accounting with its migration, cost export, MCP and task UI consumers (#3783).

**What I changed.** I classified all 242 files in the diff against the merge-base by comparing blobs with the epic branch and attributing each copied file to the epic commit that produced it.

- 132 files that were byte-identical copies from those five epic PRs were reverted to the merge-base: 55 new files deleted, 77 modified files restored. This includes the files the finding names and all of their consumers and tests.
- Three mixed files that carried both idle-shutdown edits and copied epic hunks were rebuilt as merge-base plus this branch's own changes with a three-way merge, with no conflicts: the OpenAPI spec, the generated client types, and the core package index. The core index now adds only the two idle-shutdown exports.
- I kept the `propr deploy fly` files from #3775 and the all-in-one process changes it made. The branch's deployment enablement (the `--idle-shutdown` flag, the Machine stop token, Fly stop integration) edits those files and imports them, so they are demonstrably necessary and fall under the retained scope. They remain in the diff as whole-file additions until ProPR merges the epic base into the branch, at which point they collapse to this branch's own edits.

The PR diff against the merge-base went from 242 files and about 23,500 insertions to 110 files and about 12,500 insertions, of which 300 lines are the OpenAPI spec and most of the rest are idle-shutdown source, docs and tests.

**Verification.** I deleted the core and shared `dist` directories before rebuilding so the stale compiled epic modules and the copied migration could not survive in the build output. Then:

- typecheck: root, core, api, cli, client and web UI all pass
- lint: root, core, api, cli and web UI all pass with zero warnings
- OpenAPI generation check and client contract check pass
- CLI node tests for deploy-fly, idle check and GitHub app commands: 181 pass
- root tests for idle shutdown, all-in-one config, Fly host stop, orchestrator profile and the Ultrafix sweep: 86 pass
- root tests covering files restored to the merge-base (worker agent preparation, native goal launch, LLM metrics, OpenCode log, agent versions, MCP grant client): 57 pass
- API tests for idle routes, status, cost export, admission, MCP surface and OpenAPI conformance: 101 pass
- core idle detector, signals, controller and antigravity config tests: 101 pass
- web UI unit tests for TaskDetails and SettingsPage: 864 pass

**Independent observation, not acted on.** The all-in-one process and its config still carry the epic's startup abort signal and the shutdown timeout setting from #3775, merged by the previous commit. They are not among the four features F21 names, and separating them would conflict with the kept Fly stop code, so I left them. When ProPR merges the epic base, the deploy-fly files and the all-in-one files will show add/add or content conflicts; this branch's versions should be kept in each case.

No visual preview was created: this change only removes code and nothing new is visible in the UI.

PR: #3772
Comment by: @propr-ultrafix (ID: 0)
Model: Claude Fable 5.1

ProPR-Agent: claude/claude-fable-5-1

* fix: bound idle drain and retry failed stop acknowledgements

I've fixed F22, F23, F24 and F25. All 115 tests in the seven idle-shutdown suites pass, lint (zero warnings) and typecheck are clean for the root and `packages/core`, and each new regression test fails on the previous code. Nothing has been tried on a real Fly or systemd deployment.

**F22 / F24: a due time in the hint file no longer counts as a wake**
- **Detector:** without Connect intake, any scheduled work now keeps the instance awake, however far off it is. The status shows a `scheduled_work` blocker saying nothing would wake the stopped instance for it, so the drain never starts.
- **Drain:** the last check before stopping (`recheckBeforeStop`) also aborts in that case. The arranged wake is now Connect's acknowledged hint, or the hint file's due time only when an external wake is configured. Otherwise there is none, and the final check treats any future scheduled work as stranded.
- **New setting:** `PROPR_IDLE_SCHEDULED_WAKE=external` is for operators whose own scheduler, such as a systemd timer, starts the instance at the hint file's `nextDueAt`. The fix offers this as an option, and without it the systemd timer setup the docs describe would never stop. The docs, `.env.example`, the configuration reference and the changelog now say that `propr deploy fly` with direct webhook intake installs no such scheduler.

**F23: the drain is bounded until the stop request is stored**
- **One deadline:** everything from the Connect wake hint up to storing the stop request now shares one deadline (`drainTimeoutMs`, default 120s). That includes the last check for work, which is what the finding left hanging. If it expires, the drain aborts.
- **Bounded recovery:** the abort's own steps (withdrawing the request, the hint-file writes, reconnecting intake) are limited to the close timeout. If intake can't be restored, or was still disconnecting when the deadline hit, the daemon exits with code 1 so the supervisor restarts it, instead of running with intake down.
- **Pending stop request:** if storing the stop request itself doesn't finish in time, the stop is called off (exit 1) rather than resumed. A write that lands late could otherwise still be acknowledged.
- To stay under the lint limits I moved the abort and restore code into a new file, `src/daemon/idleDrainSteps.ts`.

**F25: a failed stop acknowledgement is retried**
- `handleStop` now marks the process as stopping and runs the shutdown only after the acknowledgement is written. If all three writes fail, the next poll or announcement tries again, and the shutdown still runs only once.

**New tests**
- **Detector and signal sources:** scheduled work beyond the idle window blocks when nothing would wake the instance, and doesn't block with Connect or with the external setting.
- **Drain (`test/idleShutdownDrain.test.ts`):**
  - Direct webhook intake with future scheduled work keeps running; with `externalScheduledWake` it stops with exit 0.
  - A last check left pending after the API quiesced aborts at the drain timeout. The API, the sweeps and intake (with its replay request) all come back.
  - An abort whose intake reconnect hangs ends in a bounded exit 1.
- **Coordination:** acknowledgement writes are refused for a while and then recover. The drain completes and the shutdown runs exactly once.

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

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

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

* fix: stop late drain steps from undoing restore and bound idle stop

I fixed F26 and F27. The drain suite passes 41/41 and the other idle suites pass 20/20 and 28/28. Lint and typecheck are clean for the changed source files. I also ran the six new regression tests against the previous code, and all six failed there.

### F26 — a drain that timed out could disconnect intake after it was restored
The drain now records that it has been abandoned, and does so before it starts restoring. A step still running past the drain deadline checks this after its write finishes and backs off. I found three places where a late step could undo the restore, and fixed all three:

- **Replay-obligation write** (`disconnectIntakeOwingReplay`): if that write lands after the abort, Connect intake is no longer stopped. This was the reported case.
- **Stop-hint write** (`persistStopHint`): a stop hint written late would make the next plain restart count as a wake. It is now skipped. If the write was already under way, it is marked as consumed afterwards.
- **Quiesce wait**: once the deadline passed, the wait kept polling and storing the withdrawn drain request again. That would quiesce the API again for up to two minutes. `waitForIdleAcks` now checks for cancellation before it re-stores, and the drain uses that check.

Pausing the sweeps and the last check for work make no late changes, so they need nothing.

### F27 — a stop with nothing scheduled could hang forever
- The default `stopConfirmTimeoutMs` is now 120 s instead of `null`. The type no longer accepts `null`, so the wait can never be unbounded. If not every process confirms in time, the stop is called off through the existing bounded path and the process exits 1.
- The final check for work is now bounded by the same timeout even when nothing is scheduled. If it times out, the stop is also called off with exit 1.
- I updated `docs/docs/operations/idle-shutdown.md`, which said the daemon waits as long as it takes.
- Three existing tests passed `null` for this timeout; they now pass 60 s, with the same intent.

### New tests (`test/idleShutdownDrain.test.ts`)
- Releasing the held replay-obligation write after the drain returned false leaves intake connected.
- A late stop-hint write leaves no hint that would count as a wake.
- The abandoned quiesce wait does not store the drain request again.
- With the production timings and a simulated clock, two cases end in a bounded exit 1: Redis going away during the stop wait, and a final check for work that never finishes.

### Separate findings, not changed
- **Late quiesce message:** if storing the drain request was the step that timed out, its announcement can still go out after the "resume" message. Commands on one Redis conne…
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