Skip to content

improve(sessions): archive inactive transcripts by default - #199899

Merged
roboclaw-bot merged 6 commits into
mainfrom
openclaw/cold-storage-default-enabled
Nov 16, 2026
Merged

roboclaw-bot merged 6 commits into
mainfrom
openclaw/cold-storage-default-enabled

Conversation

@roboclaw-bot

@roboclaw-bot roboclaw-bot commented Nov 16, 2026 •

Copy link
Copy Markdown
Collaborator

What Problem This Solves

Older inactive chat history stays in SQLite unless operators discover and enable cold storage.

User Impact

Eligible inactive transcripts are now compressed automatically after 30 days, including on existing installations that omit this setting. Explicit session.maintenance.coldStorage.enabled: false still disables future extraction, and existing archives remain restorable. Active/admitted work and recovery-owned history remain protected.

Cold files are authoritative history: use supported backups or retain the referenced archive files with direct database copies. As before, text search excludes cold transcript contents until restoration. Retention and deletion policies are unchanged.

Why This Change Was Made

The scheduler and extraction worker now share the cold-policy resolver, with defaults of enabled and 30 days. Settings reflects the same omitted-setting behavior instead of showing archival as off and disabling Run now. Help and current configuration docs describe the opt-out; no new configuration field or schema migration is introduced.

Evidence

  • Before/after Settings screenshots, using synthetic data with coldStorage omitted in both states. GitHub assets were read back and inspected, and delivered to the original discussion.

  • Published head 63568115fb3865611e7dc880163beba041429c22 is a metadata-only child of tested commit aadb2d64d78e77d2517a133175917c76fe8b8bd7. Current main 5ed49aa7c35024563fa4cb26ade3efd0b0fa4e15 was integrated only to resolve the generated config-help hash conflict; the cold-storage production delta is unchanged.

  • The original 42 backend/schema and all 4 browser E2E cases passed; default scheduler and omitted-setting browser regressions failed on the base. Fresh integrated-main regression runs passed 97 cases covering cold storage, age/default/false selection, active/recovery custody, scheduling, and maintenance. A shared fake-clock fixture now explicitly opts out of unrelated extraction; its reproduced CI failure is fixed (46 cases), and all nine other fixture consumers passed 143 cases.

  • A built, isolated Gateway with synthetic 60-, 14-, and 1-day histories proved automatic archival with coldStorage completely omitted in warn mode: only 60-day history became cold. Explicit false hot-reloaded without restart; chat.inject restored exact original history before appending while extraction was disabled.

  • Latest npm stable 2026.11.4 → candidate passed 4/4 real upgrade scenarios: omitted policy adopts 30 days, explicit false remains off, custom 7-day age persists, and stable-generated cold archives restore. The stable tarball integrity was verified; released Doctor/Gateway created the database, then candidate Doctor/Gateway reopened the same isolated state. Original transcript rows remained byte-exact and history readable after restoration/appends. No live server state or external inference was used.

  • Fresh pnpm build:ci-artifacts, core/UI typechecks, touched-file type-aware lint, generated config-doc check, formatting, and git diff --check passed. An unchanged Solid tracking warning and advisory UI bundle-budget overages remain. The earlier unrelated catalog lint error is absent on integrated main and passes the exact CI lint selector. Exact-head CI completed; the inherited-only exception is recorded below.

  • Fresh independent local autoreview, P0–P2, completed on committed aadb2d64d78e77d2517a133175917c76fe8b8bd7 against 5ed49aa7c35024563fa4cb26ade3efd0b0fa4e15, with no actionable findings. Local ClawSweeper was unavailable (dirty, unbuilt checkout); the documented autoreview/hosted-review fallback was used. The hosted review's fixture and stable-upgrade findings are addressed above.

  • Exact-head CI run 43883576061 has a baseline harness failure in checks-node-changed-compact-small-19: seven prepared-harness source-delivery cases fail at unchanged run-loop.ts:501 reading providerOutcomes from an absent catalog. Both the PR-head replay and unchanged main baseline 5ed49aa7 reproduce the same seven failures. The actual CI checkout 915362db (main b58996d6 + this exact head) has identical agent/runtime/plugin sources, dependency locks and test tooling to its main parent. All PostgreSQL conformance jobs and independent security-fast passed. CI is not claimed green: the supported protected inherited-failure route verified the exact head, terminal jobs, unchanged source inputs, required reviews/security and live writer authority before merging as f8649312873296688d785b5714a1518c2cd06748. Native landing receipt.

Focused commands and simplification
node scripts/run-vitest.mjs src/config/sessions/session-cold-storage.test.ts src/config/sessions/session-cold-storage.selection.test.ts src/config/sessions/session-cold-storage-eligibility.test.ts src/gateway/session-cold-storage-maintenance.test.ts src/gateway/server-maintenance.test.ts src/gateway/server-maintenance.telemetry.test.ts src/config/schema.help.quality.test.ts --maxWorkers=1
node scripts/run-vitest.mjs run --config test/vitest/vitest.ui-e2e.config.ts --configLoader runner ui/src/e2e/session-storage-settings.e2e.test.ts

No new lifecycle machinery: scheduler and worker share the existing maintenance-policy owner. Existing archival eligibility, recovery protection, write admission, and restoration operations are unchanged. The final delta is 13 files, +111/-30 lines; no release, deployment, retention, or Team-specific configuration changes are included.

Contributor

Requested by @vincentkoc.

Work sessions

Linked for team reference; these sessions aren’t public.

Worked on by

roboclaw-bot and others added 2 commits November 16, 2026 02:42
Keep the 30-day inactivity cutoff and explicit false opt-out. Share cold policy defaults between scheduler admission and extraction, and align Settings and help with the default-on policy.

Co-authored-by: vincentkoc <[email protected]>
Worked on by:
- @vincentkoc

Co-authored-by: vincentkoc <[email protected]>
OpenClaw-Publication: 05ec025a-c3d8-4b48-afc9-82a95ea9c595
@clawsweeper

clawsweeper Bot commented Nov 16, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

Pull request received. I will update this pull request when review starts.

ClawSweeper review complete

ClawSweeper finished reviewing this revision. The review result is being finalized.

View the workflow run.

@openclaw-barnacle openclaw-barnacle Bot added docs Improvements or additions to documentation app: web-ui App: web-ui gateway Gateway runtime size: S labels Nov 16, 2026
@roboclaw-bot

Copy link
Copy Markdown
Collaborator Author

Settings default — before and after

Synthetic Gateway data; coldStorage is omitted in both states.

Before

Before: omitted coldStorage shows archival off

After

After: omitted coldStorage shows archival on, 30 days, and Run now available

@roboclaw-bot
roboclaw-bot marked this pull request as ready for review November 16, 2026 02:45
@clawsweeper clawsweeper Bot added clawsweeper:intake:feature Preliminary submission classification; full source review pending. P2 Normal backlog priority with limited blast radius. merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. and removed clawsweeper:intake:feature Preliminary submission classification; full source review pending. labels Nov 16, 2026
@clawsweeper

clawsweeper Bot commented Nov 16, 2026

Copy link
Copy Markdown
Contributor

Codex review: blocked before merge.

What this changes

Enables cold archival after 30 inactive days when configuration is omitted and aligns Settings, scheduling, and documentation.

Example: An installation omits coldStorage and has eligible 60-day-old chat history.

  • Before: The history remains in SQLite until archival is explicitly enabled.
  • After: Background maintenance archives it automatically; an explicit enabled: false still prevents extraction.

Review scores

Measure Result What it means
Overall readiness 🦪 silver shellfish (2/6) The production change is focused and direction is settled, but the consumer-fixture regression and incomplete upgrade qualification prevent a pass.
Proof confidence 🦐 gold shrimp (3/6) Real behavior proof is not required for maintainer- or bot-authored pull requests.
Patch quality 🦪 silver shellfish (2/6) 1 actionable review finding remain.

Product

Kind: Preference · Worth it: Yes · Fix scope: Complete
User problem: Inactive history remains in SQLite unless operators discover and enable automatic archival.
Reason: The maintainer-authored PR supplies direction for changing the existing default and explicitly records its backup and search tradeoffs.

Merge readiness

⛔ Blocked before merge - 2 items remain

Keep this PR open: the maintainer-directed default change is useful, but it introduces a maintenance-fixture regression that needs repair.

Priority: P2
Reviewed head: 38060982558b811c74580cee9c998d0b8b2cf926

Before merge

  • Disable unrelated archival in worker-free maintenance fixtures (P2) - An empty configuration now starts cold-storage work, but createGatewayMaintenanceStateForTest still returns config = {}. Its timer and thaw tests therefore enter real worker preparation instead of remaining worker-free, introducing background admission that changes recovery expectations. The exact-head CI job reports forbidden worker launches and multiple failed server-maintenance assertions. Set coldStorage.enabled: false in the shared fixture for tests that are not exercising archival, retaining default-on coverage in the dedicated cold-storage suite.
  • Add data-model compatibility proof - The review found that existing stored data may not work after upgrade. Show that existing data still loads and works with this change.

Findings

  • [P2] Disable unrelated archival in worker-free maintenance fixtures — src/gateway/session-cold-storage-maintenance.ts:24

Tests

  • Missing end-to-end proof: Provide redacted terminal output or logs from a latest-stable upgrade showing omitted settings adopting archival, explicit false and custom ages surviving, and original history restoring intact; remove credentials and non-public endpoints.
Agent review details

How this fits together

Gateway maintenance resolves session policy, selects eligible inactive history, and moves payloads through the existing archive worker into compressed files while SQLite retains references for restoration.

flowchart LR
  Config[Session configuration] --> Policy[Maintenance policy]
  Settings[Storage Settings] --> Config
  Policy --> Scheduler[Gateway scheduler]
  Scheduler --> Worker[Existing archive worker]
  Worker --> SQLite[SQLite metadata]
  Worker --> Archives[Compressed history files]
  Archives --> Restore[History restoration]
Loading

Technical review

Best possible solution:

Keep the shared policy resolver, explicitly disable unrelated archival in maintenance fixtures, and qualify the default change through a latest-stable upgrade.

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

Current-main source confirms that omitted configuration leaves extraction disabled; exact-head CI annotations and the empty maintenance fixture establish the introduced test failure without executing target code.

Is this the best way to solve the issue?

Sharing defaults through the existing maintenance-policy owner is the smallest complete implementation, and the added regressions exercise distinct extraction, scheduler, and Settings boundaries.

Full review comments:

  • [P2] Disable unrelated archival in worker-free maintenance fixtures — src/gateway/session-cold-storage-maintenance.ts:24
    An empty configuration now starts cold-storage work, but createGatewayMaintenanceStateForTest still returns config = {}. Its timer and thaw tests therefore enter real worker preparation instead of remaining worker-free, introducing background admission that changes recovery expectations. The exact-head CI job reports forbidden worker launches and multiple failed server-maintenance assertions. Set coldStorage.enabled: false in the shared fixture for tests that are not exercising archival, retaining default-on coverage in the dedicated cold-storage suite.
    Confidence: 0.98

Overall correctness: patch is incorrect
Overall confidence: 0.96

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning medium; reviewed against 7e48c6be722a.

Provenance checked

Testing

Proof path: shipped entry point.

Security

None.

Evidence

Acceptance criteria:

  • node scripts/run-vitest.mjs src/gateway/server-maintenance.test.ts src/gateway/server-maintenance.delivery-queue.test.ts src/gateway/server-maintenance.telemetry.test.ts --maxWorkers=1
  • node scripts/run-vitest.mjs src/config/sessions/session-cold-storage.selection.test.ts src/gateway/session-cold-storage-maintenance.test.ts --maxWorkers=1
  • git diff --check

What I checked:

Likely related people:

  • Vincent Koc: Raw commit 0ce7a49 adds ui/src/pages/config/session-storage.tsx:98 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: 0ce7a497352d; files: ui/src/pages/config/session-storage.tsx)

PR surface

Source +13, Tests +64, Docs +1, Generated 0. Total +78 across 12 files. Added test files: 0.

View PR surface stats
Area Files Added Removed Net
Source 5 24 11 +13
Tests 3 67 3 +64
Docs 3 14 13 +1
Config 0 0 0 0
Generated 1 2 2 0
Other 0 0 0 0
Total 12 107 29 +78

Preflight source

Source unknown. Source comparison at the observed PR snapshot only. Completion is self-reported; body, policy, tests, execution, and report bytes are not verified.

Review metrics

Metric Value Why it matters
Configuration default coldStorage.enabled: false → true; 0 new options Omitted configuration changes behavior on existing installations while explicit false remains intact.

Labels

Label changes:

  • add P2: This is a useful storage-policy improvement with a focused test-fixture repair.
  • add merge-risk: 🚨 compatibility: Existing installations with omitted configuration begin producing authoritative archive files and excluding their contents from text search; the maintainer-authored PR explicitly accepts these tradeoffs.
  • add rating: 🦪 silver shellfish: Overall readiness is 🦪 silver shellfish; proof is 🦐 gold shrimp and patch quality is 🦪 silver shellfish.
  • add status: ⏳ waiting on author: ClawSweeper has contributor-facing work open and is waiting for author action.

Label justifications:

  • P2: This is a useful storage-policy improvement with a focused test-fixture repair.
  • merge-risk: 🚨 compatibility: Existing installations with omitted configuration begin producing authoritative archive files and excluding their contents from text search; the maintainer-authored PR explicitly accepts these tradeoffs.
  • rating: 🦪 silver shellfish: Overall readiness is 🦪 silver shellfish; proof is 🦐 gold shrimp and patch quality is 🦪 silver shellfish.
  • status: ⏳ waiting on author: ClawSweeper has contributor-facing work open and is waiting for author action.

Rating scale

6/6 🦀 challenger crab · 5/6 🦞 diamond lobster · 4/6 🐚 platinum hermit · 3/6 🦐 gold shrimp · 2/6 🦪 silver shellfish · 1/6 🧂 unranked krab. Overall follows the weaker of proof and patch quality; ✨ marks media proof (a screenshot, video, or linked artifact) that directly shows the changed behavior.

Workflow

ClawSweeper edits this one comment on every review. Comment @clawsweeper re-review for a fresh review only. Repair and merge execution lanes are retired.

Reviewed November 15, 2026, 10:02 PM ET / November 16, 2026, 03:02 UTC.

roboclaw-bot and others added 4 commits November 16, 2026 03:05
Use the existing explicit false opt-out in fake-clock timer fixtures so the new production default does not dispatch transcript database work. Preserve the separate default-on integration proof and all maintenance lifecycle assertions.

Co-authored-by: vincentkoc <[email protected]>
Worked on by:
- @vincentkoc

Co-authored-by: vincentkoc <[email protected]>
OpenClaw-Publication: 8cd5cd62-7f26-478b-a05e-fea5011e7d0e
Integrate current main to resolve the PR conflict and regenerate the canonical config-help hashes. The cold-storage default-on production delta is unchanged.

Co-authored-by: vincentkoc <[email protected]>
Worked on by:
- @vincentkoc

Co-authored-by: vincentkoc <[email protected]>
OpenClaw-Publication: daee0a91-3aa1-4af9-9cc6-153e0533bd7d
@roboclaw-bot
roboclaw-bot enabled auto-merge (squash) November 16, 2026 14:19
@roboclaw-bot
roboclaw-bot merged commit f864931 into main Nov 16, 2026
149 of 152 checks passed
@roboclaw-bot
roboclaw-bot deleted the openclaw/cold-storage-default-enabled branch November 16, 2026 14:51
@roboclaw-bot

Copy link
Copy Markdown
Collaborator Author

Merged via explicitly authorized admin squash with attributed pre-existing CI failures.

vincentkoc added a commit that referenced this pull request Nov 16, 2026
…tgres-compaction-watched-prompt-20261116

* commit '9e810f7101557b006d5ff223d955f14dc43329f0': (23 commits)
  chore(ui): refresh control ui locales (#200164)
  fix(update): stop reporting unset git config keys as failing checks (#200153)
  test: consolidate redundant coverage (198793, part 2) (#198936)
  revert: skills-used full-transcript scan on every chat history page (#200159)
  refactor(sessions): follow the chat by key for stored delivery references (#200099)
  fix(update): bridge 2026.11.5-beta.4 updaters (#200152)
  fix(gateway): avoid filesystem stalls during catalog refresh (#200136)
  fix(ci): match update refusal probe to selected candidate (#200043)
  fix(agents): keep read-only steering carriers when publishing suppressed user envelopes (#200156)
  test: consolidate suites while retaining recovery owners (#198933)
  test: consolidate redundant coverage (198789, part 2) (#198932)
  refactor(cli): consolidate camera command tests (#200144)
  fix(cli): avoid initializing provider runtime during cleanup (#200139)
  fix(ui): show mobile destinations without the drawer exit delay (#198879)
  chore(ui): refresh control ui locales (#200146)
  fix(knowledge): keep historical claims distinct and reject changed retries (#200140)
  fix(ui): align dropdown arrows on mobile New Session
  improve(sessions): archive inactive transcripts by default (#199899)
  refactor(agents): own background commands and yield waits by the chat (#200097)
  fix(models): guessed non-chat models leave the default picker instead of being refused (#200102)
  ...
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Nov 17, 2026
…199899)

* improve(sessions): archive inactive transcripts by default

Keep the 30-day inactivity cutoff and explicit false opt-out. Share cold policy defaults between scheduler admission and extraction, and align Settings and help with the default-on policy.

Co-authored-by: vincentkoc <[email protected]>

* improve(sessions): archive inactive transcripts by default

Worked on by:
- @vincentkoc

Co-authored-by: vincentkoc <[email protected]>
OpenClaw-Publication: 05ec025a-c3d8-4b48-afc9-82a95ea9c595

* test(gateway): keep timer fixtures free of cold storage work

Use the existing explicit false opt-out in fake-clock timer fixtures so the new production default does not dispatch transcript database work. Preserve the separate default-on integration proof and all maintenance lifecycle assertions.

Co-authored-by: vincentkoc <[email protected]>

* Publish openclaw/cold-storage-default-enabled

Worked on by:
- @vincentkoc

Co-authored-by: vincentkoc <[email protected]>
OpenClaw-Publication: 8cd5cd62-7f26-478b-a05e-fea5011e7d0e

* Publish openclaw/cold-storage-default-enabled

Worked on by:
- @vincentkoc

Co-authored-by: vincentkoc <[email protected]>
OpenClaw-Publication: daee0a91-3aa1-4af9-9cc6-153e0533bd7d

---------

Co-authored-by: vincentkoc <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

app: web-ui App: web-ui docs Improvements or additions to documentation gateway Gateway runtime merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. P2 Normal backlog priority with limited blast radius. rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. size: S status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant