Skip to content

fix(sessions): prevent cleanup from deleting readable transcripts - #123495

Merged
jalehman merged 6 commits into
mainfrom
codex/issue-119085-sqlite-archive
Aug 15, 2026
Merged

jalehman merged 6 commits into
mainfrom
codex/issue-119085-sqlite-archive

Conversation

@joshavant

Copy link
Copy Markdown
Collaborator

Closes #119085

What Problem This Solves

Fixes an issue where operators running openclaw sessions cleanup --fix-missing could lose readable SQLite transcript content when one transcript row was malformed. The cleanup classifier treated any read failure as proof that the whole transcript was message-free, then removed the session and its transcript rows without a recoverable archive.

The same cleanup owner serves the CLI and the sessions.cleanup gateway RPC, so both surfaces were affected.

Why This Change Was Made

The cleanup classifier now inspects transcript events and the deletion snapshot together and fails safe: malformed or unreadable content keeps the session instead of classifying it as empty. Eligible cleanup removals bind the inspected snapshot into the lifecycle operation so a changed transcript cannot be deleted under a stale decision.

Transcript archival now belongs to the per-agent SQLite lifecycle transaction. A lazily installed, same-version additive table stores the canonical compressed archive, digest, reason, and publication state in the same transaction that removes the session state. After commit, a bounded publisher writes the derived .deleted artifact without overwriting an existing file, verifies its digest, and retries pending publications after interruption. Retention and disk-budget cleanup prune only published archives and protect unpublished recovery copies.

No SQLite schema-version bump is required: the table is additive, lazily ensured on first use, and validated against previous-reader and drift cases.

User Impact

Cleanup no longer silently destroys a readable conversation because another row is corrupt. When cleanup intentionally reclaims transcript content, the recovery copy is committed atomically before deletion and remains recoverable across process crashes or derived-file publication failures.

Evidence

  • The two original regression cases failed before the repair: readable-plus-malformed content was deleted, and a qualifying --fix-missing removal produced no archive. Both pass after the repair.
  • Focused exact-head suite: 9 files, 201 tests passed, including cleanup classification, rollback atomicity, crash/retry publication, collisions, lifecycle races, retention, disk pressure, schema compatibility, and maintenance paths.
  • Schema and architecture guards passed: pnpm db:kysely:check, pnpm sqlite:sessions-schema:check, and pnpm lint:kysely.
  • Remote changed-surface gate passed with exit 0, covering formatting, typechecks, lint, import cycles, database-first storage, schema baselines, and repository architecture guards: https://github.com/openclaw/openclaw/actions/runs/31771587944
  • Final autoreview reported no accepted/actionable findings and judged this the best owner-boundary fix.
  • Production LOC: +904/-62 (net +842). Tests: +650/-183. The production growth establishes the canonical same-transaction archive owner, crash-recoverable publisher, and retention/disk-budget integration; generated/tooling changes are reported separately.

@clawsweeper

clawsweeper Bot commented Aug 14, 2026

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

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

@openclaw-barnacle openclaw-barnacle Bot added docs Improvements or additions to documentation scripts Repository scripts size: XL maintainer Maintainer-authored PR labels Aug 14, 2026
@clawsweeper clawsweeper Bot added merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. merge-risk: 🚨 session-state 🚨 May lose, corrupt, stale, or mis-associate session, agent, or context state. P1 High-priority user-facing bug, regression, or broken workflow. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. labels Aug 14, 2026
@clawsweeper

clawsweeper Bot commented Aug 14, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed August 15, 2026, 11:44 AM ET / 15:44 UTC.

ClawSweeper review

What this changes

This PR makes session cleanup preserve unreadable transcripts and stores intentional transcript deletions atomically in SQLite before publishing recoverable archive files.

Regression provenance

Possible regression — probable (reproduction; reviewed change). No predecessor PR is attributed.

Merge readiness

⚠️ Ready for maintainer review - 3 items remain

Keep open for maintainer review: current main still converts any transcript-read failure into a cleanup deletion, while this PR moves recovery into the SQLite lifecycle owner and adds a durable archive contract that warrants explicit review.

Priority: P1
Reviewed head: 6be365e2fbb27abc6993c85d71ca2bc5a8c642f1
Owner decision: Required. See Decision needed.

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) The repair follows the owner boundary, covers the prior generation-key concern, and includes focused compatibility and lifecycle tests; the remaining gate is maintainer acceptance of the durable-state contract.
Proof confidence 🌊 off-meta tidepool Not applicable: The repository state identifies this as a member-authored PR, so the external-contributor real-behavior proof gate does not apply; the PR body nevertheless provides focused validation claims.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Not applicable Not applicable: The repository state identifies this as a member-authored PR, so the external-contributor real-behavior proof gate does not apply; the PR body nevertheless provides focused validation claims.
Evidence reviewed 6 items Current-main defect: The current cleanup classifier catches any transcript-read failure and returns false, which makes the caller treat the transcript as message-free and eligible for deletion.
Both product entry points share the owner: The CLI delegates fixMissing to sessions.cleanup when a Gateway is available and otherwise calls the same cleanup service; the Gateway handler also calls that service directly.
PR owner-boundary repair: The proposed lifecycle transaction persists a materialized archive before deleting transcript state, and refuses deletion when the snapshot changed.
Findings None None.
Security None None.

How this fits together

The sessions cleanup service is reached through the CLI and the Gateway RPC, then delegates durable removal to the SQLite session lifecycle. The lifecycle deletes session rows and transcript events, while this change records a recovery archive before that deletion and publishes a derived file afterward.

flowchart LR
A[CLI cleanup command] --> C[Shared cleanup service]
B[Gateway cleanup RPC] --> C
C --> D[Transcript inspection]
D --> E{Safe to remove?}
E -->|Unreadable or contains message| F[Keep session]
E -->|Confirmed message-free| G[SQLite lifecycle transaction]
G --> H[Archive record and recovery file]
Loading

Decision needed

Question Recommendation
Should this PR’s new durable SQLite archive-and-republish contract be accepted as the recovery owner for intentional transcript deletion? Approve the durable recovery contract: Accept the additive archive table and publisher after exact-head checks are green, preserving atomic recovery rather than relying on a pre-delete file write.

Why: The patch changes persisted session recovery and retention behavior beyond the local classifier correction; repository policy reserves protected maintainer work for explicit handling.

Before merge

  • Resolve merge risk (P1) - This adds a durable archive table and a post-commit publisher to session deletion; maintainers should explicitly accept the recovery and retention contract for existing agent databases.
  • Resolve merge risk (P1) - Production code grows by 1,118 additions and 106 deletions; the atomic archive row, replay publisher, and retention accounting are the stated durable-owner justification, but the size makes focused maintainer review important.
Agent review details

Security

None.

PR surface

Source +1016, Tests +603, Generated +17, Other +1. Total +1637 across 34 files.

View PR surface stats
Area Files Added Removed Net
Source 25 1122 106 +1016
Tests 6 791 188 +603
Docs 0 0 0 0
Config 0 0 0 0
Generated 2 18 1 +17
Other 1 1 0 +1
Total 34 1932 295 +1637

Review metrics

Metric Value Why it matters
Production versus test delta production +1118/-106; tests and test support +796/-188; generated +18/-1 The large production increase implements transactional archival, replay publication, and retention accounting rather than only the cleanup classifier change.

Stored data model

Persistent data-model change detected: database schema: src/infra/state-migrations.media-persistence.historical-schema.test-support.ts, database schema: src/state/openclaw-agent-schema.sql, database schema: src/state/openclaw-agent-session-transcript-archive-schema.test.ts, database schema: src/state/openclaw-agent-session-transcript-archive-schema.ts, serialized state: src/config/sessions/cleanup-service.fix-missing.test.ts, serialized state: src/config/sessions/cleanup-service.ts, and 34 more. Migration or upgrade compatibility proof is recorded; maintainers should verify it before merge.

Root-cause cluster

Relationship: fixed_by_candidate
Canonical: #119085
Summary: This PR is the candidate repair for the reported cleanup path that can remove readable session transcripts without recovery.

Members:

Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything.

Merge-risk options

Maintainer options:

  1. Approve durable recovery semantics (recommended)
    Merge only after a maintainer accepts the additive archive-table, recovery-file, retention, and existing-database behavior as the intended session lifecycle contract.

Technical review

Best possible solution:

Keep archival in the per-agent SQLite deletion transaction, publish only derived recovery files afterward, and retain the additive-schema compatibility checks as the single recovery path.

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

Yes — current main’s catch-to-false classifier and subsequent removal path provide a high-confidence source reproduction for an unreadable transcript row; the linked report also supplies a concrete SQLite cleanup scenario.

Is this the best way to solve the issue?

Yes — persisting the recovery payload at the session lifecycle owner before deletion is safer than the old unarchived removal or a consumer-side guard, subject to maintainer acceptance of the durable storage contract.

AGENTS.md: found and applied where relevant.

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

Labels

Label justifications:

  • P1: The repaired path can silently remove readable persisted transcripts during operator-triggered cleanup.
  • merge-risk: 🚨 compatibility: The PR adds a lazily installed durable table and changes recovery behavior for existing agent databases.
  • merge-risk: 🚨 session-state: The transaction now archives and deletes persisted transcript generations through a changed lifecycle path.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🌊 off-meta tidepool and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Not applicable: The repository state identifies this as a member-authored PR, so the external-contributor real-behavior proof gate does not apply; the PR body nevertheless provides focused validation claims.

Evidence

What I checked:

Likely related people:

  • Peter Steinberger: Available current-main blame associates the legacy cleanup classifier with this commit, though the checkout’s shallow graft prevents a stronger origin-history conclusion. (role: current-main code carrier; confidence: low; commits: 447393dc3221; files: src/config/sessions/cleanup-service.ts)

Rank-up moves

Optional improvements that raise the rating; they are not merge blockers.

  • Obtain maintainer approval for the additive archive and retention contract.
  • Let the in-progress exact-head checks complete before merge.

Rating scale

Score Internal tier Crab rank Meaning
6/6 S 🦀 challenger crab Exceptional readiness
5/6 A 🦞 diamond lobster Very strong readiness
4/6 B 🐚 platinum hermit Good normal PR; ordinary maintainer review
3/6 C 🦐 gold shrimp Useful, but confidence is limited
2/6 D 🦪 silver shellfish Proof or implementation needs work
1/6 F 🧂 unranked krab Not merge-ready
N/A NA 🌊 off-meta tidepool Rating does not apply

Overall follows the weaker of proof and patch quality.
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.

Workflow

  • 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.

History

Review history (9 earlier review cycles; latest 8 shown)
  • reviewed 2026-08-14T06:13:13.940Z sha dde3513 :: needs maintainer review before merge. :: none
  • reviewed 2026-08-14T06:27:26.418Z sha 9c0791f :: found issues before merge. :: [P1] Allow multiple retained archives for a session
  • reviewed 2026-08-14T06:35:53.872Z sha f72c7f1 :: needs changes before merge. :: [P1] Key archives by generation, not session
  • reviewed 2026-08-14T20:01:06.970Z sha db472f4 :: found issues before merge. :: [P1] Key recovery archives by generation
  • reviewed 2026-08-14T22:02:44.198Z sha d3dd152 :: found issues before merge. :: [P1] Key recovery archives by generation
  • reviewed 2026-08-14T22:34:59.767Z sha 20dd5e1 :: needs changes before merge. :: [P1] Key recovery archives by immutable generation
  • reviewed 2026-08-14T23:30:36.813Z sha 20dd5e1 :: found issues before merge. :: [P1] Key recovery archives by immutable generation
  • reviewed 2026-08-14T23:54:34.710Z sha 6db8532 :: needs maintainer review before merge. :: none

@openclaw-barnacle openclaw-barnacle Bot added the gateway Gateway runtime label Aug 14, 2026
@clawsweeper clawsweeper Bot added status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. and removed status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. labels Aug 14, 2026
@joshavant
joshavant force-pushed the codex/issue-119085-sqlite-archive branch from f72c7f1 to db472f4 Compare August 14, 2026 19:57
@joshavant

Copy link
Copy Markdown
Collaborator Author

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Aug 14, 2026 •

Copy link
Copy Markdown
Contributor

🦞🧹
ClawSweeper re-review requested.

I asked ClawSweeper to review this item again.
Action: item re-review queued (workflow sweep.yml, event exact_review_queue).
Result: when the review finishes, ClawSweeper will create the durable review comment if needed or update the existing comment in place.

@clawsweeper clawsweeper Bot added rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. and removed rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. labels Aug 14, 2026
@joshavant
joshavant force-pushed the codex/issue-119085-sqlite-archive branch from d3dd152 to 20dd5e1 Compare August 14, 2026 22:28
@joshavant

Copy link
Copy Markdown
Collaborator Author

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Aug 14, 2026 •

Copy link
Copy Markdown
Contributor

🦞🧹
ClawSweeper re-review requested.

I asked ClawSweeper to review this item again.
Action: item re-review queued (workflow sweep.yml, event exact_review_queue).
Result: when the review finishes, ClawSweeper will create the durable review comment if needed or update the existing comment in place.

Re-review progress:

@clawsweeper clawsweeper Bot added rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. and removed rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. 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. labels Aug 14, 2026
joshavant and others added 3 commits August 15, 2026 08:01
Remeasure physical disk usage after archive publication so budget results and pruning use the bytes actually present on disk.

Refs oc-8e9
@jalehman
jalehman force-pushed the codex/issue-119085-sqlite-archive branch from 6db8532 to 6be365e Compare August 15, 2026 15:39
@openclaw-barnacle openclaw-barnacle Bot added the commands Command implementations label Aug 15, 2026
@jalehman
jalehman merged commit fc4d5d7 into main Aug 15, 2026
185 checks passed
@jalehman
jalehman deleted the codex/issue-119085-sqlite-archive branch August 15, 2026 17:00
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Aug 16, 2026
…enclaw#123495)

* fix(sessions): make transcript archival atomic

* fix(sessions): stabilize SQLite archive CI

* test(gateway): synchronize lifecycle patch race

* fix(sessions): finish archive recovery accounting

* fix: key transcript archives by generation

Remeasure physical disk usage after archive publication so budget results and pruning use the bytes actually present on disk.

Refs oc-8e9

* fix(sessions): normalize doctor archive generations (oc-a28)

---------

Co-authored-by: Josh Lehman <[email protected]>
steipete added a commit that referenced this pull request Oct 12, 2026
Doctor canonical-session repair rebuilt each accumulated candidate array for every appended row. One deep alias group bypasses the usefulness of the 64-group batch limit: the existing 12,001-candidate scale fixture causes the two grouping loops to copy 144,012,000 existing references before repair can finish. This change appends to function-owned arrays, preserving candidate order, database grouping, the first resolved database scope, SQL, transactions, and repair decisions. It changes two files (+16/-4); no new API, check, schema, or SQLite operation is introduced.

The two quadratic expressions originated in `61221c4c20ec` (#126353) and `fc4d5d744fad` (#123495). The observed scale failure on [the earlier repair candidate](https://github.com/openclaw/openclaw/actions/runs/38283393506/job/114926176837) was a child SIGTERM at its existing 60-second limit; the last recorded phase was repair entry. This establishes the failing flow and workload, not that grouping alone caused that timeout. No causal parent control or before/after timing benchmark is claimed.

Focused production-path proof:

| Test | Exact composed head | Result | Vitest / wrapper wall time |
| --- | --- | --- | --- |
| `pnpm test src/commands/doctor-session-canonical-keys.scale.test.ts --maxWorkers=1` | `7ac691f4a04689c9711192262ad0bc3c73b6ad92` | 1/1; case 66.300 s | 126.26 / 172.89 s |
| `pnpm test src/commands/doctor-session-canonical-keys.owner-repair.test.ts --maxWorkers=1` | `f1979f3b6f5ac9aa59a3f4c83dbe20b9ac49b535` | 4/4 | 234.79 / 526.36 s |

The unchanged scale test executes both edited loops through a real Node child under Doctor maintenance ownership and verifies that all 200,000 transcript events survive, one expected canonical node remains, and foreign keys are valid. The owner tests preserve required creation provenance, replace a stale owner with the selected winner, recover a stolen transcript window without losing history, and verify a repeat repair is a no-op. Both receipts ended at their original clean heads with no surviving processes. These are composed-head results; the composition also contained temporary phase diagnostics excluded from this change.

[Composed-head CI](https://github.com/openclaw/openclaw/actions/runs/38292637049) passed build, production and test types, all core lint stripes, source contracts, Knip, architecture/Madge, and database worker/dialect ratchets. The [published-driver update cell](https://github.com/openclaw/openclaw/actions/runs/38292637049/job/114965277486) executed and passed from published 2026.10.2 to candidate 2026.10.2 at `f1979f3b6f5a`: candidate checksum matched, update completed, readiness returned 200, and running version was verified. One Codex autoreview returned no findings. The publication preserves the newer main-key admission change. The two grouping bodies retain the reviewed and tested behavior; no standalone publication-head static run is represented as already complete.

The separate low-heap dry-run memory test remains unresolved: at `f1979f3b6f5a` it exceeded its existing 90-second case limit (90.277 s; Vitest 444.68 s / wrapper 557.96 s). Its child runs `apply:false`, so neither changed grouping loop executes. This is not a passing memory result or an inferred timeout root cause. The separate fixture-only commit `c92696a32a7bd33d7ca98be7f94f09f42d2acb8f` moves its unchanged minified/split bundle preparation to `beforeAll`; its runtime rerun is pending. That fixture keeps the existing 160 MiB heap, 60-second child and 90-second case limits.

This Doctor-only in-memory optimization does not remove SQLite reads, writes, or authority checks. No T1 reduction or warmed-turn SQL/request saving is claimed. Update and repair behavior remain unchanged; only group construction loses its quadratic copying cost.

Direct-main publication was refused by the repository ruleset; this emergency repair uses the authorized head-pinned PR squash fallback. Main is not yet established green.

Applicable newer static proof is also green at `8d087040fefe324e5ff7fa76faf497fadb542c08` in [CI run 38298120555](https://github.com/openclaw/openclaw/actions/runs/38298120555): production types, all core/general lint, source contracts, Knip/dependencies, architecture and baseline ratchets. The changed test graphs passed in core stripe 5 (`commands-doctor`, job 114974448774) and stripe 4 (`agents-sessions`, job 114974448893). The pending core-3 test stripe owns neither graph. These remain composed-head proofs with the integration limits stated above.
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Oct 13, 2026
Doctor canonical-session repair rebuilt each accumulated candidate array for every appended row. One deep alias group bypasses the usefulness of the 64-group batch limit: the existing 12,001-candidate scale fixture causes the two grouping loops to copy 144,012,000 existing references before repair can finish. This change appends to function-owned arrays, preserving candidate order, database grouping, the first resolved database scope, SQL, transactions, and repair decisions. It changes two files (+16/-4); no new API, check, schema, or SQLite operation is introduced.

The two quadratic expressions originated in `fee9ee2148a3` (openclaw#126353) and `cd4f2480c2f5` (openclaw#123495). The observed scale failure on [the earlier repair candidate](https://github.com/openclaw/openclaw/actions/runs/38283393506/job/114926176837) was a child SIGTERM at its existing 60-second limit; the last recorded phase was repair entry. This establishes the failing flow and workload, not that grouping alone caused that timeout. No causal parent control or before/after timing benchmark is claimed.

Focused production-path proof:

| Test | Exact composed head | Result | Vitest / wrapper wall time |
| --- | --- | --- | --- |
| `pnpm test src/commands/doctor-session-canonical-keys.scale.test.ts --maxWorkers=1` | `7ac691f4a04689c9711192262ad0bc3c73b6ad92` | 1/1; case 66.300 s | 126.26 / 172.89 s |
| `pnpm test src/commands/doctor-session-canonical-keys.owner-repair.test.ts --maxWorkers=1` | `f1979f3b6f5ac9aa59a3f4c83dbe20b9ac49b535` | 4/4 | 234.79 / 526.36 s |

The unchanged scale test executes both edited loops through a real Node child under Doctor maintenance ownership and verifies that all 200,000 transcript events survive, one expected canonical node remains, and foreign keys are valid. The owner tests preserve required creation provenance, replace a stale owner with the selected winner, recover a stolen transcript window without losing history, and verify a repeat repair is a no-op. Both receipts ended at their original clean heads with no surviving processes. These are composed-head results; the composition also contained temporary phase diagnostics excluded from this change.

[Composed-head CI](https://github.com/openclaw/openclaw/actions/runs/38292637049) passed build, production and test types, all core lint stripes, source contracts, Knip, architecture/Madge, and database worker/dialect ratchets. The [published-driver update cell](https://github.com/openclaw/openclaw/actions/runs/38292637049/job/114965277486) executed and passed from published 2026.10.2 to candidate 2026.10.2 at `f1979f3b6f5a`: candidate checksum matched, update completed, readiness returned 200, and running version was verified. One Codex autoreview returned no findings. The publication preserves the newer main-key admission change. The two grouping bodies retain the reviewed and tested behavior; no standalone publication-head static run is represented as already complete.

The separate low-heap dry-run memory test remains unresolved: at `f1979f3b6f5a` it exceeded its existing 90-second case limit (90.277 s; Vitest 444.68 s / wrapper 557.96 s). Its child runs `apply:false`, so neither changed grouping loop executes. This is not a passing memory result or an inferred timeout root cause. The separate fixture-only commit `c92696a32a7bd33d7ca98be7f94f09f42d2acb8f` moves its unchanged minified/split bundle preparation to `beforeAll`; its runtime rerun is pending. That fixture keeps the existing 160 MiB heap, 60-second child and 90-second case limits.

This Doctor-only in-memory optimization does not remove SQLite reads, writes, or authority checks. No T1 reduction or warmed-turn SQL/request saving is claimed. Update and repair behavior remain unchanged; only group construction loses its quadratic copying cost.

Direct-main publication was refused by the repository ruleset; this emergency repair uses the authorized head-pinned PR squash fallback. Main is not yet established green.

Applicable newer static proof is also green at `8d087040fefe324e5ff7fa76faf497fadb542c08` in [CI run 38298120555](https://github.com/openclaw/openclaw/actions/runs/38298120555): production types, all core/general lint, source contracts, Knip/dependencies, architecture and baseline ratchets. The changed test graphs passed in core stripe 5 (`commands-doctor`, job 114974448774) and stripe 4 (`agents-sessions`, job 114974448893). The pending core-3 test stripe owns neither graph. These remain composed-head proofs with the integration limits stated above.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

commands Command implementations docs Improvements or additions to documentation gateway Gateway runtime maintainer Maintainer-authored PR merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. merge-risk: 🚨 session-state 🚨 May lose, corrupt, stale, or mis-associate session, agent, or context state. P1 High-priority user-facing bug, regression, or broken workflow. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. scripts Repository scripts size: XL status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug] sessions cleanup --fix-missing deletes readable session transcripts with no archive

2 participants