From 7ab59f6eda1331e42b68e07e7c1367b006c3524a Mon Sep 17 00:00:00 2001 From: Jason Lunder Date: Thu, 2 Jul 2026 21:05:31 -0700 Subject: [PATCH] feat(infra): fly.toml min_machines_running 1->0 for webhook mode (Phase 3b) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Lets the fly machine itself suspend when idle instead of staying up 24/7 for Telegram bot long-polling. Webhook mode is already fully wired (per-user secret registration in api/main.py lifespan, POST /bot/telegram-webhook handler, supervisord [program:bot] already switches to sleep infinity when TELEGRAM_WEBHOOK_URL is set) — this is the last config flip. DO NOT MERGE until staging cold-start is verified. Runbook: cc-context-store/tether/docs/infra/webhook-staging-verification.md --- fly.toml | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/fly.toml b/fly.toml index db06049a..c1fe7f3f 100644 --- a/fly.toml +++ b/fly.toml @@ -15,9 +15,12 @@ primary_region = "sjc" force_https = true auto_stop_machines = "suspend" auto_start_machines = true - # bot long-polling requires a persistent connection — set to 0 once - # Telegram webhook mode ships (Phase 3b) - min_machines_running = 1 + # Telegram webhook mode (Phase 3b) lets the machine itself sleep — the bot + # no longer needs a persistent long-polling connection when + # TELEGRAM_WEBHOOK_URL is set (see supervisord.conf [program:bot]). + # DO NOT MERGE this change until staging cold-start has been verified — + # see cc-context-store/tether/docs/infra/webhook-staging-verification.md + min_machines_running = 0 [env] PYTHON_ENV = "production"