Skip to content

feat: add workspace keepalive service to prevent Fly.io idle#132

Merged
khaliqgant merged 1 commit intomainfrom
claude/flyio-idle-detection-RIuV9
Jan 10, 2026
Merged

feat: add workspace keepalive service to prevent Fly.io idle#132
khaliqgant merged 1 commit intomainfrom
claude/flyio-idle-detection-RIuV9

Conversation

@khaliqgant
Copy link
Copy Markdown
Member

Implements cloud-to-workspace heartbeat mechanism to prevent Fly.io
from idling machines that have active agents running.

Problem: Fly.io uses request-based concurrency tracking. When Claude
is running but no user has the dashboard open, there are no inbound
HTTP requests, so Fly may idle the machine.

Solution:

  • Add /keep-alive endpoint on workspace dashboard server
  • Create WorkspaceKeepaliveService that pings workspaces every 60s
  • Only pings workspaces that have online daemons with active agents
  • Inbound ping counts as activity for Fly's idle detection

The service:

  • Queries all running workspaces with public URLs
  • Checks each workspace's daemons for online status and active agents
  • Pings /keep-alive endpoint which responds with active agent count
  • Stops pinging when no agents are active (allowing normal idle)

Implements cloud-to-workspace heartbeat mechanism to prevent Fly.io
from idling machines that have active agents running.

Problem: Fly.io uses request-based concurrency tracking. When Claude
is running but no user has the dashboard open, there are no inbound
HTTP requests, so Fly may idle the machine.

Solution:
- Add /keep-alive endpoint on workspace dashboard server
- Create WorkspaceKeepaliveService that pings workspaces every 60s
- Only pings workspaces that have online daemons with active agents
- Inbound ping counts as activity for Fly's idle detection

The service:
- Queries all running workspaces with public URLs
- Checks each workspace's daemons for online status and active agents
- Pings /keep-alive endpoint which responds with active agent count
- Stops pinging when no agents are active (allowing normal idle)
@khaliqgant khaliqgant merged commit 8241f2e into main Jan 10, 2026
6 checks passed
@khaliqgant khaliqgant deleted the claude/flyio-idle-detection-RIuV9 branch January 10, 2026 16:39
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.

2 participants