Skip to content

Stop watching the disk's free space - #77

Merged
fylorn merged 1 commit into
mainfrom
feat/no-disk-watch
Sep 21, 2026
Merged

fylorn merged 1 commit into
mainfrom
feat/no-disk-watch

Conversation

@fylorn

@fylorn fylorn commented Sep 21, 2026

Copy link
Copy Markdown
Contributor

How full the user's disk is belongs to the operating system, not to an AI gateway. The gateway's job is to keep its own footprint bounded, and it already does: request bodies are collected after 7 days or past 2 GB, request summaries after 90 days.

Until now the recorder also polled statvfs every 30 seconds, stopped saving bodies below 1 GB free, stopped recording altogether below 200 MB, and announced each change as StorageChanged so the desktop app could raise a notice about it. That is gone.

What changes

  • tw_store::disk is removed, along with the recorder's level, its periodic check, the three tests that exercised it, and tw-store's direct libc dependency.
  • Event::StorageChanged is removed.
  • StorageStatus.level (ok / metadata_only / stopped / unavailable) becomes recording: bool. With the disk levels gone, the only thing left to say is whether recording started at all.
  • The diagnostics bundle drops its "Disk state" row.

On a full disk

A body or row that cannot be written is logged at debug level and dropped, the same as any other recorder error; forwarding never went through this layer. forwarding_affected stays false.

Protocol

CONTROL_API_VERSION stays at 3. A client built against the old shape fails to parse /storage and treats it as absent, which only hides a banner; nobody sends or expects storage_changed any more. The desktop app follows in the same release.

🤖 Generated with Claude Code

The recorder polled statvfs every 30 seconds, dropped request bodies below
1 GB free and stopped recording below 200 MB, and announced each change as
`StorageChanged`. How full the user's disk is belongs to the operating
system, not to an AI gateway; what the gateway owns is its own footprint,
and that is already bounded: bodies are collected by age and total size,
summaries by age. A write that fails on a full disk is logged and dropped
like any other recorder error, and forwarding never depended on it.

- Remove `tw_store::disk`, the recorder's level, its checks and tests, and
  tw-store's direct libc dependency.
- Remove `Event::StorageChanged`.
- `StorageStatus.level` (ok / metadata_only / stopped / unavailable) becomes
  `recording: bool`: the only state left is whether recording started.
- The diagnostics bundle no longer has a "Disk state" row.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@fylorn
fylorn merged commit f8307c5 into main Sep 21, 2026
1 check passed
@fylorn
fylorn deleted the feat/no-disk-watch branch September 21, 2026 11:31
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