Repository navigation
Description
Part of the runtime abstraction epic (plan "Runtime abstraction and lighter footprint", #3758–#3769). Depends on #3763 (slim control plane). Feeds #3768 (propr deploy fly) and #3769 (Fly docs + E2E). Paired with integry/propr-routing wake-ping issue (linked below).
Why
On small or metered hosts (a 1 GB Fly Machine costs ~$6.94/mo always-on, more than the Free plan's $5), the control plane should be able to stop when there is nothing to do and start again on demand. Example budget with this in place: control plane awake ~4 h/day ≈ $1.14, storage ≈ $0.40, leaving ~$2.40+ for agent runs on Sprites. It also suits home servers and laptops (wake-on-LAN, systemd socket activation).
Opt-in only. Default behaviour stays unchanged: the control plane runs continuously unless an operator explicitly enables idle shutdown.
Acceptance
- New setting, off by default:
PROPR_IDLE_SHUTDOWN=off|onplusPROPR_IDLE_SHUTDOWN_AFTER(e.g.15m). Exposed in.env, Web UI settings (instance admin) andpropr check. - Idle detector considers: running or queued jobs (BullMQ, all queues), active agent runs on any runtime, open Web UI/Socket.IO sessions, in-flight MCP requests, pending followup handoffs, Connect deliveries being processed, and the next scheduled item (automations, goals, polling, ultrafix loops). Not idle if anything is due within the shutdown window.
- When idle for the configured time: drain gracefully (stop accepting new work, finish acks, close Connect socket cleanly, flush logs, close SQLite/Redis), then exit with code 0 so a supervisor can stop the host (Fly restart policy
on-failure, systemd, etc.). - Before exiting, publish a wake hint: the next due time for scheduled work, sent to Connect (see linked propr-routing issue) and written locally for other supervisors.
- On start, recover cleanly: reconnect Connect, drain the Connect replay cache for deliveries received while stopped, resume scheduled work that became due during sleep (at most once).
- Fly specifics, documented and generated by
propr deploy fly:auto_stop_machines = "off"(Fly proxy autostop is traffic-based and would stop the Machine during an agent run),auto_start_machines = trueso HTTP to the UI/API/MCP/webhook URL starts it, restart policyon-failure. - Metrics/logs: last idle shutdown, reason, wake source (HTTP, Connect ping, schedule), cold-start duration.
- Tests: idle detector unit tests per signal; integration test that a queued job, open UI session or due schedule prevents shutdown; restart recovery test.
Notes
- Expected cold start: Machine start plus Node boot, roughly 5–10 s. Acceptable for jobs that take minutes; document it.
- Connect already keeps offline deliveries (free tier: newest 25 for 1 h; paid: 500 for 24 h,
propr-routing/src/relayTier.ts). Confirm whether replay on reconnect is automatic or needs to be requested, and handle both.
Activity
integry commentedon Nov 24, 2026
Paired Connect work: https://github.com/integry/propr-routing/issues/335
propr-dev commentedon Nov 24, 2026
🤖 AI processing has started for this issue using claude agent with claude-opus-5-5 model.
I'll analyze the problem and work on a solution. This may take a few minutes.
Processing Details:
claudeclaude-opus-5-53770/claude-opus-5-5-opt-in-idle-shutdown-and--20261124-0023-b3m3758-epic-runtime-abstraction-sc0issue-3770-20261124-0023-claude-opus-5-5-b3m🔍 Track Task Execution
feat: refuse Fly --idle-shutdown until the image supports it
[3768 by Claude Opus 5.5] `propr deploy fly`: control plane on a Fly …
integry commentedon Dec 1, 2026
Done in #3772, which merged into the runtime epic; the epic merged into
mainwith #3774 and ships in 0.9.4.