openclaw - 💡(How to fix) Fix agent_end hook completion should reap :cron:run: registry entries [1 comments, 2 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
openclaw/openclaw#73869Fetched 2026-04-29 06:13:55
View on GitHub
Comments
1
Participants
2
Timeline
2
Reactions
0
Author
Timeline (top)
closed ×1commented ×1
RAW_BUFFERClick to expand / collapse

When a cron-driven 'agent:<x>:cron:<id>:run:<run-id>' session completes, the entry persists in agents/<x>/sessions/sessions.json indefinitely. After days of cron firings, registry bloats to thousands of entries that the gateway tries to resume on every restart. Proposal: when agent_end fires for a session whose key matches the :cron:run: pattern, remove that key as part of completion.

extent analysis

TL;DR

Remove completed cron session entries from sessions.json to prevent registry bloat.

Guidance

  • Identify and remove session entries matching the :cron:run: pattern when agent_end fires for a session.
  • Verify the removal by checking the sessions.json file after a cron session completes.
  • Consider implementing a periodic cleanup task to remove old session entries.
  • Review the current session management logic to ensure it handles cron sessions correctly.

Example

No code snippet is provided due to lack of specific implementation details.

Notes

This solution assumes that the agent_end event is reliably fired when a cron session completes. If this is not the case, additional error handling may be necessary.

Recommendation

Apply workaround: Remove completed cron session entries to prevent registry bloat, as this is a targeted solution to the described issue.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING

openclaw - 💡(How to fix) Fix agent_end hook completion should reap :cron:run: registry entries [1 comments, 2 participants]