OpenClaw’s Disk Budget Fix Separates Live Reasoning Telemetry From Cleanup Trash
Disk cleanup sounds like housekeeping until it deletes the evidence you needed to understand an agent run. OpenClaw PR #86247 is a small patch, but it lands on a serious product principle: live reasoning telemetry is not trash just because it lives beside the conversation transcript.
The PR changes session disk-budget accounting so active, referenced trajectory runtime and pointer sidecars do not make protected live conversation sessions appear over budget. Orphaned and unreferenced trajectory sidecars remain eligible for cleanup under pressure. That sounds narrow because it is narrow. It also happens to be exactly the kind of narrow distinction mature agent platforms need to make more often.
A sidecar can be operational evidence
PR #86247 was created at 2026-05-25T00:55:53Z. At research time it was open, non-draft, mergeable_state: clean, labeled size: S and proof: supplied. The patch touches two files: src/config/sessions/disk-budget.ts and src/config/sessions/disk-budget.test.ts, with 72 additions and 7 deletions. Small diff, sharp edge.
The proof case is refreshingly concrete. The test creates a temporary session store with an active transcript plus referenced trajectory runtime and pointer files. The physical session directory size is 6950 bytes, while maxDiskBytes is only 1000 and highWaterBytes is 800. Before this class of fix, a blunt directory-size budget could treat the active session as over budget because the sidecars were large. After the patch, the budget output reports totalBytesBefore: 123, totalBytesAfter: 123, removedFiles: 0, removedEntries: 0, freedBytes: 0, maxBytes: 1000, highWaterBytes: 800, and overBudget: false.
The files remain before and after: live-active-trajectory-proof.jsonl, live-active-trajectory-proof.trajectory-path.json, live-active-trajectory-proof.trajectory.jsonl, and sessions.json. The point is not to make trajectory files immortal. The point is to attach retention semantics to their relationship with live work. Referenced trajectory files follow the protected conversation session. Unreferenced sidecars can still be removed when disk pressure arrives.
That is the right model. Agent traces, trajectories, tool paths, context summaries, cost records, compaction metadata, and replay files are not interchangeable blobs. Some are derived caches. Some are expensive but disposable. Some are the only record of why an agent took an action. A cleanup system that only sees bytes will eventually delete the wrong thing.
The resource-state honesty pattern is getting louder
#86247 fits a broader run of OpenClaw work around honest accounting. Issue #85712 argued that context-overflow recovery should make user-visible context-loss signals explicit instead of quietly trimming away important state. PR #85882 fixed cost reporting so unknown-priced usage was reported as unknown rather than confidently displayed as zero dollars. Now #86247 says live reasoning telemetry should not be counted as disposable conversation bulk.
Those sound like different bugs. They are really the same product principle expressed through different resources. Context is a resource. Cost is a resource. Disk and trace retention are resources. When an agent runtime hides resource state or misclassifies it, operators make bad decisions. They assume a run was cheap when pricing was unknown. They assume context is intact when recovery trimmed it. They assume traces are retained when cleanup treated them as bloat.
This matters because agent systems are increasingly judged after the fact. Why did the agent delete that file? Why did it call that tool? Why did it choose that fallback model? Why did it stop halfway through the task? A trajectory sidecar may be the difference between a useful incident review and a shrug. If disk pressure silently removes the live trace while leaving the transcript, the system has preserved the chat theater and discarded the operational story.
There is a security angle too. Auditability is often discussed as a policy layer: logs, permissions, approval prompts. But retention is part of auditability. If the files that explain model/tool behavior are pruned under a generic budget rule while the run is active, the audit trail is only aspirational. Production agent governance needs typed retention classes: active transcript, active trajectory, orphaned sidecar, derived cache, stale session, exported archive. One directory hammer cannot express that.
What teams should do with this
If you run OpenClaw with trajectories enabled, audit your session cleanup settings with trace files in mind. Do not assume “session protected” automatically means “all files that explain the session are protected.” Verify how your current version treats .trajectory.jsonl and pointer files under budget pressure. Then test the opposite case: orphaned sidecars should still be eligible for cleanup. Keeping everything forever is not a retention strategy; it is a future outage with nicer intentions.
For incident-heavy or compliance-sensitive environments, treat traces as evidence. Decide how long active and completed trajectories should live, where they should be archived, and who can read them. If a reasoning trace can include prompts, tool arguments, file paths, channel metadata, or sensitive context, retention policy must also include access policy. Protecting active traces from cleanup does not mean spraying them into every backup bucket forever.
The patch’s verification list is the kind you want for this area: targeted Vitest suites for session disk budget and store pruning integration, oxfmt --check, oxlint, and git diff --check. More importantly, the proof uses concrete byte counts and filenames. Storage-accounting bugs need real file layouts, not abstract confidence.
The editorial takeaway is simple: observability data is part of the runtime, not decorative exhaust. As agent platforms become more autonomous, the files that explain their reasoning become operational assets. A budget system that cannot tell live evidence from orphaned sidecars is one cleanup pass away from deleting the debugging story.
Sources: OpenClaw PR #86247, OpenClaw issue #85025, OpenClaw issue #85712, OpenClaw PR #85882