Skip to content
Sign in

Recovery

Restore earlier revisions, catch up after time offline, and resume interrupted downloads and uploads.

Restore an earlier revision, catch up on changes made while you were away, and finish downloads or uploads that were interrupted. These examples use the default saved credential and the private-files directory from Quick Start. If you start here, create it first with mkdir -p private-files and chmod 700 private-files.

Restore an earlier revision

List a file's retained revisions, with their author, expiry, and pinned reference:

agent-workplace files history FILE_UUID --json

isCurrent marks the current content, and version is the file's current version for conflict protection. History pages by revision UUID (--after, --limit), not by date, and isn't a snapshot. Expired revisions are unavailable even before cleanup runs.

Restore a retained revision as a new current revision:

agent-workplace files restore FILE_UUID \
  --revision REVISION_UUID --expected-version VERSION_UUID \
  --operation private-files/restore.json --json
agent-workplace files restore-status --operation private-files/restore.json --json
ResultMeaning
restoredIdentifies the new revision and version. Later edits may have happened since.
conflictThe file changed, or the revision is already current. Reload current state.
limitedNot enough storage. Free capacity, then choose a new operation.

conflict and limited leave content unchanged. After an interruption, read the status or repeat the original command with the same record. Detailed receipts last seven days, and evidence_expired never runs the old request again.

Restoring charges the full size of the new revision and attributes it to you. The source revision keeps its expiry and attribution, the displaced current revision expires seven days later, and other history is unchanged. Restoring requires current workplace access, including for history from before you joined and for retry status. The SDK's listFileRevisions lists history; in the dashboard, people can download or restore earlier revisions, restore trashed files, and (owners and admins) delete them permanently.

Catch up after being offline

Each agent keeps its own opaque checkpoint, so reading changes never advances another agent. A checkpoint grants no access; permissions are checked on every request.

On first use, as a new member, or after a gap, capture a checkpoint before listing the baseline:

agent-workplace files checkpoint --json
agent-workplace files baseline --limit 50 --json
agent-workplace files baseline --after ENTRY_UUID --json
agent-workplace files changes --cursor CHECKPOINT --limit 50 --json
  1. Baseline. List every authorized retained file and folder, including recoverable trash. Follow nextCursor with --after until it is null, and use files history for revisions as needed. It isn't a snapshot, but a new member can find unchanged files even after their creation events expired.
  2. Changes. Read from the checkpoint captured before the baseline. While nextCursor is set, pass it as --cursor; checkpoint stays null until that fixed range is consumed.
  3. Save progress. Reconcile each event against current state, and save the final checkpoint only after processing the whole range. Poll from it later.

Both listings accept limit from 1 to 100. Make replay safe: deduplicate by event ID or by position, keep positions as decimal strings (never JavaScript numbers), and don't apply old metadata over newer state. Keep cursors unchanged; modified or cross-workplace cursors are rejected.

Events name the entry, an optional revision, the action, the actor (or null for service cleanup), and the time. They're hints, not content or download grants, and expiry, deletion, and current permissions still apply. Cleanup admission and logical completion are separate events, and completion doesn't assert physical erasure. Resolve results with current file, history, and status reads; an unavailable file isn't evidence that its bytes can be recovered.

Gaps

Change history lasts 30 days. A response with state: "gap", baselineRequired: true, and history_expired or checkpoint_unavailable requires a fresh checkpoint and a full baseline; never treat it as an empty page. If a gap happens while building a baseline, restart it. Expiry applies even when background pruning is late. The CLI prints gaps as successful structured output, so check state.

Resume a CLI download

Give a download an operation record so it can resume:

agent-workplace files get \
  'awp:file:WORKPLACE:FILE:revision:REVISION' \
  --output ./report.bin --operation private-files/download.json

Repeat the same command after an interruption. The record pins the server, account, workplace, revision, and output path; current access is checked again. The CLI rehashes saved bytes, resumes in bounded ranges, and creates the destination only after verifying the whole file. It never overwrites an existing file, and retrying a completed download accepts only its own unchanged, verified file.

Unverified bytes stay in a private directory beside the destination; keep it and the record until recovery finishes. Without --operation, downloads still stream and verify before saving, but progress can't be resumed by another run. Binary files can be up to 2,000,000,000 bytes.

Crash safety

  • Bytes are synced before the record advances, and replacing the record or creating the destination also syncs the parent directory.
  • A crash before ownership of a new path is recorded can leave an artifact that can't be safely adopted. Keep it, and start a new operation with a different record and output. Unexpected or replaced artifacts are never removed recursively.
  • These safeguards need a POSIX filesystem with working exclusive creation, hard links, and sync. They don't protect against hardware failure or another process using your account.

Recover a pending upload

An upload stays pending until it is published. Each upload has one fixed 60-minute deadline that retries and grant renewal never extend. Finalizing an upload larger than 64 MiB returns pending while a worker processes it; check files status UPLOAD_ID until the result is final, or pass --wait to files put to wait for it.

Finalization is saved before server-side preparation begins. If preparation capacity is busy or an API process stops, the upload can stay pending while the service recovers it. Inspect files status, or repeat the same immutable upload.

Revoking a key or an expired human session stops its queued finalization from running; the service never switches to another credential. A caller with current access can finalize the same upload again with files finalize UPLOAD_ID or SDK finalizeFileUpload. This doesn't reread the source file, and keeps the original upload, content, and deadline.

On this page