-
-
Notifications
You must be signed in to change notification settings - Fork 80.7k
Cron session accumulation can silently exhaust agent context window — no guardrails or warnings #38730
Copy link
Copy link
Open
BingqingLyu/openclaw
#59Labels
P2Normal backlog priority with limited blast radius.Normal backlog priority with limited blast radius.clawsweeper:fix-shape-clearClawSweeper found a clear likely implementation shape for this issue.ClawSweeper found a clear likely implementation shape for this issue.clawsweeper:linked-pr-openClawSweeper found an open linked pull request for this issue.ClawSweeper found an open linked pull request for this issue.clawsweeper:needs-maintainer-reviewClawSweeper marked this issue as needing maintainer review before automation.ClawSweeper marked this issue as needing maintainer review before automation.clawsweeper:needs-product-decisionClawSweeper marked this issue as needing a product or behavior decision.ClawSweeper marked this issue as needing a product or behavior decision.clawsweeper:no-new-fix-prClawSweeper does not recommend queueing a new automated fix PR for this issue.ClawSweeper does not recommend queueing a new automated fix PR for this issue.clawsweeper:source-reproClawSweeper found a high-confidence source-level issue reproduction.ClawSweeper found a high-confidence source-level issue reproduction.impact:message-lossChannel message delivery can be lost, duplicated, or misrouted.Channel message delivery can be lost, duplicated, or misrouted.impact:session-stateSession, memory, transcript, context, or agent state can drift or corrupt.Session, memory, transcript, context, or agent state can drift or corrupt.issue-rating: 🦞 diamond lobsterVery strong issue quality with high-confidence source-level or clear reproduction.Very strong issue quality with high-confidence source-level or clear reproduction.
Description
Metadata
Metadata
Assignees
Labels
P2Normal backlog priority with limited blast radius.Normal backlog priority with limited blast radius.clawsweeper:fix-shape-clearClawSweeper found a clear likely implementation shape for this issue.ClawSweeper found a clear likely implementation shape for this issue.clawsweeper:linked-pr-openClawSweeper found an open linked pull request for this issue.ClawSweeper found an open linked pull request for this issue.clawsweeper:needs-maintainer-reviewClawSweeper marked this issue as needing maintainer review before automation.ClawSweeper marked this issue as needing maintainer review before automation.clawsweeper:needs-product-decisionClawSweeper marked this issue as needing a product or behavior decision.ClawSweeper marked this issue as needing a product or behavior decision.clawsweeper:no-new-fix-prClawSweeper does not recommend queueing a new automated fix PR for this issue.ClawSweeper does not recommend queueing a new automated fix PR for this issue.clawsweeper:source-reproClawSweeper found a high-confidence source-level issue reproduction.ClawSweeper found a high-confidence source-level issue reproduction.impact:message-lossChannel message delivery can be lost, duplicated, or misrouted.Channel message delivery can be lost, duplicated, or misrouted.impact:session-stateSession, memory, transcript, context, or agent state can drift or corrupt.Session, memory, transcript, context, or agent state can drift or corrupt.issue-rating: 🦞 diamond lobsterVery strong issue quality with high-confidence source-level or clear reproduction.Very strong issue quality with high-confidence source-level or clear reproduction.
Type
Fields
Priority
None yet
Draft GitHub Issue
Title: Cron session accumulation can silently exhaust agent context window — no guardrails or warnings
Problem
High-frequency OpenClaw cron jobs (e.g.
every 15m/every 30m) continuously create isolated run sessions and grow the session store without visible guardrails. In a real incident, the main agent session context grew to 152k/272k (56%) and the session store reached 113 active entries. Eventually, the agent stopped replying to new inbound messages even though channels looked healthy (“all green”) — the logs showed dispatch succeeded but producedreplies=0.This failure mode is hard to diagnose because gateway/channel status can appear normal while the agent silently fails due to context/session pressure.
Evidence / Repro signals (from incident)
openclaw logs --follow(and likely/tmp/openclaw/openclaw-2026-03-07.log), messages were dispatched but no reply produced:[feishu] feishu[default]: dispatching to agent (session=agent:main:main)[feishu] feishu[default]: dispatch complete (queuedFinal=false, replies=0)openclaw sessionsshowed:agent:main:main direct ... gpt-5.2 152k/272k (56%)openclaw sessions cleanupdid not reduce entries:Applied maintenance. Current entries: 113(before/after unchanged)Root causes (missing guardrails)
sessions cleanupappears too weak for completed cron runs (does not reclaim)Impact
Any user using cron can accidentally degrade the assistant until it becomes non-responsive, with a “green status but not working” symptom.
Environment
fa44760a-b511-42bd-aeec-76233a515fa5—watch-openclaw-issue-pr-37232-37234— every 15md5b80f10-6020-4cec-8689-f97fdc68530c—watch-openai-codex-gpt54— every 30mWorkaround
Disable high-frequency cron jobs + restart gateway:
openclaw cron disable <jobId>openclaw gateway restartProposed solutions
< 30m