---
title: "Atomically publish drained command outcome workspace and plan acknowledgement"
method: POST
path: "/api/v1/agent/persistent/compute/commands/complete"
tags: ["agent"]
---

# Atomically publish drained command outcome workspace and plan acknowledgement

`POST /api/v1/agent/persistent/compute/commands/complete`

## Request

- Base URL: `https://composal.com` (the document declares no server; this is the origin it was published from)
- URL: `https://composal.com/api/v1/agent/persistent/compute/commands/complete`
- Auth: HTTP bearer

Trusted executor only. No provider keys or model-chosen authority. Private bodies must never enter Temporal Workflow history or heartbeat data.

## Request body

- object
  - `scope` PersistentAgentWorkerScope, required
    - `task_id` string, required
    - `segment_id` string, required
    - `generation` integer, required
    - `claim_id` string, required
  - `action` PersistentAgentToolAction, required
    - `schema` 1, required
    - `id` string, required
    - `task_id` string, required
    - `tool` string, required
    - `arguments` object, required
  - `frame` PersistentAgentWorkspaceCommandFrame, required
    - `schema` 1, required
    - `state` 'completed', required
    - `drained` true, required
    - `action_id` string, required
    - `command_digest` string, required
    - `exit_code` integer, required
    - `stdout` string, required: At most 2048 UTF-8 bytes.
    - `stderr` string, required: At most 2048 UTF-8 bytes.
    - `truncated` boolean, required
  - `snapshot` PersistentAgentWorkspaceSnapshot, required: Bounded portable snapshot: exact declared file order, at most 512 KiB decoded total and 1 MiB canonical JSON. No image/runtime authority or provider allocation is stored.
    - `schema` 1, required
    - `spec` PersistentAgentWorkspaceSpec, required
      - `task_id` string, required
      - `configuration_commit` string, required
      - `image` string, required: Explicit nonmoving provider image version; the trusted runtime independently verifies the applied image.
      - `setup_digest` string, required
      - `durable_paths` string[], required: Sorted relative regular-file paths; no overlaps, credentials or reserved paths.
    - `files` PersistentAgentWorkspaceFile[], required
      - `path` string, required
      - `mode` 384 | 448, required
      - `size` integer, required
      - `sha256` string, required
      - `content` string, required: Canonical strict base64; decoded bytes must match size and sha256.

## Response `200`

Private allocation-bound exchange

- object
  - `result` PersistentAgentToolResult, required
    - `id` string, required
    - `name` string, required
    - `text` string, required
    - `data` unknown, required
    - `is_error` boolean, required
  - `version` string, required

## Other responses

- `401`: Compute credential unavailable or revoked
- `403`: Current task or capability unavailable
- `404`: Task unavailable
- `409`: Reconciliation required; dispatch retries are lookup only
- `422`: Invalid request
- `503`: Canonical source unavailable

---

[API](https://skmtc.dev/composal/apis/vex-api.md) - [All operations](https://skmtc.dev/composal/apis/vex-api/llms.txt) - [OpenAPI document](https://skmtc.dev/composal/apis/vex-api/revisions/74298a24e040?raw)
