Skip to content

Keep the agent warm — Fly's proxy won't wait for it to boot - #279

Merged
Sbussiso merged 1 commit into
masterfrom
agent-keep-warm
Sep 9, 2026
Merged

Keep the agent warm — Fly's proxy won't wait for it to boot#279
Sbussiso merged 1 commit into
masterfrom
agent-keep-warm

Conversation

@Sbussiso

@Sbussiso Sbussiso commented Sep 9, 2026

Copy link
Copy Markdown
Contributor

Found by re-testing the cold-start path after #278 rather than trusting the fix.

Fly's proxy waits ~8s for an auto-started machine to bind its port. This process doesn't make it:

boot time wakeup
before LiteLLM ~7s fit, barely
after LiteLLM ~16s RemoteDisconnected
after deferring the import (#278) ~10s still RemoteDisconnected

So #278 was necessary but not sufficient — and that 7s figure means this was always marginal and happened to fit. LiteLLM only exposed it. The remaining time is Python + the MCP SDK + Sentry, and trimming that further is tuning against a proxy timeout we don't control and can only observe in production.

Keeping one 512 MB machine warm is ~$2/month — noise against the LLM cost of a single run — and it removes cold starts from the wakeup path rather than racing them. Scale-to-zero was the right shape when the agent was its own app answering a public webhook; it isn't worth this.

🤖 Generated with Claude Code

The agent scaled to zero, and every wakeup against a stopped machine
failed with RemoteDisconnected. Fly's proxy waits ~8s for an
auto-started machine to bind its port; this process takes longer:

  before LiteLLM   ~7s   (fit, barely)
  after LiteLLM    ~16s  (broke)
  after deferring litellm's import  ~10s  (still broke)

So deferring the import was necessary but not sufficient, and the 7s
figure says this was always marginal — LiteLLM only exposed it. The
remaining time is Python plus the MCP SDK plus Sentry, and trimming that
further means tuning against a proxy timeout we do not control and can
only observe in production.

Keeping one 512MB machine warm costs about $2/month — noise against the
LLM spend of a single run — and removes cold starts from the wakeup path
instead of racing them. Scale-to-zero was the right shape when the agent
was its own app answering a public webhook; it is not worth this.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@Sbussiso
Sbussiso merged commit 006389c into master Sep 9, 2026
12 checks passed
@Sbussiso
Sbussiso deleted the agent-keep-warm branch September 9, 2026 20:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant