Bug
The seqByRun Map in src/infra/agent-events.ts stores one entry per runId but never deletes them. clearAgentRunContext() cleans up runContextById but does not touch seqByRun.
Over time this Map grows by hundreds of entries per day and is never pruned, contributing to heap growth on long-running gateways.
Expected behavior
seqByRun.delete(runId) should be called in clearAgentRunContext() alongside the existing runContextById cleanup.
Environment
- openclaw 2026.3.13
- Node 25.8.1 (Apple Silicon)
- Gateway running as launchd daemon, crashed with OOM after ~19 hours at 4GB heap
🤖 Generated with Claude Code
Bug
The
seqByRunMap insrc/infra/agent-events.tsstores one entry perrunIdbut never deletes them.clearAgentRunContext()cleans uprunContextByIdbut does not touchseqByRun.Over time this Map grows by hundreds of entries per day and is never pruned, contributing to heap growth on long-running gateways.
Expected behavior
seqByRun.delete(runId)should be called inclearAgentRunContext()alongside the existingrunContextByIdcleanup.Environment
🤖 Generated with Claude Code