Skip to content

Agent Error Recovery

What each error code means and the recovery an agent should take.

Updated September 3, 20261 min readPostsale CLI

From AGENTS.md. On gated abort, use envelope data.gate and data.next.

error.codeAction
auth_requiredpostsale auth login or POSTSALE_TOKEN
api_key_unsupportedThe active credential is an API key and this operation needs a login session (user profile, automations, templates, key/payment/subscription management). Not retryable on the key; surface to a human or skip (exit 100)
api_key_rejectedThe API key was refused. If error.missing_scopes is present, the owner grants those permissions in the Postsale app (effective within about a minute); otherwise the key is unknown, revoked, disabled, or off-plan. Never "log in"; do not retry (exit 100)
subscription_inactiveSurface to human (billing)
validation_failedFix error.details fields
rate_limitedWait error.retry_after seconds
confirmation_requiredgate=direct → retry with --yes; gate=swarm_size → interactive TTY only
swarm_authorization_requiredBatch gate: TTY approve or POSTSALE_SWARM_AUTOAUTH=1; reword read templates if keyword false positive
user_denied / swarm_aborted_by_userDo not retry without new human instructions
terms_acceptance_requiredOwner-action gate (gate=owner_action). accept_channel=hosted_page → relay accept_url; in_app (Shipsurance) → relay remediation. Owner-only; STOP, don't retry until confirmed (exit 78)
subscription_reactivation_requiredOwner-action gate (gate=owner_action). Relay reactivate_url to the human owner; STOP, don't retry until reactivated (exit 101)
account_creation_requires_humanOwner-action: account creation / signup is browser-only, human-only. Cannot be done by the agent (exit 78)
operation_not_in_v0_allowlistCheck error.safety_class; allowlist refusal
network_errorBrief wait + retry
request_timeoutRetry or raise POSTSALE_HTTP_TIMEOUT_MS
update_channel_closedThe public release channel is not open yet; do not retry (exit 78)
not_foundVerify id with search first (exit 104)

Exit codes

See reference/exit-codes.md.

Empty results are not always an error

Zero-order search may be a filter miss. Read _cli_meta.empty_result_context before reporting no work.

Additional Reading