Skip to content
Source
Sign inSign up
pingdotgg/t3code

Retain orchestration events and receipts for a bounded window #13166

Closedclintebbesen(GitHub profile, opens in a new tab) opened this issue 1 comment

The T3 state database grows without bound because nothing prunes orchestration_events, orchestration_command_receipts or projection_thread_activities. Measured 2026-09-23 on the QLP server (192.168.30.101): state.sqlite 4.84 GB; 382,884 orchestration events and 381,596 receipts back to 2026-05-17, of which 343,240 are older than 14 days; 302,113 thread activities, 270,744 older than 14 days; 13 archived threads still carry 15,787 events. An archived-chat cleanup on 2026-08-29 took the file from 3.74 GB to 2.11 GB and it has since regrown past the starting size, because the cleanup was a one-off.

Ask: a retention rule in the server, not a manual script.

  1. On startup and daily, delete orchestration events and receipts for threads that are archived or deleted, and for any stream older than a configurable window (default 30 days) once its projection snapshot is current, so replay is never needed for pruned history.
  2. Cap projection_thread_activities per thread the way ActivityPayloadProjection already caps context-window rows in memory (keep the latest N per turn).
  3. Run PRAGMA incremental_vacuum or a scheduled VACUUM after a prune so the file shrinks.
  4. A t3 db prune command and a log line reporting rows removed and bytes reclaimed.

Same growth applies on 192.168.30.118 (2.8 GB) and will on 192.168.30.112. Related: the "Reduce Archived Chat Database Size" thread on the QLP server and the 2026-09-22 open-chat audit in DevBoard.

  1. Filed against the wrong repository by mistake; this concerns a private fork. Closing.

Sign in to join this conversation.