Skip to content

Target-hosted snapshot command terminates its lifecycle owner and leaves the gateway stopped #134

Description

@hannesrudolph

Summary

Running ocm env snapshot create <env> from an agent process hosted by that
same target environment stops the Gateway that owns the caller before the
snapshot can complete.

In the observed run, the command lost its caller, created no snapshot, and left
the target service stopped. A different gateway had to take over recovery.

Environment

  • OCM 0.2.33
  • macOS arm64
  • Target environment: openclaw
  • Target binding at reproduction: source-full OpenClaw 2026.8.1
    (fleet-main-692cb7b1f28-installed-full)
  • Caller: clawcode Codex agent hosted by the openclaw Gateway

Reproduction

  1. Start an agent turn on OCM environment openclaw.

  2. From that agent's Code Mode process, run:

    ocm env snapshot create openclaw \
      --label pre-openclaw-2026.8.2-20260901 \
      --json
    
  3. Observe the target Gateway and caller process while snapshot creation
    enters its cold/stopped phase.

Actual behavior

The snapshot command emitted progress through 181 seconds:

[ocm] Creating snapshot for openclaw (166s elapsed; still running)
[ocm] Creating snapshot for openclaw (181s elapsed; still running)

Then:

  • OCM stopped the target Gateway and changed its service state to
    running=false, desiredRunning=false.
  • The Gateway WebSocket closed with code 1006 because the caller's own
    Gateway went away.
  • The Clawcode agent process, its OCM snapshot child, and the wrapper process
    were no longer present.
  • The durable handoff receipt remained running.
  • ocm env snapshot list openclaw --json showed no new snapshot.
  • The environment remained stopped on the old 2026.8.1 binding.

A Rescue-hosted operator then took ownership and ran the same snapshot command
from outside the target environment. It completed successfully in about 84
seconds and created checkpoint 1788306816-305800000.

Expected behavior

OCM should not leave a target stopped with no snapshot merely because the
caller was hosted by the target Gateway.

Possible acceptable contracts:

  • Refuse the command before mutation when OCM can prove the caller belongs to
    the target Gateway, with guidance to run it from another environment.
  • Move the cold snapshot operation into a daemon-owned transaction that
    survives caller disconnection and restores the recorded service policy.
  • Provide a durable asynchronous transaction receipt that an external owner
    can monitor and recover without replaying the command.

Impact

  • A lifecycle agent can terminate itself mid-command.
  • The command has an unknown terminal outcome from the agent's perspective.
  • The target remains unavailable until another gateway or human takes over.
  • Naive retry risks duplicate lifecycle work because the original receipt is
    still nonterminal.

Evidence boundary

Proven:

  • The target-hosted agent invoked the command.
  • OCM stopped the target.
  • The caller and snapshot process disappeared.
  • No new snapshot was created.
  • The target remained stopped until external recovery.
  • The same command completed when run from a different Gateway.

Unknown:

  • Which layer should own self-lifecycle admission: OCM CLI, OCM daemon, or
    OpenClaw task handoff.
  • Whether the snapshot copy itself had begun before the caller was terminated;
    no terminal command result survived.

Evidence

The complete local receipt, logs, process observations, and recovery proof are
under:

/Users/hrudolph/.ocm/artifacts/openclaw-8.2/2026-09-01/openclaw-8.2-20260901T232956Z/

Key files:

  • 59-production-pre-snapshot-command.log
  • receipt.json
  • proof.json
  • 60-rescue-takeover-snapshot-list-command.log
  • 61-rescue-production-snapshot-command.log

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    P1Urgent regression or broken agent/channel workflow affecting real users now.clawsweeper:needs-maintainer-reviewClawSweeper marked this issue as needing maintainer review before automation.clawsweeper:no-new-fix-prClawSweeper does not recommend queueing a new automated fix PR for this issue.clawsweeper:source-reproClawSweeper found a high-confidence source-level issue reproduction.impact:crash-loopThis issue is about crashes, hangs, restart loops, or process-level availability.issue-rating: 🦞 diamond lobsterVery strong issue quality with high-confidence source-level or clear reproduction.

    Type

    No type

    Fields

    Priority

    None yet

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions