-
Notifications
You must be signed in to change notification settings - Fork 0
feat: add eviction/size-cap to in-memory activity stores #837
Copy link
Copy link
Closed
Labels
prio:lowNice to have, can deferNice to have, can deferscope:smallLess than 1 day of workLess than 1 day of workspec:hrDESIGN_SPEC Section 8 - HR & Workforce ManagementDESIGN_SPEC Section 8 - HR & Workforce Managementtype:featureNew feature implementationNew feature implementation
Description
Context
PR #832 introduced ToolInvocationTracker and DelegationRecordStore as in-memory, append-only stores. Both grow without bound.
Problem
In long-running deployments with active tool usage and delegation, these stores will consume unbounded memory. Each ToolInvocationRecord is ~300-700 bytes. At 1,000 records/minute, that is ~10M records over a week.
Proposed Solution
Add an optional max_records constructor parameter (default ~10,000) with FIFO eviction. Alternatively, prune records older than the maximum activity query window (168 hours) at write time.
Files
src/synthorg/tools/invocation_tracker.pysrc/synthorg/communication/delegation/record_store.py
Source
Found during PR #832 review (security-reviewer, type-design-analyzer agents).
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
prio:lowNice to have, can deferNice to have, can deferscope:smallLess than 1 day of workLess than 1 day of workspec:hrDESIGN_SPEC Section 8 - HR & Workforce ManagementDESIGN_SPEC Section 8 - HR & Workforce Managementtype:featureNew feature implementationNew feature implementation