Skip to content

feat(assistants): recycle fly.io machines on runtime image upgrade#2701

Merged
danielkov merged 2 commits into
mainfrom
daniel/age-2215-propagate-assistant-runtime-image-updates-to-flyio
May 10, 2026
Merged

feat(assistants): recycle fly.io machines on runtime image upgrade#2701
danielkov merged 2 commits into
mainfrom
daniel/age-2215-propagate-assistant-runtime-image-updates-to-flyio

Conversation

@danielkov
Copy link
Copy Markdown
Contributor

Summary

  • When a fly.io assistant runtime machine is running an older image than the configured runtime image, the next admission upgrades it in place via flaps Update — same machine ID, same app, same allocated IPs, fresh boot. The runner's /configure reapplies on first request after the reboot.
  • Mid-turn safety: gated on the runner's /state idle clock. If idle_seconds == 0 (turn in flight), the upgrade is deferred so the next admission catches the runner idle. Stopped/suspended machines and unreachable runners recycle directly.
  • Defensive: empty ImageRef (partial flaps response) skips recycling rather than guessing.

Closes AGE-2215.

✻ Clauded...

danielkov added 2 commits May 8, 2026 21:40
When the configured assistant runtime image diverges from the image a
provisioned fly machine is running, Ensure now triggers an in-place
flaps Update so the next admission picks up the new version. The
existing app and allocated IPs survive — only the machine reboots.

Recycling is gated on the runner's /state idle clock: when a turn is
in flight (idle_seconds == 0) the upgrade is deferred so the next
admission catches the runner idle. Stopped/suspended machines and
unreachable runners recycle directly.
@danielkov danielkov requested a review from a team as a code owner May 8, 2026 20:42
Copy link
Copy Markdown

@claude claude Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Claude Code Review

This repository is configured for manual code reviews. Comment @claude review to trigger a review and subscribe this PR to future pushes, or @claude review once for a one-time review.

Tip: disable this comment in your organization's Code Review settings.

@linear-code
Copy link
Copy Markdown

linear-code Bot commented May 8, 2026

AGE-2215

@vercel
Copy link
Copy Markdown

vercel Bot commented May 8, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
gram-docs-redirect Ready Ready Preview, Comment May 8, 2026 8:42pm

Request Review

@changeset-bot
Copy link
Copy Markdown

changeset-bot Bot commented May 8, 2026

🦋 Changeset detected

Latest commit: 0392771

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
server Minor

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

Comment thread server/internal/assistants/runtime_fly.go
@danielkov danielkov enabled auto-merge May 10, 2026 20:31
@danielkov danielkov added this pull request to the merge queue May 10, 2026
Merged via the queue into main with commit ca625e0 May 10, 2026
31 checks passed
@danielkov danielkov deleted the daniel/age-2215-propagate-assistant-runtime-image-updates-to-flyio branch May 10, 2026 20:37
@github-actions github-actions Bot locked and limited conversation to collaborators May 10, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants