Skip to content

[3770 by Claude Opus 5.5] Opt-in idle shutdown and wake for the control plane - #3772

Merged
integry merged 31 commits into
3758-epic-runtime-abstraction-sc0from
3770/claude-opus-5-5-opt-in-idle-shutdown-and--20261124-0023-b3m
Nov 24, 2026
Merged

integry merged 31 commits into
3758-epic-runtime-abstraction-sc0from
3770/claude-opus-5-5-opt-in-idle-shutdown-and--20261124-0023-b3m

Conversation

@propr-dev

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

Copy link
Copy Markdown
Contributor

AI Implementation Summary

Closes #3770

Branch: 3770/claude-opus-5-5-opt-in-idle-shutdown-and--20261124-0023-b3m
Commits: ✅ Changes committed (8b17ddb)


AI Processing Completed

Execution Details:

  • Issue: Opt-in idle shutdown and wake for the control plane #3770
  • Repository: integry/propr
  • Status: Success
  • Execution Time: 42m 38s
  • Tokens used: 42.27M tokens [42.14M input + 133.89K output]
  • API cost: $12.71
  • Timestamp: Nov 24, 2026, 1:06 AM UTC
  • LLM Model: Claude Opus 5.5
  • Subscription usage: Weekly +2%

Summary:
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 (propr deploy fly: control plane on a Fly Machine #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.

Review digest

Risk-tiered paths

  • High risk: none
  • Normal risk (41 files)
    • .env.example (+14/−0)
    • packages/api/idleShutdownIntegration.ts (added, +82/−0)
    • packages/api/idleShutdownRouteRegistry.ts (added, +11/−0)
    • packages/api/mcp/settingsCatalog.ts (+4/−0)
    • packages/api/openapi/directRoutes.ts (+2/−0)
    • packages/api/openapi/registeredRoutes.ts (+2/−0)
    • packages/api/openapi/routeDocs.ts (+2/−0)
    • packages/api/openapi/routeDocsIdleShutdown.ts (added, +82/−0)
    • packages/api/routes/idleShutdownRoutes.ts (added, +115/−0)
    • packages/api/routes/index.ts (+1/−0)
    • packages/api/routes/statusRoutes.ts (+18/−2)
    • packages/api/server.ts (+16/−0)
    • packages/api/services/socketService.ts (+8/−1)
    • packages/cli/src/api/system.ts (+2/−0)
    • packages/cli/src/commands/checkCommands.ts (+9/−0)
    • packages/cli/src/commands/idleShutdownCheck.ts (added, +93/−0)
    • packages/client/src/generated/apiTypes.ts (+65/−0)
    • packages/core/src/idle/idleActivity.ts (added, +124/−0)
    • packages/core/src/idle/idleDetector.ts (added, +161/−0)
    • packages/core/src/idle/idleShutdownController.ts (added, +167/−0)
    • packages/core/src/idle/idleShutdownListener.ts (added, +55/−0)
    • packages/core/src/idle/idleShutdownSetting.ts (added, +27/−0)
    • packages/core/src/idle/idleSignals.ts (added, +172/−0)
    • packages/core/src/idle/idleWakeHint.ts (added, +117/−0)
    • packages/core/src/idle/index.ts (added, +7/−0)
    • packages/core/src/index.ts (+3/−0)
    • packages/core/src/intake/RoutingWebSocketIntakeService.ts (+26/−0)
    • packages/core/src/intake/routingIdleFrames.ts (added, +26/−0)
    • packages/shared/src/idleShutdown.ts (added, +248/−0)
    • packages/shared/src/index.ts (+2/−0)
    • propr-ui/src/api/idleShutdownApi.ts (added, +31/−0)
    • propr-ui/src/pages/SettingsPage/IdleShutdownSection.tsx (added, +164/−0)
    • propr-ui/src/pages/SettingsPage/SettingsNavigation.tsx (+1/−1)
    • propr-ui/src/pages/SettingsPage/index.tsx (+2/−1)
    • propr-ui/src/pages/SettingsPage/settingsCategoryGuides.ts (+2/−0)
    • propr-ui/src/pages/SettingsPage/settingsDataSections.tsx (+12/−0)
    • src/daemon.ts (+15/−0)
    • src/daemon/idleShutdown.ts (added, +172/−0)
    • src/daemon/idleSignalSources.ts (added, +77/−0)
    • src/indexing_worker.ts (+4/−1)
    • src/worker.ts (+4/−1)
  • Low risk (14 files)
    • CHANGELOG.md (+20/−0)
    • docs/docs/operations/configuration-reference.md (+3/−0)
    • docs/docs/operations/idle-shutdown.md (added, +154/−0)
    • docs/docs/operations/settings-locations.md (+1/−0)
    • docs/sidebars.ts (+1/−0)
    • docs/static/openapi/propr-api.yaml (+299/−2)
    • packages/api/test/idleShutdownRoutes.test.ts (added, +124/−0)
    • packages/cli/src/commands/idleShutdownCheck.test.ts (added, +40/−0)
    • packages/core/test/idleDetector.test.ts (added, +194/−0)
    • …and 5 more

Diff size: 55 files changed, +3,477/−10 lines

View task for the run's logs and conversation.


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


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


Visual preview

Idle shutdown — desktop

Idle shutdown — desktop

Settings → Maintenance → Idle shutdown after turning it on: the switch, idle window, what keeps the instance awake, next scheduled work, last idle shutdown and last wake (sample data).

Full-size original

Idle shutdown — mobile

Idle shutdown — mobile

The same section at 390 px after saving, with the blockers that keep the instance awake (sample data).

Full-size original

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

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

CI failed: Full Test Suite Shard 3/4

Please investigate and fix this CI failure.

  • Check: Full Test Suite Shard 3/4
  • Result: failure
  • Commit: 8b17ddb00588 (8b17ddb00588783a0eb1bbef6c2462c1eabbab53)
  • Run: View CI failure

Failure evidence

.github:11
Process completed with exit code 1.

.github:43739
Process completed with exit code 1.

propr-ui/src/utils/dateFormat.guard.test.ts:47 — src/utils/dateFormat.guard.test.ts > timestamp formatting > uses the shared formatter for every timestamp outside utils/dateFormat.ts
AssertionError: expected [ Array(1) ] to deeply equal []

  • Expected
  • Received
  • []
  • [
  • "pages/SettingsPage/IdleShutdownSection.tsx:17: .toLocaleString()",
  • ]

❯ src/utils/dateFormat.guard.test.ts:47:24

@propr-dev

propr-dev Bot commented Nov 24, 2026 •

Copy link
Copy Markdown
Contributor Author

✅ Applied the requested follow-up changes in commit 5aa1bf0

Summary of Changes

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.

Review digest

Risk-tiered paths

  • High risk: none
  • Normal risk (1 file)
    • propr-ui/src/pages/SettingsPage/IdleShutdownSection.tsx (+2/−2)
  • Low risk: none

Diff size: 1 file changed, +2/−2 lines


🤖 Implementation Details

  • Model: Claude Opus 5.5 (medium)
  • Requested By: @propr-dev[bot]
  • Time: 4m 4s
  • Tokens: 251,724 (250,371 in / 1,353 out)
  • Cost: $0.27

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

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
@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 adds opt-in idle shutdown with shared activity detection, settings, diagnostics, and wake recovery. It needs significant rework before merge: shutdown can proceed without reliable activity evidence, without stopping producers, or without successfully arranging recovery.

✅ Safe default — Shutdown defaults to off, and an invalid switch cannot enable it.

✅ Useful diagnostics — Named blockers explain queue activity, requests, schedules, and failed collectors through the API, CLI, and UI.

✅ Testable detector — The injected clock and signal collectors support focused tests for idle windows and aborted shutdowns.

This review is a static trace of the supplied code; no commands or tests were run. The authoritative checks show 29 passed, five pending, and no failures.

Merge blockers

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

F1: 🔴 Unsupported relay frames do not provide recovery

  • Category: correctness

  • Required behavior: Idle shutdown must preserve scheduled wake obligations and recover deliveries cached while stopped.

  • Evidence: packages/core/src/intake/RoutingWebSocketIntakeService.ts, requestReplayOnConnect and sendWakeHint; src/daemon/idleShutdown.ts, drainAndExit and recoverFromIdleWake.

    1. An operator enables idle shutdown against the current relay described in the supplied context, which supports replay through POST /v1/replay.
    2. Shutdown sends the newly invented wake_hint frame and proceeds even when sending returns false; there is no relay acceptance check.
    3. After an independent restart, recovery sends a replay WebSocket frame and clears its pending request when the socket send succeeds.
    4. A relay rejecting that frame never replays the cached deliveries, while recovery nevertheless consumes the hint.

    Scheduled work can remain asleep, and cached GitHub deliveries remain unprocessed until another recovery mechanism intervenes or retention expires. Socket send success establishes neither protocol support nor acceptance. The recovery test only checks frames emitted by a fake socket. static trace: the changed send/recovery paths and the supplied current-relay contract; no live relay verification was performed.

  • Minimum fix: Use the supported replay mechanism or require negotiated relay support before enabling this path. Require an accepted wake arrangement for scheduled work, or keep the instance running when no supported arrangement exists.

F2: 🔴 Missing activity heartbeats count as idle

  • Category: correctness

  • Required behavior: Unavailable activity signals must keep the instance awake, including open UI sessions and in-flight requests.

  • Evidence: packages/core/src/idle/idleSignals.ts, collectActivitySignals; packages/core/src/idle/idleActivity.ts, startIdleActivityPublisher.

    1. An API process has an open session or request and publishes its activity with a 60-second TTL.
    2. That process stops publishing long enough for the key to expire—for example, its event loop is stalled while the daemon continues running.
    3. The daemon scans successfully, finds no activity keys, and returns zero counts without an unavailable blocker.
    4. Once the idle window elapses, the daemon initiates shutdown despite lacking a current observation of that API process.

    Publisher errors are also swallowed, malformed records are skipped, and publishedAt is never checked. The collector’s exception handling therefore does not provide the claimed fail-safe behavior for missing evidence. static trace: expiration and empty-scan behavior in the supplied publisher and collector.

  • Minimum fix: Track which API publishers are expected and require fresh, valid observations before shutdown. Treat missing or malformed observations as unavailable until the process is confirmed stopped.

F3: 🔴 HTTP producers remain open after the final check

  • Category: correctness

  • Required behavior: Shutdown must not leave newly accepted work queued behind workers that have already stopped.

  • Evidence: src/daemon/idleShutdown.ts, drainAndExit; packages/api/idleShutdownIntegration.ts, startApiIdleShutdown.

    1. The final collection reports idle. Only Connect intake has been stopped; HTTP intake remains available.
    2. During the awaited writeIdleWakeHint, an API request starts an asynchronous operation that will enqueue work.
    3. The daemon publishes shutdown without another activity check. Workers receive SIGTERM and close while their queues are empty.
    4. The API’s in-flight request then enqueues its job while completing its graceful drain.

    The accepted job remains queued with the workers and daemon stopped. Eager activity publication does not prevent this sequence because nothing reads it after the final collection. No producer fence or ordered API-before-worker drain is present. static trace: the explicit awaited hint write, subsequent shutdown broadcast, and independently triggered process shutdowns.

  • Minimum fix: Quiesce API intake and other producers first, await their outstanding work, then recheck shared work before stopping workers. If work appeared, resume intake and abort the idle shutdown.

F4: 🔴 Shutdown broadcast can be lost permanently

  • Category: correctness

  • Required behavior: An idle exit must coordinate shutdown of the entire control plane rather than leave a partially running instance.

  • Evidence: src/daemon/idleShutdown.ts, drainAndExit; packages/core/src/idle/idleShutdownListener.ts, startIdleShutdownListener.

    1. An API or worker subscriber is temporarily disconnected when the instance becomes idle.
    2. The daemon publishes the one-shot shutdown message. Redis pub/sub does not retain it for the disconnected subscriber.
    3. The daemon ignores subscriber delivery confirmation and exits.
    4. The other process reconnects but never receives the shutdown request, leaving part of the control plane running without its daemon.

    Subscription failures and publish failures are also swallowed. Neither a durable shutdown intent nor recipient acknowledgements allow this path to recover. static trace: the one-shot publish and listener implementation; no reconnect-delivery test was executed.

  • Minimum fix: Persist shutdown intent and require expected processes to acknowledge the drain, including after reconnection. Do not exit the daemon when the shutdown request cannot be delivered or confirmed.

F5: 🔴 Failed hint persistence still permits shutdown

  • Category: correctness

  • Required behavior: Shutdown must preserve the recovery marker and the wake obligation before exiting.

  • Evidence: src/daemon/idleShutdown.ts, drainAndExit and recoverFromIdleWake.

    1. The configured hint destination cannot be written, such as when its filesystem is full or read-only.
    2. writeIdleWakeHint rejects; shutdown logs a warning and continues to stop the control plane.
    3. A supervisor relying on that file receives no updated schedule.
    4. On a later independent restart, recovery reads no pending hint—or an older consumed hint—and returns before requesting replay.

    The Redis shutdown record does not repair this failure because recovery reads only the file. Thus a handled persistence failure silently removes both scheduled-wake information and the trigger for replay recovery. static trace: the write-error catch and the isPendingIdleWake early return.

  • Minimum fix: Abort shutdown and restore intake if the hint cannot be persisted, unless an equivalent durable record is successfully written and used by both recovery and the configured wake mechanism.

Suggestions

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

S1: 🟢 Refresh visible status

IdleShutdownSection.tsx fetches status only on mount and save, so its blockers and timestamps become stale while displayed. Periodically refreshing the status would improve diagnostics; this is optional because it does not change shutdown correctness.

S2: 🟢 Correct deployment documentation

The new operations page says propr deploy fly generates the configuration, while the supplied context explicitly says that command does not exist yet. Describe the manual setup accurately and distinguish measured cold-start timings from estimates. These documentation corrections are non-blocking follow-ups.

Score

The settings and detector have useful coverage, but the shutdown coordination and recovery guarantees have material gaps. Passing checks do not cover these demonstrated failure paths, and five checks remain pending.

Score: 4/10


🤖 Review Details

  • Model: GPT-6 Astra
  • Time: 1m 17s
  • Tokens: 99,975 (97,622 in / 2,353 out)
  • Cost: $0.98

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 F4 F5 S1 S2

🤖 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 696b285

Addressed 1 AI review comment (IDs: 7119473135)

Addressed findings F1, F2, F3, F4, F5

Summary of Changes

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.

Review digest

Risk-tiered paths

  • High risk: none
  • Normal risk (16 files)
    • packages/api/idleShutdownIntegration.ts (+46/−8)
    • packages/core/src/idle/idleActivity.ts (+70/−15)
    • packages/core/src/idle/idleParticipants.ts (added, +207/−0)
    • packages/core/src/idle/idleShutdownIntent.ts (added, +165/−0)
    • packages/core/src/idle/idleShutdownListener.ts (+167/−33)
    • packages/core/src/idle/idleSignals.ts (+31/−4)
    • packages/core/src/idle/idleWakeHint.ts (+12/−1)
    • packages/core/src/idle/index.ts (+2/−0)
    • packages/core/src/intake/RoutingWebSocketIntakeService.ts (+26/−14)
    • packages/core/src/intake/routingIdleFrames.ts (+136/−11)
    • packages/core/src/intake/routingWebSocketProtocol.ts (+2/−0)
    • packages/shared/src/idleShutdown.ts (+20/−0)
    • src/daemon/idleShutdown.ts (+219/−45)
    • src/daemon/idleSignalSources.ts (+11/−1)
    • src/indexing_worker.ts (+4/−3)
    • src/worker.ts (+8/−2)
  • Low risk (8 files)
    • CHANGELOG.md (+11/−4)
    • docs/docs/operations/idle-shutdown.md (+20/−14)
    • packages/api/test/idleShutdownRoutes.test.ts (+30/−0)
    • packages/core/test/idleDetector.test.ts (+6/−2)
    • packages/core/test/idleShutdownController.test.ts (+44/−5)
    • packages/core/test/idleShutdownCoordination.test.ts (added, +188/−0)
    • test/idleShutdownDrain.test.ts (added, +207/−0)
    • test/idleShutdownRecovery.test.ts (+66/−9)

Diff size: 24 files changed, +1,698/−171 lines


🤖 Implementation Details

  • Model: Claude Opus 5.5 (medium)
  • Requested By: @propr-ultrafix
  • Time: 43m 53s
  • Tokens: 11,970,549 (11,871,816 in / 98,733 out)
  • Cost: $5.36

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

propr-dev Bot pushed a commit that referenced this pull request Nov 24, 2026
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
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
@propr-dev

propr-dev Bot commented Nov 24, 2026 •

Copy link
Copy Markdown
Contributor Author

🔀 Resolved merge conflicts from 3758-epic-runtime-abstraction-sc0 into 3770/claude-opus-5-5-opt-in-idle-shutdown-and--20261124-0023-b3m in commit 60ef530

Conflicting Files

  • docs/static/openapi/propr-api.yaml
  • packages/api/openapi/directRoutes.ts
  • packages/api/server.ts
  • src/daemon.ts
  • src/indexing_worker.ts

Resolution Summary

Resolved all five file conflicts for PR #3772 and refreshed the generated OpenAPI copy. A workspace-wide scan found no remaining merge conflict markers. Git still lists the five source files as unmerged because git add could not create index.lock on the read-only filesystem.

File Conflict and resolution
docs/static/openapi/propr-api.yaml Both branches updated route coverage totals. Combined the route additions for 331 total, 93 documented, and 238 undocumented. The OpenAPI generator confirmed the counts and the generated spec.
packages/api/openapi/directRoutes.ts The PR added POST /wake where the target branch added GET /config.js. Kept both public registrations so the API reference covers Connect wake pings and the UI runtime config.
packages/api/server.ts Both branches added middleware in the same startup block. Kept idle activity tracking and /wake ahead of the static UI mount so UI requests count as activity and wake pings reach their handler. The UI mount still runs before CORS and API rate limiting.
src/daemon.ts The PR added idle shutdown where the target introduced supervisor-owned cleanup. Kept wake recovery, the close() handle, and shared queue ownership. Automatic idle shutdown is limited to standalone mode because multiple participants can send SIGTERM to the all-in-one supervisor, whose second-signal handler exits before cleanup finishes.
src/indexing_worker.ts The PR added idle-shutdown registration and deregistration while the target introduced a reusable close() and shared proxy ownership. Put deregistration in close() after job drain, kept both scan timers in cleanup, and preserved the main worker’s proxy ownership in all-in-one mode.
docs/build/openapi/propr-api.yaml The generated copy contained the same coverage conflict. Refreshed it from the resolved source and verified the two files match byte for byte.

TypeScript type checking, OpenAPI validation, whitespace checks, and all 71 targeted tests passed.


🤖 Resolution Details

  • Model: GPT-6.2 Sol
  • Time: 6m 56s

View Task Execution


System-triggered merge conflict resolution

Automatically resolved merge conflicts after merging target branch into PR branch.
Resolved conflicts in:
- docs/static/openapi/propr-api.yaml
- packages/api/openapi/directRoutes.ts
- packages/api/server.ts
- src/daemon.ts
- src/indexing_worker.ts

PR: #3772
Model: GPT-6.2 Sol
@propr-dev

propr-dev Bot commented Nov 24, 2026 •

Copy link
Copy Markdown
Contributor Author

🔀 Auto-merged 3758-epic-runtime-abstraction-sc0 into 3770/claude-opus-5-5-opt-in-idle-shutdown-and--20261124-0023-b3m (clean merge) in commit 60ef530

No conflicts were found — the merge was verified by an AI agent.


🤖 Verification Details

  • Model: GPT-6.2 Sol
  • Time: 3m 26s

View Task Execution


System-triggered merge conflict resolution

@propr-dev

propr-dev Bot commented Nov 24, 2026 •

Copy link
Copy Markdown
Contributor Author

🔀 Auto-merged 3758-epic-runtime-abstraction-sc0 into 3770/claude-opus-5-5-opt-in-idle-shutdown-and--20261124-0023-b3m (clean merge) in commit 60ef530

No conflicts were found — the merge was verified by an AI agent.


🤖 Verification Details

  • Model: GPT-6.2 Sol
  • Time: 3m 13s

View Task Execution


System-triggered merge conflict resolution

@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: Validate Changes

Please investigate and fix this CI failure.

Failure evidence

.github:8
Process completed with exit code 1.

.github:415
Process completed with exit code 1.

@github-actions

Copy link
Copy Markdown

Checks Failed

Validation failed during setup, tests, CLI packaging, linting, or build checks.

View Logs
Build check diagnostics for run 45314173310, attempt 3
Checkout outcome: success

--- GitHub Actions workflow lint ---
docker.io/rhysd/actionlint@sha256:b1934ee5f1c509618f2508e6eb47ee0d3520686341fec936f3b79331f9315667: Pulling from rhysd/actionlint
589002ba0eae: Pulling fs layer
c09af8888d6a: Pulling fs layer
4ccd7d76ca98: Pulling fs layer
b6b4b7b0e257: Pulling fs layer
b6b4b7b0e257: Waiting
c09af8888d6a: Verifying Checksum
c09af8888d6a: Download complete
4ccd7d76ca98: Download complete
589002ba0eae: Verifying Checksum
589002ba0eae: Download complete
589002ba0eae: Pull complete
c09af8888d6a: Pull complete
4ccd7d76ca98: Pull complete
b6b4b7b0e257: Verifying Checksum
b6b4b7b0e257: Download complete
b6b4b7b0e257: Pull complete
Digest: sha256:b1934ee5f1c509618f2508e6eb47ee0d3520686341fec936f3b79331f9315667
Status: Downloaded newer image for rhysd/actionlint@sha256:b1934ee5f1c509618f2508e6eb47ee0d3520686341fec936f3b79331f9315667
docker.io/rhysd/actionlint@sha256:b1934ee5f1c509618f2508e6eb47ee0d3520686341fec936f3b79331f9315667

--- Release shell script lint ---

--- Toolchain ---
v22.23.5
10.9.9

--- Dependency installation ---
npm warn deprecated [email protected]: This module is not supported, and leaks memory. Do not use it. Check out lru-cache if you want a good and tested way to coalesce async requests by a key value, which is much more comprehensive and powerful.
npm warn deprecated [email protected]: Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.
npm warn deprecated [email protected]: Old versions of glob are not supported, and contain widely publicized security vulnerabilities, which have been fixed in the current version. Please update. Support for old versions may be purchased (at exorbitant rates) by contacting [email protected]

added 1112 packages, and audited 1121 packages in 17s

318 packages are looking for funding
  run `npm fund` for details

8 moderate severity vulnerabilities

To address issues that do not require attention, run:
  npm audit fix

To address all issues (including breaking changes), run:
  npm audit fix --force

Run `npm audit` for details.

--- CLI release package ---
Verifying propr-cli release package...

> [email protected] cli:pack
> node packages/cli/scripts/build-publish.mjs


> @propr/[email protected] build
> tsc


> @propr/[email protected] build
> tsc


> @propr/[email protected] build
> tsc && node scripts/copy-assets.mjs

copy-assets: copied 9 file(s) into the CLI package.

Staged [email protected] at /home/runner/work/propr/propr/dist-publish/propr-cli
npm notice
npm notice 📦  [email protected]
npm notice Tarball Contents
npm notice 32.0kB README.md
npm notice 36.3kB dist/agentSkill.js
npm notice 477B dist/api/admission.js
npm notice 754B dist/api/agentRuntime.js
npm notice 7.1kB dist/api/agents.js
npm notice 2.6kB dist/api/agentTank.js
npm notice 4.4kB dist/api/automations.js
npm notice 13.3kB dist/api/client.js
npm notice 5.9kB dist/api/errors.js
npm notice 1.6kB dist/api/followupHandoffs.js
npm notice 16.9kB dist/api/goals.js
npm notice 6.0kB dist/api/implement.js
npm notice 2.9kB dist/api/index.js
npm notice 1.9kB dist/api/logs.js
npm notice 7.7kB dist/api/plans.js
npm notice 586B dist/api/pullRequests.js
npm notice 4.2kB dist/api/relay.js
npm notice 12.5kB dist/api/repos.js
npm notice 2.5kB dist/api/repositoryEvents.js
npm notice 16.2kB dist/api/settings.js
npm notice 2.0kB dist/api/stats.js
npm notice 1.6kB dist/api/syntheticPools.js
npm notice 1.8kB dist/api/system.js
npm notice 5.9kB dist/api/tasks.js
npm notice 2.9kB dist/api/todos.js
npm notice 86B dist/api/types.js
npm notice 313B dist/api/visualPreviewAuth.js
npm notice 33.7kB dist/assets/env.example.txt
npm notice 5.9kB dist/auth/githubLogin.js
npm notice 5.0kB dist/auth/verifyToken.js
npm notice 9.0kB dist/commands/admissionCommands.js
npm notice 19.7kB dist/commands/agentCommands.js
npm notice 4.2kB dist/commands/agentPoolCommands.js
npm notice 4.3kB dist/commands/agentSkillCommands.js
npm notice 30.0kB dist/commands/agentValidation.js
npm notice 31.2kB dist/commands/automationCommands.js
npm notice 72.9kB dist/commands/checkCommands.js
npm notice 8.9kB dist/commands/configCommands.js
npm notice 14.6kB dist/commands/connectCommand.js
npm notice 12.2kB dist/commands/eventCommands.js
npm notice 5.5kB dist/commands/githubAppApi.js
npm notice 27.7kB dist/commands/githubAppCommands.js
npm notice 60.8kB dist/commands/goalCommands.js
npm notice 9.4kB dist/commands/handoffCommands.js
npm notice 3.4kB dist/commands/idleShutdownCheck.js
npm notice 2.4kB dist/commands/imageCommands.js
npm notice 8.6kB dist/commands/implementCommands.js
npm notice 2.0kB dist/commands/index.js
npm notice 8.4kB dist/commands/initCommands.js
npm notice 14.1kB dist/commands/initStack.js
npm notice 6.1kB dist/commands/logCommands.js
npm notice 26.5kB dist/commands/planCommands.js
npm notice 3.1kB dist/commands/prCommands.js
npm notice 8.4kB dist/commands/relayCommands.js
npm notice 41.4kB dist/commands/repoCommands.js
npm notice 2.7kB dist/commands/repoValidate.js
npm notice 7.5kB dist/commands/runtimeCommands.js
npm notice 19.8kB dist/commands/settingCommands.js
npm notice 4.6kB dist/commands/setup/agentHostActions.js
npm notice 123B dist/commands/setup/agents.js
npm notice 4.7kB dist/commands/setup/engine.js
npm notice 51B dist/commands/setup/github.js
npm notice 37.3kB dist/commands/setup/hostActions.js
npm notice 3.2kB dist/commands/setup/imagePlatform.js
npm notice 27.3kB dist/commands/setup/sequential.js
npm notice 51B dist/commands/setup/state.js
npm notice 51B dist/commands/setup/types.js
npm notice 10.7kB dist/commands/setupCommand.js
npm notice 4.4kB dist/commands/stackCommands.js
npm notice 1.8kB dist/commands/startCommand.js
npm notice 4.8kB dist/commands/statsCommands.js
npm notice 4.9kB dist/commands/statsCostCommand.js
npm notice 14.8kB dist/commands/systemCommands.js
npm notice 3.5kB dist/commands/tankCommands.js
npm notice 47.6kB dist/commands/taskCommands.js
npm notice 29.7kB dist/commands/todoCommands.js
npm notice 31.0kB dist/commands/tunnelCommand.js
npm notice 2.7kB dist/commands/uiDocsCommands.js
npm notice 8.3kB dist/completion.js
npm notice 27.3kB dist/config/ConfigManager.js
npm notice 276B dist/config/index.js
npm notice 989B dist/config/rootKey.js
npm notice 345B dist/config/types.js
npm notice 46.0kB dist/connectIdentity.js
npm notice 25.0kB dist/connectRootAuthority.js
npm notice 32.5kB dist/connectWindowsAuthority.js
npm notice 2.2kB dist/desktopDiscovery.js
npm notice 13.3kB dist/desktopLocalSetup.js
npm notice 17.4kB dist/index.js
npm notice 4.5kB dist/native/darwin-authority-broker.c
npm notice 8.9kB dist/native/directory-operations.c
npm notice 50.1kB dist/native/prebuilds/darwin-arm64/connect-authority-broker
npm notice 54.2kB dist/native/prebuilds/darwin-arm64/directory-operations.node
npm notice 17.1kB dist/native/prebuilds/darwin-x64/connect-authority-broker
npm notice 24.3kB dist/native/prebuilds/darwin-x64/directory-operations.node
npm notice 28.9kB dist/native/prebuilds/linux-arm64/directory-operations.node
npm notice 17.4kB dist/native/prebuilds/linux-x64/directory-operations.node
npm notice 1.2kB dist/native/README.md
npm notice 3.1kB dist/orchestrator/format.js
npm notice 13.5kB dist/orchestrator/index.js
npm notice 302B dist/orchestrator/manifest.json
npm notice 137.3kB dist/orchestrator/orchestrator.mjs
npm notice 408B dist/orchestrator/types.js
npm notice 6.2kB dist/rootHelp.js
npm notice 237B dist/skill/propr/agents/openai.yaml
npm notice 8.9kB dist/skill/propr/SKILL.md
npm notice 4.5kB dist/tui/AgentTableApp.js
npm notice 4.5kB dist/tui/app.js
npm notice 11.6kB dist/tui/CheckApp.js
npm notice 5.4kB dist/tui/render.js
npm notice 32.5kB dist/tui/SetupApp.js
npm notice 18.4kB dist/tui/SetupApp.test.js
npm notice 8.4kB dist/tui/StartApp.js
npm notice 3.8kB dist/utils/apiErrorPresentation.js
npm notice 12.0kB dist/utils/directoryDescriptor.js
npm notice 739B dist/utils/dockerPort.js
npm notice 5.0kB dist/utils/envFile.js
npm notice 520B dist/utils/index.js
npm notice 5.7kB dist/utils/io.js
npm notice 717B dist/utils/localSetupPlatform.js
npm notice 1.5kB dist/utils/nativeArtifact.js
npm notice 544B dist/utils/parseState.js
npm notice 417B dist/utils/positiveInteger.js
npm notice 4.5kB dist/utils/privateFilesystem.js
npm notice 4.2kB dist/utils/resolveProject.js
npm notice 7.2kB dist/vendor/local-setup/agents.js
npm notice 64.5kB dist/vendor/local-setup/engine.js
npm notice 5.0kB dist/vendor/local-setup/envFile.js
npm notice 11.4kB dist/vendor/local-setup/github.js
npm notice 188B dist/vendor/local-setup/index.js
npm notice 27.5kB dist/vendor/local-setup/publicInstanceIdentity.js
npm notice 14.6kB dist/vendor/local-setup/state.js
npm notice 2.8kB dist/vendor/local-setup/types.js
npm notice 13.2kB dist/vendor/shared/acceptanceCriteria.js
npm notice 1.0kB dist/vendor/shared/accountStatusTimestamp.js
npm notice 7.7kB dist/vendor/shared/activityEvents.js
npm notice 2.8kB dist/vendor/shared/agentConfigRedaction.js
npm notice 4.4kB dist/vendor/shared/agentDefinitions.js
npm notice 2.3kB dist/vendor/shared/agentFailureLine.js
npm notice 3.4kB dist/vendor/shared/agentLogin.js
npm notice 3.1kB dist/vendor/shared/agentTank.js
npm notice 1.2kB dist/vendor/shared/agentTankHistory.js
npm notice 2.8kB dist/vendor/shared/analyticsTimeframe.js
npm notice 4.4kB dist/vendor/shared/antigravityCompatibility.js
npm notice 5.1kB dist/vendor/shared/apiOrigin.js
npm notice 3.5kB dist/vendor/shared/assignment.js
npm notice 17.2kB dist/vendor/shared/automationDefinitions.js
npm notice 9.2kB dist/vendor/shared/automationReportPreview.js
npm notice 2.4kB dist/vendor/shared/automationRunProductivity.js
npm notice 6.4kB dist/vendor/shared/automationTemplateContract.js
npm notice 18.5kB dist/vendor/shared/automationTemplates.catalog.json
npm notice 1.3kB dist/vendor/shared/automationTemplates.js
npm notice 3.4kB dist/vendor/shared/changedFileKinds.js
npm notice 1.4kB dist/vendor/shared/claudeCompatibility.js
npm notice 12.1kB dist/vendor/shared/commitSubject.js
npm notice 8.5kB dist/vendor/shared/connectDiscovery.js
npm notice 9.6kB dist/vendor/shared/cronSchedule.js
npm notice 254B dist/vendor/shared/demoMode.js
npm notice 4.3kB dist/vendor/shared/desktopPairing.js
npm notice 481B dist/vendor/shared/desktopTokenRevocation.js
npm notice 8.9kB dist/vendor/shared/events.js
npm notice 13.0kB dist/vendor/shared/extensionLibrary.js
npm notice 703B dist/vendor/shared/extensionOAuth.js
npm notice 4.0kB dist/vendor/shared/extensionPackages.js
npm notice 2.9kB dist/vendor/shared/extensionProfiles.js
npm notice 2.7kB dist/vendor/shared/fleetData.js
npm notice 2.5kB dist/vendor/shared/githubAppManifest.js
npm notice 1.6kB dist/vendor/shared/githubAuthMode.js
npm notice 2.0kB dist/vendor/shared/githubEventIntakeMode.js
npm notice 12.8kB dist/vendor/shared/goalBlockers.js
npm notice 6.0kB dist/vendor/shared/goalCheckpoints.js
npm notice 4.0kB dist/vendor/shared/goalCreation.js
npm notice 5.1kB dist/vendor/shared/goalWait.js
npm notice 8.4kB dist/vendor/shared/idleShutdown.js
npm notice 14.7kB dist/vendor/shared/index.js
npm notice 214B dist/vendor/shared/instanceAuthorization.js
npm notice 54B dist/vendor/shared/instanceCatalog.js
npm notice 584B dist/vendor/shared/instanceStorage.js
npm notice 4.0kB dist/vendor/shared/intakeModePrerequisites.js
npm notice 2.9kB dist/vendor/shared/labelUtils.js
npm notice 21.0kB dist/vendor/shared/modelDefinitions.js
npm notice 3.5kB dist/vendor/shared/notificationLinks.js
npm notice 51.3kB dist/vendor/shared/notifications.js
npm notice 2.9kB dist/vendor/shared/openCodeCompatibility.js
npm notice 16.9kB dist/vendor/shared/planItemGraph.js
npm notice 7.5kB dist/vendor/shared/previewStorage/v1.js
npm notice 866B dist/vendor/shared/projectSlug.js
npm notice 3.8kB dist/vendor/shared/proprCompatibility.js
npm notice 884B dist/vendor/shared/proprRuntimePaths.js
npm notice 13.0kB dist/vendor/shared/proprServiceUrls.js
npm notice 17.0kB dist/vendor/shared/prTemplate.js
npm notice 6.9kB dist/vendor/shared/prTitleStatusSlot.js
npm notice 2.2kB dist/vendor/shared/publishedVisualPreviews.js
npm notice 2.7kB dist/vendor/shared/reasoningLevels.js
npm notice 1.8kB dist/vendor/shared/repositoryEvents.js
npm notice 6.7kB dist/vendor/shared/repositoryEventWait.js
npm notice 1.2kB dist/vendor/shared/repositoryIcon.js
npm notice 1.4kB dist/vendor/shared/repositoryIconUrl.js
npm notice 3.9kB dist/vendor/shared/repositoryPresentation.js
npm notice 10.4kB dist/vendor/shared/reviewContextBudget.js
npm notice 5.8kB dist/vendor/shared/reviewFeedbackIds.js
npm notice 2.7kB dist/vendor/shared/reviewPrompt.js
npm notice 907B dist/vendor/shared/runCostCap.js
npm notice 861B dist/vendor/shared/sessionSecret.js
npm notice 392B dist/vendor/shared/sqliteTimestamp.js
npm notice 603B dist/vendor/shared/statusKeys.js
npm notice 7.5kB dist/vendor/shared/syntheticAgents.js
npm notice 2.2kB dist/vendor/shared/taskIdentifiers.js
npm notice 2.0kB dist/vendor/shared/taskLifecycle.js
npm notice 733B dist/vendor/shared/taskReplacement.js
npm notice 957B dist/vendor/shared/text.js
npm notice 2.6kB dist/vendor/shared/tokenOutlierSettings.js
npm notice 1.9kB dist/vendor/shared/ultrafixCycle.js
npm notice 1.8kB dist/vendor/shared/unfinishedRun.js
npm notice 9.8kB dist/vendor/shared/usageTips.catalog.json
npm notice 5.0kB dist/vendor/shared/usageTips.js
npm notice 335B dist/vendor/shared/usageTypes.js
npm notice 1.1kB dist/vendor/shared/userWhitelist.js
npm notice 758B dist/vendor/shared/validateRelayUrl.js
npm notice 2.2kB dist/vendor/shared/validateRoutingUrl.js
npm notice 7.1kB dist/vendor/shared/visualPreviewCapacity.js
npm notice 9.3kB dist/vendor/shared/voice.js
npm notice 222B dist/vendor/shared/workEvidence.js
npm notice 828B package.json
npm notice Tarball Details
npm notice name: propr-cli
npm notice version: 0.9.3
npm notice filename: propr-cli-0.9.3.tgz
npm notice package size: 557.4 kB
npm notice unpacked size: 2.2 MB
npm notice shasum: 9ec30f6f70178c25ba793d09018887552ef676f7
npm notice integrity: sha512-DoJaonCIueazn[...]qwJ5bq75mBCEQ==
npm notice total files: 224
npm notice
propr-cli-0.9.3.tgz

Dry run only. Re-run with --publish to publish to npm.
✅ propr-cli release package verified
Starting changed-area validation process...
Reusing this job's @propr/shared build from CLI packaging.
Reusing this job's @propr/local-setup build from CLI packaging.

--- Core Service: Lint & Build ---
❌ Core Lint FAILED

> [email protected] lint
> eslint src/ --max-warnings 0


/home/runner/work/propr/propr/src/daemon.ts
  542:1  warning  File has too many lines (401). Maximum allowed is 400  max-lines

✖ 1 problem (0 errors, 1 warning)

ESLint found too many warnings (maximum: 0).

--- UI: Typecheck, Lint & Build ---
✅ Client Package validation passed
✅ UI Typecheck passed
✅ UI Lint passed
✅ UI Build passed

--- Docs: Typecheck & Build ---
✅ Docs Typecheck passed
✅ Docs Build passed
✅ Docs Static Serving Check passed

--- Core Package: Build & Lint ---
✅ Core Package Build passed
✅ Core Package Lint passed

--- CLI: Lint ---
✅ CLI Lint passed

--- API: Build & Lint ---
✅ API Build passed
✅ API Lint passed

--- API Reference: OpenAPI Spec & Client Contract ---
✅ OpenAPI spec is current and valid
✅ @propr/client matches the OpenAPI spec

--- Stage outcomes ---
Workflow lint: success
Release shell lint: success
Pre-setup gate: skipped
Node setup: success
Toolchain: success
Dependency install: success
Release metadata: success
CLI packaging: success
Change detection: success
Changed-area checks: failure
Chromium install: skipped
PWA and mobile browser smoke: skipped

View Workflow

@propr-dev

propr-dev Bot commented Nov 24, 2026 •

Copy link
Copy Markdown
Contributor Author

✅ Applied the requested follow-up changes in commit a9649b0

Processed 2 comments:

  • Comment 1 by @propr-dev[bot] (ID: 7120562264✓)
  • Comment 2 by @github-actions[bot] (ID: 7120562560✓)

Summary of Changes

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.

Review digest

Risk-tiered paths

  • High risk: none
  • Normal risk (1 file)
    • src/daemon.ts (+1/−3)
  • Low risk: none

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


🤖 Implementation Details

  • Model: Claude Opus 5.5 (medium)
  • Requested By: @propr-dev[bot], @github-actions[bot]
  • Time: 3m 10s
  • Tokens: 235,374 (234,631 in / 743 out)
  • Cost: $0.30

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 IDs: 7120562264✓, 7120562560✓

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
@propr-dev

propr-dev Bot commented Nov 24, 2026

Copy link
Copy Markdown
Contributor Author

CI failed: Full Test Suite Shard 4/4

Please investigate and fix this CI failure.

  • Check: Full Test Suite Shard 4/4
  • Result: failure
  • Commit: a9649b00f37a (a9649b00f37a410ff9d0a2f50bb2bbaaffa4e489)
  • Run: View CI failure

Failure evidence

.github:11
Process completed with exit code 1.

.github:46697
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 9ff552c

Summary of Changes

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.

Review digest

Risk-tiered paths

  • High risk: none
  • Normal risk (2 files)
    • packages/cli/src/commands/checkCommands.ts (+12/−5)
    • packages/cli/src/commands/idleShutdownCheck.ts (+12/−4)
  • Low risk (1 file)
    • packages/cli/src/commands/idleShutdownCheck.test.ts (+10/−0)

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


🤖 Implementation Details

  • Model: Claude Opus 5.5 (medium)
  • Requested By: @propr-dev[bot]
  • Time: 5m 51s
  • Tokens: 1,864,561 (1,856,127 in / 8,434 out)
  • Cost: $0.91

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

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
@propr-dev propr-dev Bot changed the title 🔨 [3770 by Claude Opus 5.5] Opt-in idle shutdown and wake for the control plane ⚠️❼ [3770 by Claude Opus 5.5] Opt-in idle shutdown and wake for the control plane Nov 24, 2026

integry commented Nov 24, 2026

Copy link
Copy Markdown
Owner

/merge

@propr-dev

propr-dev Bot commented Nov 24, 2026 •

Copy link
Copy Markdown
Contributor Author

🔀 Resolved merge conflicts from 3758-epic-runtime-abstraction-sc0 into 3770/claude-opus-5-5-opt-in-idle-shutdown-and--20261124-0023-b3m in commit 00e6bc6

Conflicting Files

  • docs/docs/operations/deploy-fly.md
  • packages/cli/src/commands/deploy/flyDeployRunner.test.ts
  • packages/cli/src/commands/deploy/flyDeployRunner.ts
  • packages/cli/src/commands/deployFly.ts

Resolution Summary

Resolved all five conflict blocks across the four files in PR #3772. The workspace scan found no remaining merge conflict markers. The CLI typecheck, all 131 Fly deployment tests, and git diff --check passed.

File Conflict and resolution
deploy-fly.md Both branches edited the pricing section. I kept the PR’s opt-in idle shutdown guidance and the target branch’s Free-plan volume cap and persistent Docker storage costs. The guide now explains which charges continue while the Machine is stopped.
flyDeployRunner.ts Both branches changed the deployment target interface. I kept the PR’s stop-token method and the target branch’s optional logging callback so idle shutdown and stale-config recovery both work through the same interface.
flyDeployRunner.test.ts Both branches added tests at the same location and changed the imports. I combined the imports and kept both test groups so the suite covers idle-shutdown token handling and Free-plan checks across both backends.
deployFly.ts Both branches changed CLI option registration. I kept --idle-shutdown and --machine-stop-token from the PR alongside --rootfs-size and the updated --legacy-docker help, so the CLI describes the behavior and storage requirements it now implements.

Git could not mark the four files resolved in its index because the filesystem was read-only when it tried to create index.lock. The resolved files are present in the workspace.

Outside the four conflicted files, the CLI overview still says --idle-shutdown is refused.


🤖 Resolution Details

  • Model: GPT-6.2 Sol
  • Time: 3m 13s

View Task Execution


System-triggered merge conflict resolution

@propr-dev propr-dev Bot changed the title ⚠️❼ [3770 by Claude Opus 5.5] Opt-in idle shutdown and wake for the control plane 🔨 [3770 by Claude Opus 5.5] Opt-in idle shutdown and wake for the control plane Nov 24, 2026
Automatically resolved merge conflicts after merging target branch into PR branch.
Resolved conflicts in:
- docs/docs/operations/deploy-fly.md
- packages/cli/src/commands/deploy/flyDeployRunner.test.ts
- packages/cli/src/commands/deploy/flyDeployRunner.ts
- packages/cli/src/commands/deployFly.ts

PR: #3772
Model: GPT-6.2 Sol

integry commented Nov 24, 2026

Copy link
Copy Markdown
Owner

/ultrafix goal=8 max=5

I verified this PR live on a real Fly Free-plan Machine. Setup: propr deploy fly --legacy-docker --idle-shutdown 2m, an image built from 00e6bc6, region ams, 2 GB shared-cpu-1x.

VERIFIED WORKING (this closes S32 except for the item below):

  • The deploy created the PROPR_FLY_MACHINE_STOP_TOKEN secret and printed the wake URL.
  • Idle stop: about 150 s after the last activity the app logged reason: "idle for 150s", then "idle shutdown, closing every component", then "the host accepted the idle stop; exiting with code 0". The WHOLE Machine stopped, including the redis and docker sidecars. Fly event log: stopping (stop, user) then stopped exit_code=0 requested_stop=true.
  • A second idle cycle after a wake also stopped the Machine (249 s after the wake).

MERGE BLOCKER: the first request that wakes a stopped Machine fails with 503 in legacy Docker mode.
GET https://<app>.fly.dev/wake on the stopped Machine returned 503 after 45.1 s. The proxy did start the Machine. Timeline from the logs:

  • 15:17:44: proxy starts the Machine.
  • 15:18:18: dockerd "API listen", 34 s after start, in the propr-dockerd-boot loop-image fsck and mount.
  • 15:18:32: "docker container healthy", then "app container started".
    The app container waits for the docker container to be healthy (depends_on), so nothing listens on :4000 for about 48 s, and Fly's proxy gives up at about 45 s.

Fix it so the first wake request succeeds well inside the proxy timeout:
(a) Do not gate the app container on docker health. Let the app start immediately and let the worker wait for or retry the Docker API before running Docker agents, so /health and /wake answer within seconds.
(b) Also cut the dockerd boot time where it is safe. For example, skip e2fsck -p and the dumpe2fs/resize work when the image is already the wanted size and was cleanly unmounted (check the fs state flag). Find out what actually takes the 34 s, for example by timing each step in the boot script's log output.

Add tests for the generated Machine config (no app depends_on docker healthy, or an equivalent) and for any boot-script fast path. The Sprites runtime layout has no docker sidecar and is not affected. In the PR description, note that the 503 needs my live re-check.

Keep the scope to this. S31 and S33 remain optional.

@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: 5)

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 @integry

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 adds opt-in idle detection, coordinated shutdown, and whole-Machine stopping on Fly. It needs changes before merge: enabling legacy Docker idle shutdown exposes a confirmed cold-start failure on the first wake request.

✅ Whole-Machine shutdown verified — Your live test confirms that the app, Redis, and Docker sidecars stop together, including after a second idle cycle.

✅ Stop refusal recovery — createBoundedExit exits with code 1 when the Machines API refuses or times out, and the added child-process tests cover that contract.

This review is limited to the supplied diff and your requested wake-path scope. test/idleShutdownDrain.test.ts was explicitly omitted. No commands or tests were run during this review. Current checks show no failures and four pending checks.

Merge blockers

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

F34: 🔴 Legacy Docker startup blocks waking requests

  • Category: correctness

  • Required behavior: The newly enabled Fly idle-shutdown deployment must wake on demand and serve the initiating request within the proxy timeout.

  • Evidence: packages/cli/src/commands/deployFly.ts:FLY_IDLE_SHUTDOWN_SUPPORTED, packages/cli/src/commands/deploy/flyMachineConfig.ts:buildAppContainer

    1. Deploy with --legacy-docker --idle-shutdown 2m; the changed support flag now permits this configuration and the idle path stops the whole Machine.
    2. A request reaches the stopped Machine and Fly starts it. In your supplied live test, Docker takes approximately 34 seconds to reach “API listen.”
    3. The app remains gated on Docker health. Docker becomes healthy and the app starts approximately 48 seconds after Machine startup.
    4. Fly has already returned 503 to the initiating request after approximately 45 seconds because nothing was listening on port 4000.

    static trace: The supplied changes enable this deployment without removing the Docker-health startup dependency or adding a boot-script fast path. Verification provenance: the timing and observed 503 come from your supplied live test of 00e6bc6, not an execution during this review. The new host-stop tests use immediately closing fixture components and a local Machines API; they do not exercise container startup ordering or first-request latency. Successful stop acknowledgements therefore do not prevent this failure.

  • Minimum fix: Remove the app’s dependency on Docker becoming healthy so the API can listen promptly, while keeping Docker agent execution behind worker readiness or retry handling. Instrument boot-script steps and add a safe fast path for an already correctly sized, clean filesystem. Add generated-config and boot-fast-path tests. Update the PR description to identify the first-request 503 as awaiting your live re-check; exercise /health and the implemented POST /wake contract.

Suggestions

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

No suggestions.

Score

The shutdown contract has strong coverage and live confirmation, but the confirmed first-wake request failure blocks the newly enabled legacy Docker deployment from merging.

Score: 6/10


🤖 Review Details

  • Model: GPT-6 Astra
  • Time: 40s
  • Tokens: 193,709 (192,879 in / 830 out)
  • Cost: $1.86
  • Review scope: Partial — 1 file was omitted by the review context budget.

View Task

Files omitted from review diff

1 file was omitted from the review diff. Large, binary, generated, and lockfile changes are deprioritized.

Did not fit the review context budget

  • test/idleShutdownDrain.test.ts

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

🤖 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 6acc573

Addressed 1 AI review comment (IDs: 7136063910)

Addressed finding F34

Summary of Changes

I've fixed the 503 on the first wake request in --legacy-docker mode (F34). Unit tests pass, but nothing has run on a real Fly Machine yet, so the fix still needs your live re-check.

(a) The app no longer waits for the docker container

  • In the generated Machine config the app container now waits only for Redis to be healthy (flyMachineConfig.ts). The API starts right away, so /health, POST /wake and the request that woke the Machine are answered while dockerd is still starting.
  • The worker waits for Docker instead. The deploy sets PROPR_DOCKER_STARTUP_WAIT_SECONDS=300 for the app container. With it set, the worker checks the Docker API once a second before it prepares agent images or takes a task (src/workerDockerReadiness.ts, called first in startWorker). A shutdown cancels the wait. After 5 minutes the worker carries on with its existing image recovery. Without the variable there is no wait, so other deployments are unchanged.
  • Without this wait, a dockerd that was still booting would have looked like a failed image build and used up the registry's retry budget.
  • Redeploys drop the old docker dependency: flyctl decodes a shorter depends_on list into the live one and truncates it, and the Machines API path sends the whole config.

(b) dockerd boot script

  • Step timing: every step now logs a line like propr-dockerd-boot: <step> (+Xs, machine uptime Ys). The steps are script start, superblock read, e2fsck, resize, mount and "starting dockerd". The uptime matches Fly's "Machine started" time.
  • I couldn't find what takes the 34 s. On scratch images, a clean e2fsck -p and dumpe2fs each take milliseconds. dockerd's own startup is a likely cause, but I haven't confirmed it. Your next wake log will show the split: if most of the time comes after "starting dockerd" and before "API listen", it is dockerd itself.
  • Fast path: the script reads the superblock once. If the filesystem was cleanly unmounted, needs no journal recovery, has no mount-count or periodic check due, and already fills the image, it skips e2fsck and resize2fs and mounts straight away. In any other state it runs the same repair and grow steps as before.
  • The disk steps also work under busybox 1.35 sh/awk, the shell docker:dind uses, for these cases: fresh image, clean image, not-clean image, and growth.

Tests

  • Machine config: the app depends only on Redis, and no container depends on docker. This holds in both the Machines API and flyctl config shapes, with and without idle shutdown. The wait variable is set only in legacy mode.
  • Boot script: these run against real ext4 images, with wrappers that record every e2fsck/resize2fs call. Covered: the clean full-size fast path with no repair calls, a not-clean image being checked, a journal needing recovery, a mount-count check that is due, a clean but undersized image being grown, and the order and format of the timing lines.
  • Worker wait (test/workerDockerReadiness.test.ts): off by default, a daemon that answers after 34 s, the deadline, cancellation on shutdown, and invalid values.
  • Results: the CLI deploy suites pass (137 tests), and so do the worker, agent preparation and all-in-one suites (40). CLI and root typecheck and root lint are clean.

I updated deploy-fly.md, the configuration reference and the changelog. There are no visual changes, so no previews.

For the PR description (I haven't edited it): the first wake request returning 503 in legacy Docker mode needs your live re-check. Check that GET /health and POST /wake on a stopped Machine answer well within about 45 s. Check the propr-dockerd-boot: timing lines and that the worker logs Docker API is reachable before any Docker agent runs. On a clean wake, look for "skipping e2fsck and resize2fs".

Separate finding, not changed: before the API starts listening, it runs a sweep for leftover agent login containers through Docker. While dockerd is down, that call should be refused at once and logged as Could not sweep orphaned agent login containers, so it shouldn't delay startup. On those wakes the sweep simply doesn't happen.

Review digest

Risk-tiered paths

  • High risk: none
  • Normal risk (4 files)
    • packages/cli/src/commands/deploy/flyLegacyDocker.ts (+77/−8)
    • packages/cli/src/commands/deploy/flyMachineConfig.ts (+5/−3)
    • src/worker.ts (+4/−0)
    • src/workerDockerReadiness.ts (added, +90/−0)
  • Low risk (6 files)
    • CHANGELOG.md (+7/−0)
    • docs/docs/operations/configuration-reference.md (+1/−0)
    • docs/docs/operations/deploy-fly.md (+3/−1)
    • packages/cli/src/commands/deploy/flyLegacyDocker.test.ts (+83/−1)
    • packages/cli/src/commands/deploy/flyMachineConfig.test.ts (+22/−1)
    • test/workerDockerReadiness.test.ts (added, +91/−0)

Diff size: 10 files changed, +383/−14 lines


🤖 Implementation Details

  • Model: Claude Opus 5.5 (medium)
  • Requested By: @propr-ultrafix
  • Time: 11m 35s
  • Tokens: 4,715,744 (4,682,568 in / 33,176 out)
  • Cost: $2.21
  • 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've fixed the 503 on the first wake request in `--legacy-docker` mode (F34). Unit tests pass, but nothing has run on a real Fly Machine yet, so the fix still needs your live re-check.

**(a) The app no longer waits for the docker container**
- In the generated Machine config the app container now waits only for Redis to be healthy (`flyMachineConfig.ts`). The API starts right away, so `/health`, `POST /wake` and the request that woke the Machine are answered while dockerd is still starting.
- The worker waits for Docker instead. The deploy sets `PROPR_DOCKER_STARTUP_WAIT_SECONDS=300` for the app container. With it set, the worker checks the Docker API once a second before it prepares agent images or takes a task (`src/workerDockerReadiness.ts`, called first in `startWorker`). A shutdown cancels the wait. After 5 minutes the worker carries on with its existing image recovery. Without the variable there is no wait, so other deployments are unchanged.
- Without this wait, a dockerd that was still booting would have looked like a failed image build and used up the registry's retry budget.
- Redeploys drop the old docker dependency: flyctl decodes a shorter `depends_on` list into the live one and truncates it, and the Machines API path sends the whole config.

**(b) dockerd boot script**
- **Step timing:** every step now logs a line like `propr-dockerd-boot: <step> (+Xs, machine uptime Ys)`. The steps are script start, superblock read, e2fsck, resize, mount and "starting dockerd". The uptime matches Fly's "Machine started" time.
- **I couldn't find what takes the 34 s.** On scratch images, a clean `e2fsck -p` and `dumpe2fs` each take milliseconds. dockerd's own startup is a likely cause, but I haven't confirmed it. Your next wake log will show the split: if most of the time comes after "starting dockerd" and before "API listen", it is dockerd itself.
- **Fast path:** the script reads the superblock once. If the filesystem was cleanly unmounted, needs no journal recovery, has no mount-count or periodic check due, and already fills the image, it skips `e2fsck` and `resize2fs` and mounts straight away. In any other state it runs the same repair and grow steps as before.
- The disk steps also work under busybox 1.35 `sh`/`awk`, the shell `docker:dind` uses, for these cases: fresh image, clean image, not-clean image, and growth.

**Tests**
- **Machine config:** the app depends only on Redis, and no container depends on docker. This holds in both the Machines API and flyctl config shapes, with and without idle shutdown. The wait variable is set only in legacy mode.
- **Boot script:** these run against real ext4 images, with wrappers that record every `e2fsck`/`resize2fs` call. Covered: the clean full-size fast path with no repair calls, a not-clean image being checked, a journal needing recovery, a mount-count check that is due, a clean but undersized image being grown, and the order and format of the timing lines.
- **Worker wait (`test/workerDockerReadiness.test.ts`):** off by default, a daemon that answers after 34 s, the deadline, cancellation on shutdown, and invalid values.
- Results: the CLI deploy suites pass (137 tests), and so do the worker, agent preparation and all-in-one suites (40). CLI and root typecheck and root lint are clean.

I updated `deploy-fly.md`, the configuration reference and the changelog. There are no visual changes, so no previews.

**For the PR description** (I haven't edited it): the first wake request returning 503 in legacy Docker mode needs your live re-check. Check that `GET /health` and `POST /wake` on a stopped Machine answer well within about 45 s. Check the `propr-dockerd-boot:` timing lines and that the worker logs `Docker API is reachable` before any Docker agent runs. On a clean wake, look for "skipping e2fsck and resize2fs".

**Separate finding, not changed:** before the API starts listening, it runs a sweep for leftover agent login containers through Docker. While dockerd is down, that call should be refused at once and logged as `Could not sweep orphaned agent login containers`, so it shouldn't delay startup. On those wakes the sweep simply doesn't happen.

PR: #3772
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 4/4

Please investigate and fix this CI failure.

  • Check: Full Test Suite Shard 4/4
  • Result: failure
  • Commit: 6acc573c31af (6acc573c31affa2a8d6c1eddcdbb9cb83d439129)
  • Run: View CI failure

Failure evidence

.github:11
Process completed with exit code 1.

.github:47090
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 ba7a415

Summary of Changes

I fixed the Shard 4/4 failure, which was a flaky test, not a bug in the idle-shutdown code. The only shard 4 failure was one test in test/idleShutdownDrain.test.ts: "a Connect wake ping answered after intake disconnects aborts the drain…". The drain did not abort when the test expected it to.

Cause: the shared test setup (composedWithApi) records idleSince = Date.now(), and the test's request arrives a few synchronous steps later. The drain only counts a request that arrives strictly after idleSince (last > idleSince, in whole milliseconds). Because the test's Redis is a fast in-memory fake, the request sometimes lands in the same millisecond. The drain then misses it and stops the instance. Debug output from a passing run showed the gap: idleSince …586 and the ping at …587. A failing run happens when that gap is zero. In a real deployment idleSince is minutes in the past, so production code is not affected.

Fix (test only): after composedWithApi records idleSince, it now waits until the clock has moved past it, so every request a test makes is strictly later. This also covers the other tests built on the same setup, which have the same race (for example "a request the quiesced API turns away…" and "…calls the stop off (exit 1)…").

Verification, full-file runs here:

  • Before the fix: 2 of 6 runs failed on this test, the same way as in CI.
  • After the fix: 4 of 4 runs passed, 50/50 tests each. The loop was meant to run 6 times but hit the 10-minute background limit after 4, so the last 2 never ran.

I didn't re-run the whole CI shard locally. The new CI run will confirm it.

The change is in test/idleShutdownDrain.test.ts. There's nothing to see in the UI, so I made no previews.

Review digest

Risk-tiered paths

  • High risk: none
  • Normal risk: none
  • Low risk (1 file)
    • test/idleShutdownDrain.test.ts (+3/−0)

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


🤖 Implementation Details

  • Model: Claude Opus 5.5 (medium)
  • Requested By: @propr-dev[bot]
  • Time: 21m 1s
  • Tokens: 2,576,118 (2,575,093 in / 1,025 out)
  • Cost: $0.99
  • Subscription usage: Weekly +1%, Fable +1%

Undo Changes • View Task Execution


💡 ProPR Slash Commands
Command Description Example
/merge Merge target branch into this PR and resolve conflicts /merge
/review Request an AI code review /review or /review claude-sonnet
/fix Address review blockers, or blockers and suggestions with /fix all /fix, /fix all, or /fix F3 S5
/switch Change the AI model for this PR /switch claude-opus
/use Override the model for a single follow-up run /use claude-sonnet
/ultrafix Loop review→fix cycles until score goal is met /ultrafix or /ultrafix goal=8 max=10

🤖 Generated by ProPR
Processing comment ID: 7136783651✓

I fixed the Shard 4/4 failure, which was a flaky test, not a bug in the idle-shutdown code. The only shard 4 failure was one test in `test/idleShutdownDrain.test.ts`: "a Connect wake ping answered after intake disconnects aborts the drain…". The drain did not abort when the test expected it to.

**Cause:** the shared test setup (`composedWithApi`) records `idleSince = Date.now()`, and the test's request arrives a few synchronous steps later. The drain only counts a request that arrives strictly after `idleSince` (`last > idleSince`, in whole milliseconds). Because the test's Redis is a fast in-memory fake, the request sometimes lands in the same millisecond. The drain then misses it and stops the instance. Debug output from a passing run showed the gap: `idleSince` …586 and the ping at …587. A failing run happens when that gap is zero. In a real deployment `idleSince` is minutes in the past, so production code is not affected.

**Fix (test only):** after `composedWithApi` records `idleSince`, it now waits until the clock has moved past it, so every request a test makes is strictly later. This also covers the other tests built on the same setup, which have the same race (for example "a request the quiesced API turns away…" and "…calls the stop off (exit 1)…").

**Verification, full-file runs here:**
- **Before the fix:** 2 of 6 runs failed on this test, the same way as in CI.
- **After the fix:** 4 of 4 runs passed, 50/50 tests each. The loop was meant to run 6 times but hit the 10-minute background limit after 4, so the last 2 never ran.

I didn't re-run the whole CI shard locally. The new CI run will confirm it.

The change is in `test/idleShutdownDrain.test.ts`. There's nothing to see in the UI, so I made no previews.

PR: #3772
Comment by: @propr-dev[bot] (ID: 7136783651)
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 implements opt-in idle detection, coordinated shutdown, and whole-Machine stopping on Fly. The current diff addresses the reported Docker startup dependency, and I found no verified code blocker in the supplied changes. Merge readiness remains unconfirmed pending the requested live first-request wake re-check.

✅ Whole-Machine shutdown — The idle path calls the Machines API; refused or timed-out stops exit 1. Child-process tests cover acceptance, rejection, timeout, and SIGTERM during the stop.

✅ Earlier API startup — Generated Machine configuration removes the Docker health dependency. The worker separately waits for Docker, with tests covering readiness, timeout, and cancellation.

✅ Conservative disk fast path — The boot script checks filesystem state, journal recovery, check requirements, and filesystem size before skipping repair. Tests cover clean images, recovery, and interrupted growth.

This review is partial: test/idleShutdownDrain.test.ts and docs/docs/operations/idle-shutdown.md were explicitly omitted. I ran no commands or tests. The supplied current-head status reports 30 passed, four pending, and no failed checks; historical failures are not current blockers.

Merge blockers

No merge blockers.

Suggestions

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

S34: 🟢 Refresh displayed idle status

propr-ui/src/pages/SettingsPage/IdleShutdownSection.tsx fetches settings only on mount and after saving. Consequently, blockers, shutdown timing, and wake information can remain stale while the section stays open, despite the daemon refreshing its status every 30 seconds. An explicit refresh action or integration with the existing live-update mechanism would improve diagnostics. This is optional because it does not affect the detector or shutdown behavior.

S35: 🟢 Report duration override provenance

In packages/shared/src/idleShutdown.ts, resolveIdleShutdownConfig changes source to environment only when the switch is set. Setting only PROPR_IDLE_SHUTDOWN_AFTER therefore leaves the source as default or settings, although the environment controls the duration and locks the UI. Clarifying field-level provenance would make status and CLI explanations more accurate. The effective duration and environment lock already work, so this is a diagnostic follow-up.

Score

The changed implementation includes substantial failure-path coverage and addresses the demonstrated startup dependency. However, successful first-request wake behavior on the real Fly legacy-Docker deployment still needs the explicitly requested live re-check.

Score: 7/10


🤖 Review Details

  • Model: GPT-6 Astra
  • Time: 1m 1s
  • Tokens: 196,860 (195,529 in / 1,331 out)
  • Cost: $1.89
  • Review scope: Partial — 2 files were omitted by the review context budget.

View Task

Files omitted from review diff

2 files were omitted from the review diff. Large, binary, generated, and lockfile changes are deprioritized.

Did not fit the review context budget

  • test/idleShutdownDrain.test.ts
  • docs/docs/operations/idle-shutdown.md

💡 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 S34 S35

🤖 Review by ProPR

@propr-dev

propr-dev Bot commented Nov 24, 2026

Copy link
Copy Markdown
Contributor Author

⚠️ Ultrafix stopped before reaching its goal. Requested goal: 8/10. Last score: 7/10. Stopped in cycle 2 of 5. The latest review had partial diff coverage, so it cannot establish merge readiness. Manual review and merge are now required.

@propr-dev propr-dev Bot removed the ultrafix label Nov 24, 2026
@propr-dev propr-dev Bot changed the title 🔨 [3770 by Claude Opus 5.5] Opt-in idle shutdown and wake for the control plane ⚠️❼ [3770 by Claude Opus 5.5] Opt-in idle shutdown and wake for the control plane Nov 24, 2026
@integry

integry commented Nov 24, 2026

Copy link
Copy Markdown
Owner

Live re-check of ba7a415 on the Fly Free plan (legacy Docker, --idle-shutdown 2m, ams)

The merge blocker from the last live test is fixed.

Check Before (00e6bc6) Now (ba7a415)
Generated depends_on app waits on docker healthy app waits on redis healthy only
First GET /wake on a stopped Machine 503 after 45.1 s 200 after 19.6 s
Warm /health 200 in 0.09 s
Docker agents after a wake docker run --rm alpine echo from the app container prints agent-ok; the worker reaches dockerd once it is up
Idle stop stopped event log: start (proxy) at 18:42:33, app logs reason: idle… and host accepted the idle stop; exiting, Machine stopped exit_code=0 requested_stop=true at 18:45:38

Side note, not a defect: redeploying while the Machine is stopped leaves it stopped (update and promote while stopped). The next HTTP request starts it, as expected with idle shutdown on.

S32 is closed. Requesting a re-review with this taken into account.

integry commented Nov 24, 2026

Copy link
Copy Markdown
Owner

/review

Re-review, taking into account the live Fly verification posted on this PR, the comment titled "Live re-check of ba7a415". On a real Free-plan Fly Machine, the first /wake on a stopped Machine now returns 200 after 19.6 s instead of 503. Docker agents work after the wake. The full idle cycle (proxy start, idle detector, Machines API stop, whole Machine stopped with exit 0) passed. That closes the S32 live-verification gap.

@propr-dev propr-dev Bot changed the title ⚠️❼ [3770 by Claude Opus 5.5] Opt-in idle shutdown and wake for the control plane 🔨 [3770 by Claude Opus 5.5] Opt-in idle shutdown and wake for the control plane Nov 24, 2026
@propr-dev

propr-dev Bot commented Nov 24, 2026 •

Copy link
Copy Markdown
Contributor Author

✅ AI Code Review Complete requested by @integry

Posted 1 review:

View Task Details

@propr-dev

propr-dev Bot commented Nov 24, 2026

Copy link
Copy Markdown
Contributor Author

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

Overall Evaluation

Merge-ready within the supplied review scope. The implementation covers idle detection, coordinated shutdown, recovery, and whole-Machine stopping on Fly.

✅ Whole-Machine stop verified — The supplied live verification for ba7a415 confirms proxy wake, working Docker agents after wake, and a complete idle stop with exit_code=0 and requested_stop=true. This closes S32.

✅ Conservative shutdown decisions — Unreadable settings and signals block shutdown. Connect must acknowledge the wake hint, and replay obligations persist across aborted drains and restarts.

✅ Bounded shutdown and recovery — The changed exit path bounds component shutdown and uses exit 1 when an idle stop cannot safely complete. Current-head checks report 35 passed and no failures.

This was a static review; no commands were run. The supplied diff explicitly omits test/idleShutdownDrain.test.ts and docs/docs/operations/idle-shutdown.md, so those files were not assessed.

Merge blockers

No merge blockers.

Suggestions

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

S36: 🟢 Update the cold-start estimate

propr-ui/src/pages/SettingsPage/IdleShutdownSection.tsx promises waking takes “about 5–10 seconds,” whereas the supplied successful live test took 19.6 seconds. Qualifying that estimate by deployment would set more accurate expectations. This is informational copy and does not invalidate the verified wake behavior.

S37: 🟢 Refresh displayed idle status

propr-ui/src/pages/SettingsPage/IdleShutdownSection.tsx fetches status only on mount and after saving. Consequently, blockers and timestamps remain unchanged while the section stays open, despite daemon updates every 30 seconds. An explicit refresh control or integration with existing status updates would improve observability; shutdown correctness does not depend on this display.

Score

The supplied code and current checks support merging, and the reported live Fly cycle resolves the previous deployment-verification gap. The review is limited to the supplied source changes and excludes the two explicitly omitted files.

Score: 8/10


🤖 Review Details

  • Model: GPT-6 Astra
  • Time: 43s
  • Tokens: 195,490 (194,663 in / 827 out)
  • Cost: $1.86
  • Review scope: Partial — 2 files were omitted by the review context budget.

View Task

Files omitted from review diff

2 files were omitted from the review diff. Large, binary, generated, and lockfile changes are deprioritized.

Did not fit the review context budget

  • test/idleShutdownDrain.test.ts
  • docs/docs/operations/idle-shutdown.md

💡 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 S36 S37

🤖 Review by ProPR

@propr-dev propr-dev Bot changed the title 🔨 [3770 by Claude Opus 5.5] Opt-in idle shutdown and wake for the control plane ✅❽ [3770 by Claude Opus 5.5] Opt-in idle shutdown and wake for the control plane Nov 24, 2026
@integry
integry merged commit bdabf61 into 3758-epic-runtime-abstraction-sc0 Nov 24, 2026
50 checks passed
@propr-dev propr-dev Bot changed the title ✅❽ [3770 by Claude Opus 5.5] Opt-in idle shutdown and wake for the control plane [3770 by Claude Opus 5.5] Opt-in idle shutdown and wake for the control plane Nov 24, 2026
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