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
| Exit | Name | Meaning |
|---|---|---|
| 1 | unexpected | Unexpected CLI or runtime error. |
| 2 | usage | Local argument or validation error. |
| 10 | auth | Authentication is missing, expired, or invalid. |
| 11 | forbidden | The token lacks a required scope or project grant. |
| 12 | notFound | A project, job, token, or artifact was not found. |
| 20 | idempotencyConflict | The idempotency key is already attached to different input. |
| 21 | apiVersionMismatch | The CLI and service API versions are incompatible. |
| 30 | quota | Credit, quota, or account capacity is insufficient. |
| 40 | provider | A generation or publishing provider failed. |
| 50 | audit | A quality gate or audit check failed. |
| 51 | distributionGate | Distribution package or publish prerequisites are not met. |
| 52 | publishPolicy | Publish scope, platform, or privacy policy blocked the request. |
| 53 | pipelineResetConflict | The pipeline could not be reset because state changed. |
| 60 | cancelled | The job was cancelled. |
| 61 | timeout | The command timed out. |
| 70 | server | The 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.