---
title: "overlane task recovery"
description: "Check a task's lease and source recovery from this workspace"
---

> Documentation Index
> Fetch the complete documentation index at: https://docs.overlane.app/llms.txt
> Use this file to discover all available pages before exploring further.

# overlane task recovery

{/* Generated by apps/docs/scripts/generate.mjs (CLI pages from the command registry in packages/cli). Do not edit; run `pnpm --filter @overlane/docs gen`. */}

Reads one task and compares its checkpoint to this workspace. A portable snapshot's ref is checked on the matching configured remote without fetching or restoring source. Reports local-only, missing or unavailable source separately from lease ownership. A held lease is never presented as proof that a worker is alive. Does not claim or alter the task.

## Usage

```sh
overlane task recovery task-id [--remote REMOTE]
```

## Arguments

| Argument | Required | Description |
| --- | --- | --- |
| `task-id` | yes | The task whose recovery to inspect |

## Flags

| Flag | Type | Required | Default | Description |
| --- | --- | --- | --- | --- |
| `--remote` | string | no |  | Configured remote matching the recorded repository (default: the snapshot's remote name) |

## Examples

```sh
overlane task recovery task-1
```

## Behavior

- Effect: `read` (changes nothing).
- Needs credentials: yes. Uses the network: yes.
- Supports `--dry-run`: no. Accepts `--force`: no.
- Machine-readable description: `overlane schema task recovery`.

## Result

With `--json` (the default when stdout is not a terminal) the command prints this JSON Schema's shape on stdout.

```json
{
  "type": "object",
  "properties": {
    "taskId": {
      "type": "string"
    },
    "state": {
      "type": "string"
    },
    "pauseReason": {
      "type": "string"
    },
    "lease": {
      "type": "object",
      "properties": {
        "status": {
          "type": "string",
          "enum": [
            "held",
            "expired",
            "none"
          ]
        },
        "holder": {
          "type": "string"
        },
        "expiresAt": {
          "type": "string"
        },
        "ownedHere": {
          "type": "boolean"
        },
        "workerLiveness": {
          "type": "string",
          "const": "unproven"
        }
      },
      "required": [
        "status",
        "ownedHere",
        "workerLiveness"
      ],
      "additionalProperties": false
    },
    "source": {
      "type": "object",
      "properties": {
        "status": {
          "type": "string",
          "enum": [
            "working_copy",
            "published",
            "local_only",
            "missing",
            "unavailable",
            "not_recorded"
          ]
        },
        "baseCommit": {
          "type": "string"
        },
        "snapshot": {
          "type": "object",
          "properties": {
            "kind": {
              "type": "string",
              "const": "git"
            },
            "remote": {
              "type": "string",
              "minLength": 1,
              "maxLength": 64,
              "pattern": "^[A-Za-z0-9][A-Za-z0-9._-]*$"
            },
            "repository": {
              "type": "string",
              "minLength": 3,
              "maxLength": 1024,
              "pattern": "^(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\\.)*[a-z0-9](?:[a-z0-9-]*[a-z0-9])?(?::[1-9][0-9]{0,4})?(?:\\/[A-Za-z0-9._-]+)+$"
            },
            "ref": {
              "type": "string",
              "maxLength": 1024,
              "pattern": "^refs\\/heads\\/overlane\\/checkpoints\\/(?:[A-Za-z0-9_-][A-Za-z0-9._-]*\\/)*[A-Za-z0-9_-][A-Za-z0-9._-]*$"
            },
            "commitSha": {
              "type": "string",
              "pattern": "^(?:[0-9a-f]{40}|[0-9a-f]{64})$"
            },
            "trackedAdditions": {
              "maxItems": 10000,
              "type": "array",
              "items": {
                "type": "string",
                "minLength": 1,
                "maxLength": 4096
              }
            }
          },
          "required": [
            "kind",
            "remote",
            "repository",
            "ref",
            "commitSha"
          ],
          "additionalProperties": false
        },
        "reason": {
          "type": "string"
        }
      },
      "required": [
        "status",
        "baseCommit"
      ],
      "additionalProperties": false
    },
    "matchesCheckpoint": {
      "type": [
        "boolean",
        "null"
      ]
    },
    "canResumeHere": {
      "type": "boolean"
    },
    "next": {
      "type": "array",
      "items": {
        "type": "string"
      }
    }
  },
  "required": [
    "taskId",
    "state",
    "lease",
    "source",
    "matchesCheckpoint",
    "canResumeHere",
    "next"
  ],
  "additionalProperties": false
}
```

See [exit codes](/cli/#exit-codes) for the status the process returns.

Source: https://docs.overlane.app/cli/task-recovery/index.mdx
