OpenClaw
OpenClaw’s cost rollup cache reached 212 MB in 66 rows
A current OpenClaw report found 66 non-expiring cost-rollup cache rows consuming 212 MB in one agent database, while separate voice and bootstrap reports describe other state that grows by count instead of bytes. The common defect is ownership without a hard retention budget.
openclaw/openclaw issue #120403 is the inspected primary source: “session-cost-usage-rollup-v1 cache entries never expire (212 MB across 66 rows in one agent DB).” The related records below were inspected as supporting context rather than independent confirmation.
The facts
- openclaw/openclaw issue #120403 was created 2026-08-08T00:58:29Z and was open at inspection; its title is “session-cost-usage-rollup-v1 cache entries never expire (212 MB across 66 rows in one agent DB).” - openclaw/openclaw issue #116201 was created 2026-07-30T03:24:50Z and was open at inspection; its title is “Realtime voice work can retain unbounded provider and consult state.” - openclaw/openclaw issue #67419 was created 2026-04-15T22:52:46Z and was open at inspection; its title is “Session context bloat: bootstrap files re-injected every turn, wasting 20-30% tokens.” - The repository reported 385494 stars, 5599 open issues, default branch main, and last push 2026-08-08T00:56:29Z. - The latest tagged-release baseline checked was v2026.7.1-2 published 2026-08-04T00:41:26Z.
What changed
openclaw/openclaw issue #120403 reports: Summary cache_entries rows under scope session-cost-usage-rollup-v1 are written with no expiry and grow without bound. On one installation this scope alone accounted for **212 MB across only 66 rows** (~3.2 MB per row) in a single agent database. Observed on 2026.7.2-beta.5 (ee929db), macOS, SQLite state backend. Evidence Table sizes in agents/main/agent/openclaw-agent.sqlite (1.1 GB total), via dbstat: Every row in cache_entries belonged to the same scope, and none had an expiry: The same pattern appeared in other agent databases on the same install: Why this matters The rollup key is per session, and the blob appears to grow with session length. Because it is rewritten in full on update, the write cost per turn grows as the conversation grows — the cost of recording cost scales with the thing being measured. Impact after cleanup Deleting the scope and running VACUUM: ~300 MB reclaimed with no functional loss observed. Expected Set an expiry on session-cost-usage-rollup-v1 entries, or
openclaw/openclaw issue #116201 reports: Summary Realtime voice sessions currently have several resource limits expressed as item counts or cancellation signals rather than hard ownership bounds. Under slow, stalled, or bursty provider/client behavior this can retain superseded consult work, large provider frames, pre-ready audio, playback marks, or talkback transcript queues for the session lifetime. Confirmed current-main reproductions A burst of 1,000 GPT-Live delegation events starts 1,000 agent consult runners even though 999 are immediately aborted. A stalled talkback consult accepts 10,000 distinct queued lanes, or merges 10,000 same-lane fragments into a 19,999-character pending question. Pre-ready OpenAI audio accepts 320 frames by count without a byte budget; gateway ingress permits frames large enough for roughly 120 MiB retained by one unready session. GPT-Live sideband startup uses the ws default payload ceiling and count-only early-frame buffering. Expected behavior Superseded consult work is single-flight with at most one latest pending task. Provider/network/audio buffers have explicit aggregate byte limits. Terminal close clears retained state
openclaw/openclaw issue #67419 reports: Summary Every new session starts with 20-30% of context already consumed by bootstrap files (MEMORY.md ~1500-2000 tokens, plus SOUL.md, USER.md, AGENTS.md, IDENTITY.md, TOOLS.md, HEARTBEAT.md, BOOTSTRAP.md). On multi-turn conversations, these files are re-injected on every follow-up message, compounding the waste. The Problem Today's bootstrap injection behavior: 1. Session start: All 8 bootstrap files injected into context (~15-20k tokens) 2. Every follow-up message: Bootstrap files re-injected again, duplicating content already in context 3. MEMORY.md is the worst offender: 1500-2000 tokens of mostly-stable data that rarely changes intra-session but gets re-loaded constantly Result: Before the user even asks anything meaningful, 20-30% of a 200k context window is consumed by duplicate content. Existing Fixes Already Built (Not Enabled by Default) OpenClaw already has the mechanics to fix this. They just aren't enabled: Fix 1: contextInjection: "continuation-skip" (one config line) This setting already exists in the codebase. It prevents bootstrap files from being re-injected after the first assistant reply. On
Why it matters
Recording cost should not become an ever-growing cost itself. Count-only limits also hide the difference between a thousand tiny items and hundreds of megabytes retained for one session. The operator test is whether the visible result, retained state and authority still describe the same event after retries, background work or restart.
Current
The primary record was open when captured on 2026-08-08. The release baseline was v2026.7.1-2 published 2026-08-04T00:41:26Z. Repository metadata, source bodies, pull requests, issues, releases, Google News, Hacker News, Lobsters, Metamesh and the rendered ClawCharts row were inspected. ClawCharts selected the subject; it did not prove the claim.
Evidence
The primary URL is https://github.com/openclaw/openclaw/issues/120403. Supporting records are https://github.com/openclaw/openclaw/issues/116201 and https://github.com/openclaw/openclaw/issues/67419. Source bodies, timestamps and states are preserved in the daily evidence bundle. Test counts and reproductions remain attributed to their authors unless identified as independently rerun.
Source boundary
Open work is described as open, closed work as closed, and operator reports as reports. A pull request is evidence of proposed or reviewed direction, not proof of a shipped release. Search residue, package mirrors and historically published source spines were excluded.
Operator take
Put byte, age and owner limits on every retained queue or cache; verify archive and close paths release state, then measure write amplification on long sessions. Preserve a before-state receipt, make the smallest reversible change, and verify the original failure independently.
Caveat
Public project records are mutable. Status, scope and evidence can change after publication. This brief records the inspected state and does not authorize changes to a reader’s deployment.
Source inspected; source state, environment and release boundary remain explicit.