Skip to content

flyctl's ~/.fly/agent-logs grows without bounds (no rotation/garbage collection) #5046

Description

@adam-symbolica

Summary

My system specifics for bug report
OS: macOS 26.6 (25G72), darwin/arm64
flyctl: v0.4.78 darwin/arm64 (commit e5cda84, 2026-08-03)

Issue

fly agent run writes stdout/stderr to ~/.fly/agent-logs/<id>.log for the agent's lifetime with no rotation, size cap, or GC.

Repro:

  1. concurrent fly ssh across many isolated-network apps grew a single agent log to hundreds of GB.
  2. After rm of agent-logs/*, the still-running agent kept the unlinked FD open and continued growing (~37 GB until fly agent restart).

Proposal

  1. On agent start: create the new log; prune old ~/.fly/agent-logs/*.log (keep last N=10, same idea as ~/.fly/logs).
  2. While running: bound the active file (rotate/re-open at e.g. 100–500 MB and prune). File-count retention alone is not enough, one process == one log for hours/days.
  3. Docs: note in fly agent help / doctor that these files are diagnostic, bounded, and safe to delete (rm + fly agent restart).

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions