Errors

Errors

Agents should preserve the process exit code and structured error.code in summaries, then decide whether to retry, reattach, or change inputs.

Exit code table

ExitNameMeaning
1unexpectedUnexpected CLI or runtime error.
2usageLocal argument or validation error.
10authAuthentication is missing, expired, or invalid.
11forbiddenThe token lacks a required scope or project grant.
12notFoundA project, job, token, or artifact was not found.
20idempotencyConflictThe idempotency key is already attached to different input.
21apiVersionMismatchThe CLI and service API versions are incompatible.
30quotaCredit, quota, or account capacity is insufficient.
40providerA generation or publishing provider failed.
50auditA quality gate or audit check failed.
51distributionGateDistribution package or publish prerequisites are not met.
52publishPolicyPublish scope, platform, or privacy policy blocked the request.
53pipelineResetConflictThe pipeline could not be reset because state changed.
60cancelledThe job was cancelled.
61timeoutThe command timed out.
70serverThe service returned a server-side error.

JSON error shape

{
  "ok": false,
  "error": {
    "code": "missing_required_option",
    "message": "Missing required option --scopes",
    "details": {}
  }
}

Retry guidance

  • Retry timeout only when the command is idempotent or has an idempotency key.
  • Do not retry usage without changing arguments.
  • Do not retry forbidden without changing scopes.
  • Reattach rather than restart when a runId is known.