openclaw/docs/reference
Eva (agent) e1d7ba5915 fix(agents): remove transient session-repair backups
Adapts @tynamite's fix from the abandoned #77945 to current main (which
moved to replaceFileAtomic after that PR was opened), and adds the docs +
changelog updates clawsweeper flagged plus a regression test for the
field condition from #80960.

When repairSessionFileIfNeeded writes a cleaned transcript, the sibling
*.bak-<pid>-<ts> snapshot is deleted after the atomic replace succeeds.
It is only retained — and only then reported via backupPath — when the
cleanup itself fails. This prevents the unbounded accumulation observed
in #80960, where a stuck operations-agent session with a persistently
malformed JSONL line caused 2,180 ~1.8 MB backup files to pile up over
~25 hours inside two gateway processes (PIDs 1220 and 2640).

Test changes:
- Replace requireBackupPath helper with expectNoRetainedBackup that
  also asserts no .bak-* siblings remain on disk.
- Update the four call sites that used to read the retained backup.
- Add a regression test that drives repair five times against a file
  with a recurring malformed tail and asserts zero retained backups.

Docs:
- docs/reference/transcript-hygiene.md: describe backup as transient,
  retained only on cleanup failure.

Fixes #80960. Supersedes #77945. Co-authored by @tynamite — credit for
the original approach.

Co-authored-by: tynamite <35367599+tynamite@users.noreply.github.com>
2026-05-16 12:38:26 +01:00
..
templates docs: typography hygiene + 2 in-body H1 removals across 6 pages 2026-05-05 20:58:10 -07:00
AGENTS.default.md docs: typography hygiene + drop one in-body H1 across 5 pages 2026-05-05 19:25:16 -07:00
api-usage-costs.md Revert "refactor: move runtime state to SQLite" 2026-05-13 13:33:38 +01:00
application-modernization-plan.md docs(reference): audit and fix 4 pages (typography, dup H1, Related) 2026-05-05 21:56:31 -07:00
code-mode.md docs: mark code tool surfaces experimental 2026-05-15 04:16:07 +01:00
credits.md docs(reference): audit and fix 4 pages (typography, dup H1, Related) 2026-05-05 21:56:31 -07:00
device-models.md
full-release-validation.md Revert "refactor: move runtime state to SQLite" 2026-05-13 13:33:38 +01:00
memory-config.md Revert "refactor: move runtime state to SQLite" 2026-05-13 13:33:38 +01:00
openclaw-sdk-api-design.md feat(gateway): add SDK task ledger RPCs (#74847) 2026-05-09 00:55:06 -05:00
prompt-caching.md Revert "refactor: move runtime state to SQLite" 2026-05-13 13:33:38 +01:00
RELEASING.md Revert "refactor: move runtime state to SQLite" 2026-05-13 13:33:38 +01:00
rich-output-protocol.md fix: support home-relative media paths 2026-05-02 22:23:45 +01:00
rpc.md docs(imessage): make imsg the supported setup path 2026-05-07 12:53:01 -07:00
secretref-credential-surface.md Revert "refactor: move runtime state to SQLite" 2026-05-13 13:33:38 +01:00
secretref-user-supplied-credentials-matrix.json Revert "refactor: move runtime state to SQLite" 2026-05-13 13:33:38 +01:00
session-management-compaction.md Revert "refactor: move runtime state to SQLite" 2026-05-13 13:33:38 +01:00
test.md Remove codex-cli backend and migrate to Codex runtime 2026-05-14 10:07:18 +01:00
token-use.md Revert "refactor: move runtime state to SQLite" 2026-05-13 13:33:38 +01:00
transcript-hygiene.md fix(agents): remove transient session-repair backups 2026-05-16 12:38:26 +01:00
wizard.md Revert "refactor: move runtime state to SQLite" 2026-05-13 13:33:38 +01:00