Acreum Docs
Plan mode for agents

Plan errors

Every plan error carries retryable and next_action, so an agent knows what to do without guessing.

Every error is an RFC 7807 problem with a stable code. The PLAN_* codes, API_KEY_PLAN_ONLY and TRANSACTION_RETRYABLE also carry retryable and next_action. Act on next_action.

The same table is in the error_codes field of GET /v1/plans/capabilities, so an agent can read it at run time.

next_action

next_actionDo this
fix_stepChange the step named by pointer, preview again.
re_previewPreview again, read the differences, then commit the new plan_id.
retry_laterWait a few seconds and send the same request again.
split_planBreak the plan into smaller plans; give them one session_id to undo them together.
use_plan_modeSend this write through POST /v1/plans/preview and POST /v1/plans.
release_first(on PLAN_UNDO_BLOCKED) If a blocker's blocking_run_id is set, undo that run or its session first. Otherwise remove the outside reference, or correct the records through the normal edit and void routes instead of undoing.
contact_operatorStop and tell the person you work for.

Codes

CodeHTTPRetryablenext_action
API_KEY_PLAN_ONLY403nouse_plan_mode
PLAN_DRIFT409nore_preview
PLAN_DUPLICATE_REF422nofix_step
PLAN_NOT_FOUND404nofix_step
PLAN_NOT_HELD409nocontact_operator
PLAN_ORG_BUSY409yesretry_later
PLAN_RAW_DB_ACCESS500nocontact_operator
PLAN_REF_FORWARD422nofix_step
PLAN_REF_UNRESOLVED422nofix_step
PLAN_ROUTE_NOT_PLANNABLE422nofix_step
PLAN_TIMEOUT504yessplit_plan
PLAN_TOO_LARGE413nosplit_plan
PLAN_UNDO_BLOCKED409norelease_first
PLAN_UNDO_CONFLICT409nocontact_operator
TRANSACTION_RETRYABLE409yesretry_later

Notes

  • PLAN_ORG_BUSY: one plan runs per org at a time, and a few per server. A second one is refused at once rather than queued.
  • PLAN_TIMEOUT: the plan ran past its 20 s budget. Nothing is kept. context.report shows the steps that ran; the rest are skipped with reason: time_budget.
  • API_KEY_PLAN_ONLY: the key may write only through plan mode. Its GET calls work as usual.
  • Idempotency codes carry no next_action: IDEMPOTENCY_KEY_REQUIRED (400, add the header), INVALID_IDEMPOTENCY_KEY (400, fix the key's format), IDEMPOTENCY_CONFLICT (409, the key was used with a different body; use a new key). See Retrying a commit.
  • A bad plan shape (missing steps, a header name not allowed, allow_drift with steps) is 400 VALIDATION_FAILED with context.pointer.

Every code, plan or not, is in the error code catalog.

On this page