avelino/dotagent

Add plugin: `preflight-disk-space` (abort below free-space threshold)

Open

#20 opened on 2026年5月20日

GitHub で見る
 (0 comments) (0 reactions) (0 assignees)Rust (1 fork)github user discovery
area: pluginsgood first issuetype: feature

Repository metrics

Stars
 (2 stars)
PR merge metrics
 (PR metrics pending)

説明

Agents that write reports, dumps, or logs can fail mid-run with ENOSPC, leaving partial state. The examples/disk-alert/ agent already monitors disk space, but there is no preflight that prevents an agent from starting when disk is below a threshold.

Proposal

A new plugin preflight-disk-space that aborts an agent run if free space on a target volume is below a configurable threshold.

Manifest usage:

[[preflight]]
plugin = "preflight-disk-space"
path = "/Users/me/reports"
min_free_gb = 5            # abort if free space < 5 GiB
# or:
min_free_percent = 10      # abort if less than 10% free

Acceptance criteria

  • New plugin crate under plugins/preflight-disk-space/ following the convention of preflight-cmd.
  • Both absolute (min_free_gb) and percentage (min_free_percent) thresholds work; either or both.
  • When both are set, abort if either is breached.
  • suggest field on abort names which volume is full and how much short it is.
  • Works on macOS and Linux (use statvfs or equivalent cross-platform crate).
  • Doc page under docs/plugins/preflight-disk-space.md.
  • Registered in the workspace Cargo.toml.

Where to start

  • plugins/preflight-cmd/ — convention to copy.
  • docs/reference/plugin-protocol.md — protocol.
  • examples/disk-alert/ — the existing reactive disk agent for inspiration.

Non-goals

  • Inode exhaustion checks (separate failure mode, future plugin).
  • Mount-point health beyond free space.

コントリビューターガイド