[agent_runs.py] Unbounded in-memory _RUNS dict with no size limit #682
Labels
No labels
area:chat
area:core
area:llm
area:routes
area:tools
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
question
refactor
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
sleepy/odysseus#682
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
agent_runs.py uses unbounded in-memory dict with no size limit
File:
src/agent_runs.pyThis dict holds run buffers indefinitely. While there is a grace-period eviction (3 minutes after last subscriber disconnects on a finished run), there is no overall size cap:
_RUNSsize for monitoringAdditionally
_Run.bufferis alistthat grows unbounded during a run — a very long agent loop with many rounds accumulates all SSE eventsSuggested fix
MAX_RUNScap (e.g. 100) with oldest-first eviction_RUNSsize_Run.bufferat a max number of events or bytesWeakValueDictionaryor explicit TTL-based evictionFixed via PR #879 — replaced Dict with OrderedDict, added 200-entry cap with FIFO eviction and graceful cancellation.