Independent OpenClaw reporting, releases, guides, and community coverage
Releases

OpenClaw Can Archive Active Sessions Safely

OpenClaw now stops and drains active non-main sessions before archiving, making session cleanup a single reliable Gateway action.

Filed under Releases 2 min read Updated Aug 12, 2026
OpenClaw Can Archive Active Sessions Safely

OpenClaw's session cleanup flow picked up a substantial reliability improvement with PR #120892, a P1 Gateway and Control UI change that lets operators archive real non-main sessions even while their agents are running.

The previous behavior was split across surfaces. The Control UI disabled Archive for running sessions, and direct sessions.patch calls rejected the mutation. That forced users into a two-step workflow: stop the run, wait for it to settle, then try to archive the session later.

Archive now owns the lifecycle

The merged fix moves active-session archive handling into the canonical Gateway session patch engine. That engine now owns the stop, drain, authorization, placement, and store-commit lifecycle required to make the archive operation atomic from the user's point of view.

The flow is deliberately conservative:

  • Each target is freshly authorized and identity-checked.
  • Main, global-main, and unknown identities are rejected before side effects.
  • Active or queued work is stopped before archive state is committed.
  • Admission cleanup, transcript persistence, embedded and reply runs, worker inference, and placement claims are allowed to settle.
  • Authoritative work is rechecked before the store projection includes the archived target.

Failures are target-local and retryable. That means one unsettled session does not block every eligible sibling in the same batch.

Why this matters

Session archives are easy to treat as simple metadata toggles, but OpenClaw sessions can have live work attached: provider inference, replies, embedded runs, cloud-worker placement, queued messages, and terminal transcript writes. Archiving before those settle risks hiding a session while it is still doing something important.

This PR makes Gateway responsible for the full transition. Users get the simpler operation they expect, while OpenClaw keeps the underlying lifecycle explicit.

The cloud-worker handling is especially careful. Only an exact active placement is reclaimed by the archive lifecycle. Transitional or unsafe failed placements remain unarchived and return retryable UNAVAILABLE, so operators can retry after placement state stabilizes.

Proof and performance

The PR landed with exact-head CI passing and a broad proof set across Control UI, Gateway archive lifecycle, worker placement, patch-engine authorization, self-archive behavior, UI policy, and browser archive suites. The source evidence also reports that a 30-session archive batch retained one grouped whole-store projection, one cron scan, no transcript hydration, and completed the measured operation in about 130 ms.

For anyone running busy OpenClaw workspaces, this is a nice quality-of-life fix with real safety behind it. Archive is no longer a button that disappears when a session is active; it is a Gateway-owned lifecycle action that stops work first, waits for the important state to land, and then files the session away.

Daily Briefing

Get the Open-Source Briefing

The stories that matter, delivered to your inbox every morning. Free, no spam, unsubscribe anytime.

Join 45,000+ developers. No spam. Unsubscribe anytime.