Skip to content

feat(sessions): raise default session-store disk budget to 10 GiB - #110221

Merged
steipete merged 2 commits into
mainfrom
claude/session-store-disk-budget
Jul 18, 2026
Merged

steipete merged 2 commits into
mainfrom
claude/session-store-disk-budget

Conversation

@steipete

Copy link
Copy Markdown
Contributor

What Problem This Solves

The per-agent session-store disk budget defaults to 2 GiB. For a long-lived personal agent with a rolling main session, that budget is the only bound on archived transcript retention — and 2 GiB starts evicting conversation history far too early. Archives are the agent's long-term conversational record; evicting them is silent memory loss.

Why This Change Was Made

Raise the default session.maintenance.maxDiskBytes from 2 GiB to 10 GiB. Disk is cheap; conversation history is not recoverable. The high-water mark stays at the derived 80% (now 8 GiB). Operators on constrained disks can still set a lower budget or false to disable.

User Impact

Agents keep roughly 5× more archived transcript history before oldest-first eviction kicks in. No config migration needed — explicit maxDiskBytes values are untouched; only the unset default changes.

Evidence

  • src/config/sessions/store-maintenance.ts — DEFAULT_SESSION_MAX_DISK_BYTES 2 GiB → 10 GiB
  • Default + derived high-water assertions updated in src/config/sessions/store.pruning.test.ts
  • Schema help, SessionMaintenanceConfig type docs, and docs/reference/session-management-compaction.md aligned
  • Autoreview (codex/gpt-5.6-sol): clean, no actionable findings — "patch is correct (0.99)"
  • Focused tests deferred to CI (dependency-less worktree)

@openclaw-barnacle openclaw-barnacle Bot added docs Improvements or additions to documentation size: XS maintainer Maintainer-authored PR labels Jul 17, 2026
@clawsweeper clawsweeper Bot added rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. P2 Normal backlog priority with limited blast radius. merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. labels Jul 17, 2026
@clawsweeper

clawsweeper Bot commented Jul 17, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs real behavior proof before merge. Reviewed July 17, 2026, 7:05 PM ET / 23:05 UTC.

Summary
The PR raises the unset per-agent session-store disk budget from 2 GiB to 10 GiB and aligns the resolver test, schema help, type documentation, and session-management reference page.

PR surface: Source 0, Tests 0, Docs 0. Total 0 across 5 files.

Reproducibility: not applicable. This PR changes a deliberate default rather than repairing a reported failing behavior. Source inspection clearly identifies the current fallback and the maintenance path that consumes it.

Review metrics: 1 noteworthy metric.

  • Session-maintenance defaults: 1 changed, 0 added options, 0 migrations. Changing the fallback applies to every upgraded agent that has not explicitly configured a disk budget.

Merge readiness
Overall: 🧂 unranked krab
Proof: 🧂 unranked krab
Patch quality: 🐚 platinum hermit
Result: blocked until real behavior proof is added.

Overall follows the weaker of proof and patch quality, so missing proof can cap an otherwise strong patch.

Rank-up moves:

  • [P1] Add redacted terminal or runtime evidence from a real session-maintenance run, without exposing filesystem paths or private transcript data.
  • Obtain an explicit session-owner decision that the fivefold upgrade-time disk allowance is the intended default policy.

Proof guidance:

  • [P1] Needs real behavior proof before merge: The PR body names source and test updates but contains no inspectable after-fix real run; add a redacted terminal or runtime artifact from actual session maintenance showing the resolved 10 GiB budget and derived 8 GiB high-water threshold. After adding proof, update the PR body; ClawSweeper should re-review automatically. If it does not, the PR author or someone with repository write access can comment @clawsweeper re-review.

Risk before merge

  • [P1] Users who left session.maintenance.maxDiskBytes unset can retain up to five times as much per-agent session data before cleanup, increasing local disk consumption on upgrade without changing their config file.
  • [P1] The PR provides no inspectable real runtime evidence that a normal session-maintenance run resolves the intended 10 GiB/8 GiB thresholds and preserves the documented oldest-archive-first cleanup behavior.

Maintainer options:

  1. Confirm upgrade policy with runtime proof (recommended)
    Before merge, record a redacted real session-maintenance run that demonstrates the new default and high-water threshold, then have the session owner explicitly accept the increased per-agent disk allowance.
  2. Preserve the current default
    Keep the 2 GiB fallback and rely on the existing explicit configuration for operators who want longer archive retention.

Next step before merge

  • [P1] A maintainer must choose the upgrade-time retention-versus-disk default; the missing real proof must come from the contributor's actual runtime rather than an automated repair lane.

Maintainer decision needed

  • Question: Should existing agents with no explicit session.maintenance.maxDiskBytes automatically move from a 2 GiB to a 10 GiB per-agent retention budget on upgrade?
  • Rationale: The code correctly applies the requested fallback, but the fivefold default increase intentionally changes the disk-consumption and retention policy of existing installations; source inspection cannot determine the acceptable default without owner intent.
  • Likely owner: steipete — Recent merged work and this proposal both connect this contributor to the session-maintenance default surface.
  • Options:
    • Confirm the 10 GiB default (recommended): Accept the higher upgrade-time disk allowance after adding redacted runtime proof of resolved thresholds and cleanup behavior.
    • Keep the 2 GiB default: Preserve existing upgrade behavior and direct users needing longer retention to the already-supported explicit maxDiskBytes setting.

Security
Cleared: The patch changes a numeric retention default and aligned documentation/tests only; it adds no dependency, workflow, secret, permission, artifact, or code-execution surface.

Review details

Best possible solution:

Approve the 10 GiB policy only if the session owners explicitly accept the upgrade-time disk-growth tradeoff, then retain this narrow implementation with a redacted real session-maintenance proof; otherwise keep the 2 GiB default and document the existing explicit opt-in setting.

Do we have a high-confidence way to reproduce the issue?

Not applicable: this PR changes a deliberate default rather than repairing a reported failing behavior. Source inspection clearly identifies the current fallback and the maintenance path that consumes it.

Is this the best way to solve the issue?

Unclear: the code is the narrowest implementation of the chosen policy, but whether 10 GiB is the right upgrade default requires explicit owner approval and real runtime evidence of the resulting retention behavior.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning high; reviewed against efd76b739252.

Label changes

Label changes:

  • add P2: This is a bounded but user-visible retention and local-disk policy change rather than an urgent runtime failure.
  • add merge-risk: 🚨 compatibility: The unset default changes from 2 GiB to 10 GiB for existing installations without a config migration or explicit opt-in.
  • add rating: 🧂 unranked krab: Overall readiness is 🧂 unranked krab; proof is 🧂 unranked krab and patch quality is 🐚 platinum hermit.
  • add status: 📣 needs proof: The PR needs real behavior proof before ClawSweeper can clear the contributor ask. Needs real behavior proof before merge: The PR body names source and test updates but contains no inspectable after-fix real run; add a redacted terminal or runtime artifact from actual session maintenance showing the resolved 10 GiB budget and derived 8 GiB high-water threshold. After adding proof, update the PR body; ClawSweeper should re-review automatically. If it does not, the PR author or someone with repository write access can comment @clawsweeper re-review.

Label justifications:

  • P2: This is a bounded but user-visible retention and local-disk policy change rather than an urgent runtime failure.
  • merge-risk: 🚨 compatibility: The unset default changes from 2 GiB to 10 GiB for existing installations without a config migration or explicit opt-in.
  • rating: 🧂 unranked krab: Overall readiness is 🧂 unranked krab; proof is 🧂 unranked krab and patch quality is 🐚 platinum hermit.
  • status: 📣 needs proof: The PR needs real behavior proof before ClawSweeper can clear the contributor ask. Needs real behavior proof before merge: The PR body names source and test updates but contains no inspectable after-fix real run; add a redacted terminal or runtime artifact from actual session maintenance showing the resolved 10 GiB budget and derived 8 GiB high-water threshold. After adding proof, update the PR body; ClawSweeper should re-review automatically. If it does not, the PR author or someone with repository write access can comment @clawsweeper re-review.
Evidence reviewed

PR surface:

Source 0, Tests 0, Docs 0. Total 0 across 5 files.

View PR surface stats
Area Files Added Removed Net
Source 3 3 3 0
Tests 1 2 2 0
Docs 1 1 1 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 5 6 6 0

What I checked:

  • Current default and resolver: Current main defines a 2 GiB default and derives the high-water mark from that default when users leave session.maintenance.maxDiskBytes unset; the proposed patch changes that shared fallback to 10 GiB. (src/config/sessions/store-maintenance.ts:26, efd76b739252)
  • Runtime maintenance boundary: Every saved session entry reaches post-save maintenance, which resolves the maintenance config and evaluates disk-budget cleanup. The changed default therefore affects active upgraded agents with no explicit budget, not only new configuration files. (src/config/sessions/store-maintenance-operations.ts, efd76b739252)
  • Retention behavior: The disk-budget path evicts oldest archived transcripts first and targets the configured high-water mark, so increasing the default raises the amount of transcript history and local disk space retained per agent before cleanup. (src/config/sessions/disk-budget.ts, efd76b739252)
  • Feature provenance: Session-archive retention and its bounded disk-budget policy appear to date to the archive-retention work represented by commit eff3c5c; current documentation history also shows subsequent session-maintenance work by the listed area contributors. Public docs: docs/reference/session-management-compaction.md. (docs/reference/session-management-compaction.md:50, eff3c5c)
  • PR coverage and proof gap: The branch updates the default-resolution assertions and all visible user-facing references, but its body only states that focused tests were deferred to CI; it contains no inspectable live session-maintenance run showing the resolved 10 GiB budget or cleanup threshold. (src/config/sessions/store.pruning.test.ts:825, 365b8bf33786)

Likely related people:

  • gumadeiras: History attributes the archive-retention and bounded session-disk policy to the earlier implementation that established this default surface. (role: introduced archive-retention behavior; confidence: medium; commits: eff3c5c; files: src/config/sessions/store-maintenance.ts, docs/reference/session-management-compaction.md)
  • steipete: Current session-management documentation history includes prior merged contributions by this author, in addition to the proposed change. (role: recent session configuration contributor; confidence: medium; commits: 7dbb21b, 5206c9f; files: docs/reference/session-management-compaction.md, src/config/sessions/store-maintenance.ts)
What the crustacean ranks mean
  • 🦀 challenger crab: rare, exceptional readiness with strong proof, clean implementation, and convincing validation.
  • 🦞 diamond lobster: very strong readiness with only minor maintainer review expected.
  • 🐚 platinum hermit: good normal PR, likely mergeable with ordinary maintainer review.
  • 🦐 gold shrimp: useful signal, but proof or patch confidence is still limited.
  • 🦪 silver shellfish: thin signal; proof, validation, or implementation needs work.
  • 🧂 unranked krab: not merge-ready because proof is missing/unusable or there are serious correctness or safety concerns.
  • 🌊 off-meta tidepool: rating does not apply to this item.

Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics.

How this review workflow works
  • ClawSweeper keeps one durable marker-backed review comment per issue or PR.
  • Re-runs edit this comment so the latest verdict, findings, and automation markers stay together instead of adding duplicate bot comments.
  • A fresh review can be triggered by eligible @clawsweeper re-review comments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.
  • PR/issue authors and users with repository write access can comment @clawsweeper re-review or @clawsweeper re-run on an open PR or issue to request a fresh review only.
  • Maintainers can also comment @clawsweeper review to request a fresh review only.
  • Fresh-review commands do not start repair, autofix, rebase, CI repair, or automerge.
  • Maintainer-only repair and merge flows require explicit commands such as @clawsweeper autofix, @clawsweeper automerge, @clawsweeper fix ci, or @clawsweeper address review.
  • Maintainers can comment @clawsweeper explain to ask for more context, or @clawsweeper stop to stop active automation.

# Conflicts:
#	src/config/schema.help.ts
@steipete
steipete merged commit afcca01 into main Jul 18, 2026
110 of 111 checks passed
@steipete
steipete deleted the claude/session-store-disk-budget branch July 18, 2026 01:14
@steipete

Copy link
Copy Markdown
Contributor Author

Merged via squash.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

docs Improvements or additions to documentation maintainer Maintainer-authored PR merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. P2 Normal backlog priority with limited blast radius. rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. size: XS status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant