You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[Feature]: Retention/pruning for settled subagent thread projections (statev2.sqlite grows to 38.9 GB, 82% subagent turn_items) #43500
Event log compaction (ProjectionMaintenanceV2.pruneEventStore) keeps orchestration_events bounded (~1.7 GB), and thread-content.purge cleans up rows once deleted_at IS NOT NULL, but settled/archived subagent and delegated-task threads are never deleted, so their V2 projection tables (orchestration_v2_projection_turn_items and orchestration_v2_projection_nodes) grow without bound.
On a heavily used Linux server running multi-agent orchestrations, this caused statev2.sqlite to reach 38.9 GB (36.2 GiB), turning every remote server update on ext4 into a 4.8 to 9.7 minute wait (278-489 s pre-update DB copy + 72-131 s index migrations on 2.64M turn_items rows).
Evidence (dbstat read-only measurement on 0.1.13-nightly.20261125.5245)
Human top-level threads: 904 threads owning 356,189 turn items (13.5%)
Together, subagent/delegated threads are 93.7% of active threads and 82.3% of all turn items, yet none are ever eligible for purgeableThreads because they are settled rather than deleted (and per #39199, even deleting a parent leaves subagents live).
Suggestions
Optional retention / compaction policy for settled subagent projections: after a configurable retention window (e.g. 14-30 days after settlement, once parent has no active runs or pending context transfers), either purge settled subagent turn_items/nodes payloads (keeping the parent's subagent summary card intact) or prune bulky dynamic_tool (Read) / command_execution outputs while keeping assistant/user messages.
Skip redundant pre-update DB backup when no migrations will run: when the staged target build's BUILD_MIGRATION_HEAD matches the database's recorded migration head (no pending schema migrations), the launcher could skip copying the entire database before starting the trial version, since no migration modifies the schema.
Thanks for writing this up. It asks for new behaviour rather than reporting a defect, so it does not belong in the bug tracker and I'm closing it as not planned here. Feature ideas are discussed in Discussions: please post it there.
Activity
juliusmarminge commentedon Nov 26, 2026
Thanks for writing this up. It asks for new behaviour rather than reporting a defect, so it does not belong in the bug tracker and I'm closing it as not planned here. Feature ideas are discussed in Discussions: please post it there.