← NEWS DESK
operator digest

Avoid Manual Session Trimming on OpenClaw Beta Until the Archive Fix Ships

OpenClaw 2026.7.2-beta.3 can delete trimmed transcript rows while printing a nonexistent archive marker; a merged main-branch fix is not packaged yet.

Operators running OpenClaw 2026.7.2-beta.3 should avoid this command for now:

openclaw sessions compact <key> --max-lines <N>

The packaged beta deletes transcript rows outside the retained line limit, then reports an Archived transcript: value that is not a file. The trimmed history is therefore not recoverable from the archive OpenClaw claims to have made.

PR #111122 fixes the failure on main, but merged on 22 July at 04:01 UTC—after the current beta release. No official npm channel contains that merged fix at verification time.

Operator decision

  • On 2026.7.2-beta.3: do not use sessions compact --max-lines for transcripts you may need. Wait for release notes that explicitly include PR #111122.
  • On another version: verify the installed version and implementation before assuming the same scope. This report independently confirmed the faulty path in the 2026.7.2-beta.3 npm tarball; it does not assign an exhaustive affected-version range.
  • If you already ran it: an Archived transcript: value beginning with sqlite: is a marker, not a filesystem backup. Preserve the state directory and any external backups before attempting recovery, but do not expect that printed value to restore deleted rows.
  • Do not confuse the paths: ordinary sessions compact without --max-lines uses the model-driven compaction/checkpoint flow and is explicitly described by the merged pull request as unaffected. Session reset and delete already use the durable archive writer and are also outside this bug.

What the beta actually does

OpenClaw switched canonical session metadata and transcript storage to per-agent SQLite in PR #98236, merged on 11 July. The old flat-file manual-trim path renamed the live JSONL transcript to a real timestamped backup before writing the shortened replacement.

The SQLite version did not preserve that safety contract. Its manual trim function:

  1. loads all transcript events;
  2. keeps the session header and the requested tail;
  3. replaces the SQLite transcript rows with that smaller set;
  4. constructs a string shaped like sqlite:<agent>:<session>:<store>.bak.<timestamp>; and
  5. returns that string as archived.

Nothing in that path writes the removed rows to the claimed location. The CLI then faithfully prints the returned marker as Archived transcript: ..., making destructive trimming look recoverable.

OpenClaw Academy downloaded the official 2026.7.2-beta.3 npm tarball into a disposable directory and inspected its built JavaScript. The package’s trimSessionTranscriptForManualCompact calls replaceSqliteTranscriptEvents(...) before constructing the archived marker with formatSqliteSessionFileMarker(...); its CLI bundle prints that returned value. This confirms the faulty implementation is present in the current beta package.

We did not run the destructive command against a live beta Gateway. Deliberately deleting a seeded transcript would add little beyond the packaged control-flow inspection and upstream’s live before/after proof, while creating unnecessary test complexity.

What the merged fix changes

The fix moves the archive operation to the SQLite transcript writer boundary. Before any rows are deleted, OpenClaw now exports the complete pre-trim transcript through the existing durable session archive writer.

The resulting artifact is a real file named like:

<sessionId>.jsonl.bak.<timestamp>[.zst]

The writer uses exclusive creation, restrictive permissions, file and directory syncing, and atomic rename. Only after that archive exists does the trim replace rows in a SQLite write transaction.

The patch also addresses two failure edges:

  • if creating the backup fails, compaction fails and leaves the original rows untouched;
  • if the transcript changes between snapshot and replacement, the transaction detects the conflict and aborts instead of deleting a concurrent append.

The pull request reports a live Gateway-and-CLI comparison using seven seeded events. Before the patch, four events disappeared and no archive existed. Afterward, the printed path resolved to a mode-0600 compressed archive containing all seven events. It also reports focused accessor, Gateway and CLI regression suites, including a 500-event archive assertion.

Those execution results are upstream evidence, not an independent Academy run. The pull request says Bun’s plain-JSONL fallback and Windows were not tested live.

How to verify a future package

First, check the installed version:

openclaw --version

Then check that the release notes or source commit explicitly include PR #111122 or merge commit db1611747f705f8c415ca8df77c820fbdabcc8c9. A version number newer than today’s beta is suggestive, not proof by itself.

For a disposable test session only, successful fixed behaviour should return a normal filesystem path ending in .jsonl.bak.<timestamp> or .jsonl.bak.<timestamp>.zst. Confirm that the file exists and preserve it before treating manual trimming as recoverable. Do not test this first on a production transcript.

Availability

At verification time, npm’s official distribution tags were:

  • latest: 2026.7.1-2
  • beta: 2026.7.2-beta.3
  • alpha: 2026.5.19-alpha.1
  • extended-stable: 2026.6.33

GitHub’s latest release remained v2026.7.2-beta.3, published on 18 July. The archive fix merged more than three days later, so merged status is not evidence that an installed package is fixed.

Bottom line

This is a narrow command-path bug with severe consequences: explicit line-count trimming can permanently discard transcript history while reporting a backup that does not exist. Current beta operators should stop using sessions compact --max-lines until a package explicitly carries PR #111122.

Verification note: OpenClaw Academy checked the official pull request and merged commit, the SQLite storage-flip pull request, GitHub release metadata and npm distribution tags on 22 July 2026. We also downloaded and inspected the official 2026.7.2-beta.3 npm tarball. We did not execute the destructive compaction flow; live before/after and test results are attributed to upstream evidence.

THE RECEIPTS

Claims should survive the click.

Primary links used for this article are listed openly. If the evidence changes, the verification date changes with it.
  1. 01Manual compaction archive fix
  2. 02Merged archive-fix commit
  3. 03SQLite session-storage flip
  4. 04OpenClaw 2026.7.2-beta.3 release
  5. 05OpenClaw npm distribution tags

THE OPERATOR BRIEF

One useful email when the signal earns it.

Release impact, security changes and repository intelligence. No daily sludge.