Errors and exit codes
Every abt command ends with one of three exit codes. Most errors also carry a stable E_* code that you can search for, match in CI, or report.
Exit codes
| Exit | Meaning | Examples |
|---|---|---|
0 |
The command finished. Dry runs, abt doctor (even when its report lists errors, unless the project could not be fully checked) and abt watch list also exit 0. |
abt compile, abt run -s reviewer -p "Review: revenue grew 40%, no citations." --dry-run, abt lint on a clean project |
1 |
The command ran and failed, or an unexpected exception escaped. A run, dispatch or build whose result failed, a failed test case, abt lint finding files to reformat and abt debug with a failed check also exit 1. |
abt dispatch -s nope (E_RUNTIME), abt approvals show ap_nope (E_NOT_FOUND), abt docs serve before abt docs generate, a Python traceback |
2 |
Usage or configuration error. The command did nothing. | abt run -s nope -p hi (E_CLI_USAGE), abt run without -s (E_CLI_USAGE), an unknown flag, abt run --manifest nope.json (E_MANIFEST_MISSING), abt run --profiles-dir ./nodir (E_PROFILES_DIR_MISSING), abt graph nope (E_GRAPH_NOT_FOUND), abt test -n nope, abt clean --runs without --keep or --older-than, abt publish --local with no public agent |
A failing compile exits 2 for a project error (an unknown subagent, a duplicate agent name, a workflow edge to an unknown agent, an unknown config: key or middleware, an unset env_var() in profiles.yaml) and 1 for a missing template variable (Missing required template variable(s)).
An error carries its own exit code, and the default is 2. Errors raised while a run, dispatch or approvals command executes usually set 1.
A run that reaches max_model_calls or max_total_tokens is not an error code: it ends with the result's warning set to budget_exhausted (see run artifacts) and keeps the text produced so far. It exits 1 only when the model produced no text yet. See run guardrails.
abt watch commands exit 2 when no entrypoint is selected or a name is unknown. See the abt watch reference.
Reading an error
Most commands print ERROR: <message>, then an optional hint, then the code in parentheses:
ERROR: Missing -s/--select AGENT (or --auto). `abt list` shows the agents.
(E_CLI_USAGE)
abt compile prints the message without the code. Run abt list or abt doctor on the same project to see it.
Some failures have no code: a flag the command line parser rejects prints its own usage message, and a stray exception prints a Python traceback. Typed errors are the ones in the tables below.
Error codes
This list holds every code raised in this repository's version of abt. The meaning of each is read from where the code is raised.
Command line and runtime
| Code | Raised when |
|---|---|
E_CLI_USAGE |
A flag value or combination is invalid. For example -s naming an unknown agent (the message suggests the closest name), -s with --auto, a missing -s, --artifact-dir without --stateless, an unparsable --vars, abt test -n matching no test, or abt approvals cancel with neither an ID nor --thread-id. |
E_RUNTIME |
A run, dispatch or test hit a value, file or runtime error, such as an unknown workflow name. Exit 1. |
E_INTERNAL |
An unexpected internal error (a TypeError) reached a run, dispatch or test. It is a bug: report it. |
E_WORKSPACE_NOT_WRITABLE |
target/ or logs/ under the workspace cannot be written (a read-only mount or another user's checkout). The message names the directory. Make it writable or set AGENT_WORKSPACE_DIR to one that is. Exit 1. |
E_CHECKPOINT_CONFIG |
A persistent checkpoint backend is selected but no thread ID can be derived. Pass --thread-id. |
E_UNKNOWN_AGENT |
abt test --only-agent, a workflow node or a registry lookup names an agent that is not in the manifest. |
E_UNKNOWN_WORKFLOW |
abt dispatch or abt chat got a name that is not a workflow. |
E_AGENT_NOT_COMPILED |
The agent is in the manifest without a rendered prompt. The manifest came from abt compile -s, or was published with strip_prompts: true. Run abt compile without -s. |
E_MANIFEST_MISSING |
The file given to --manifest does not exist, or abt approvals poll found no compiled manifest. Run abt compile first. |
E_MANIFEST_SCHEMA |
manifest.json was written by a different abt version. Run abt compile again. |
E_PROMPT_UNRESOLVED_WORKFLOW_REF |
A prompt still contains {{ source(...) }} or {{ upstream(...) }} outside a workflow. Run it through abt dispatch, or take the reference out. The invoke API rejects the same text in input. |
E_REGISTRY_NOT_INITIALIZED |
Python API: an agent was looked up before the registry was loaded from a manifest. AgentBuildTool does this for you. |
E_NO_PROFILE |
No model profile is active. abt doctor --deep found none, or code asked for the profile before the project was activated. |
E_NO_PROJECT_CONFIG |
Code asked for the project config before the project was activated. |
Project files and profiles
| Code | Raised when |
|---|---|
E_NO_PROJECT |
No abt.yaml in the project root or any parent directory. The command stops before writing anything. Run it inside a project, pass --project-root, or create one with abt init. |
E_INVALID_ABT_YAML |
abt.yaml is unreadable, not valid YAML, repeats a key, or sets a paths: folder to a blank or non-text value (e.g. agents: 123). The message names the key. |
E_INVALID_VARS_YAML |
vars.yaml is not valid YAML or is not a mapping. |
E_INVALID_PROJECT_CONFIG |
config:, agents: or approvals: in abt.yaml is not a mapping, has an unknown key (the message suggests the closest name), or has a bad value or template. |
E_INVALID_MCPS_PATH |
paths.mcps points to a file instead of a directory. |
E_INVALID_SKILLS_PATH |
A paths.skills entry is not a string. |
E_PROFILES_DIR_MISSING |
--profiles-dir was given but holds no profiles.yaml. |
E_INVALID_PROFILES_YAML |
profiles.yaml is not valid YAML. The message names the file, line and column. |
E_PROFILES_TOP_LEVEL |
The top level of profiles.yaml is not a mapping. |
E_PROFILE_MISSING |
profiles.yaml has no profile and abt.yaml sets no profile:. |
E_PROFILE_NOT_FOUND |
The profile named by profile: is not in profiles.yaml. |
E_PROFILE_NO_TARGET |
The profile does not set target:. |
E_PROFILE_NO_OUTPUTS |
The profile has no outputs: mapping. |
E_PROFILE_TARGET_NOT_FOUND |
The target chosen by --target or target: is not under outputs:. |
E_PROFILE_ENV_MALFORMED |
An ABT_TARGET__<TARGET>__* variable name matches no known field or section. See env-var-only targets. |
E_PROFILE_MISSING_NAMESPACE |
A selected agent's package tool needs a credentials: namespace that profiles.yaml lacks. |
E_ENV_VAR_MISSING |
{{ env_var('NAME') }} is used, NAME is unset and no default was given. |
E_ENV_VAR_TEMPLATE |
An env_var(...) call is malformed, or sits in a prompts/*.md or context/*.md body, where it is not allowed (see Jinja variables). Use {{ env_var('NAME') }} or {{ env_var('NAME', 'default') }} elsewhere. |
Agents and resources
| Code | Raised when |
|---|---|
E_AGENT_VALIDATION |
An agent file failed validation, for example an invalid subagents: entry, a file that is not UTF-8, or blank lines before the opening ---. Compile fails and names every invalid file. |
E_AGENT_MODULE_LOAD |
A Python agent module under agents/ failed to import. |
E_AGENT_TEMPLATE_ERROR |
Rendering an agent's prompt failed during compile, for example because the body calls env_var(). |
E_DUPLICATE_AGENT |
Two agent files resolve to the same name. |
E_AGENT_FRONTMATTER |
An agent file's frontmatter is not valid YAML. The message names the file, line and column. |
E_DUPLICATE_RESOURCE |
Two prompts, or two resources of the same kind (for example two sources), share a name. |
E_INVALID_RESOURCE_YAML |
A file under sources/, exposures/, retrievers/, transformers/, triggers/ or workflows/ is malformed. For example it has no name or type, or config: is not a mapping. |
E_UNKNOWN_DEPENDENCY |
A subagents: entry names an agent that does not exist. |
E_DEPENDENCY_CYCLE |
Agents delegate to each other in a cycle. |
E_TEST_UNKNOWN_AGENT |
A tests/ suite or singular test names an agent that does not exist. The message suggests the closest agent name. |
E_ACTIVATION_ACCESS_DENIED |
An agent lists a private agent from another group under subagents:. |
E_UNKNOWN_RESOURCE_REF |
An agent's retrievers: or transformers: entry names a resource that does not exist. The message suggests the closest name. |
E_TRIGGER_REF_MISSING |
A trigger: reference names no resource under triggers/. |
E_EVENT_SCOPE |
{{ event.* }} is used outside a trigger binding's vars:. |
E_CONTEXT_FETCH |
With --live, an external context (confluence, github, s3) could not be fetched. The message names the context. |
E_INVALID_OUTPUT_SCHEMA |
An agent's output_schema cannot be turned into a model. |
E_INVALID_SUBAGENT_MODE |
A subagents: entry has a mode: that is not sync, async or fork. |
E_UNKNOWN_TOOL_REF |
A Python tool that an agent lists in tools: is not defined by any tool module, or its module failed to import. |
E_ISOLATED_TOOL |
An @isolated_tool cannot run in its own environment: an invalid requirement, a URL other than a pinned git+https/git+ssh one, a parameter the runtime fills in (ToolRuntime, config, callbacks), *args/**kwargs, content_and_artifact, or Windows. Fails compile. A package that cannot be installed, or a missing uv, shows up at run time instead. |
E_UNKNOWN_SKILL_REF |
A local skill that an agent lists cannot be found. |
E_MCP_TOOL_VALIDATION |
A tool spec names no MCP source. With --live, also an MCP server whose tools could not be listed, or a spec naming a tool its server does not expose. |
E_DUPLICATE_TOOL_NAME |
Two tools bound to one agent share a bare name. MCP tools drop their <source>__ prefix when the model sees them. |
E_RECURSION_LIMIT_TOO_LOW |
recursion_limit cannot fit the round trips that model_call_limit allows. The message prints the minimum. |
Middleware and handlers
| Code | Raised when |
|---|---|
E_INVALID_MIDDLEWARE |
A middleware: declaration is malformed. |
E_UNKNOWN_MIDDLEWARE |
A middleware: entry names a middleware that is not registered. The message lists the available ones. |
E_INVALID_MIDDLEWARE_CONFIG |
A middleware entry has an unknown key or a bad value. |
E_MIDDLEWARE_ORDERING |
Project-local or third-party middleware declare ordering constraints that contradict each other, so no order satisfies them. |
E_MIDDLEWARE_DUPLICATE |
Two middleware in one agent's stack have the same name. |
E_HANDLER_UNKNOWN |
Frontmatter or config names a handler class that is not registered. |
E_HANDLER_INVALID |
An on_success or on_failure entry is not a class name or a single-key mapping. |
E_HANDLER_INVALID_KWARG |
A handler entry passes a keyword its __init__ does not accept. |
E_HANDLER_MISSING_KWARG |
A handler entry omits a required __init__ parameter. |
E_HANDLER_DUPLICATE |
Two modules under paths.handlers define the same class name. |
E_HANDLER_IMPORT_FAILED |
A module under paths.handlers raised while importing. |
E_HANDLER_CONFIG |
Validation of config.handlers failed. |
E_HANDLER_FAILED |
A lifecycle handler raised or timed out. The run records it in run_results.json. With --fail-on-handler-error it also fails the run. |
Workflows
| Code | Raised when |
|---|---|
E_WORKFLOW_INVALID_EDGE |
An edge or steps: entry is malformed: the wrong shape, unknown keys, an edge out of END, or an edge into START. |
E_WORKFLOW_DUAL_FORM |
A workflow sets both steps: and edges:, or an edge mixes when/cases with conditions. |
E_WORKFLOW_MISSING_FORM |
A workflow sets neither steps: nor edges:. |
E_WORKFLOW_CONDITION_NO_DEFAULT |
A conditional edge has no default. |
E_WORKFLOW_DUPLICATE_EDGE |
The same edge or condition appears twice. |
E_WORKFLOW_UNKNOWN_AGENT |
An edge names a node that does not exist. |
E_WORKFLOW_NODE_NAME_COLLISION |
One node name is used by two kinds of resource (agent, source, prompt, exposure). |
E_WORKFLOW_INVALID_EXPOSURE_EDGE |
An exposure routes into something other than another exposure or END. |
E_WORKFLOW_NO_ENTRY |
No edge starts at START. |
E_WORKFLOW_UNREACHABLE_NODE |
A node cannot be reached from START. |
E_WORKFLOW_NO_PATH_TO_END |
A node has no path to END. |
E_WORKFLOW_CYCLE_NO_BUDGET |
The workflow has a cycle and no max_iterations. |
E_WORKFLOW_BUDGET_UNUSED |
The workflow sets max_iterations but has no cycle. |
E_WORKFLOW_RESERVED_NAME |
A workflow or agent is named like a reserved node (START, END). |
E_WORKFLOW_DUPLICATE_NAME |
Two workflow files declare the same name. |
E_WORKFLOW_MAX_ITERATIONS |
At run time a node would run more often than max_iterations allows. |
E_WORKFLOW_DEADLOCK |
At run time nothing can run, but nodes are still outstanding. |
E_WORKFLOW_EXPOSURE_FAN_IN |
An exposure node has more than one predecessor. |
E_WORKFLOW_MISSING_SOURCE_FETCHER, E_WORKFLOW_MISSING_PROMPT_RENDERER, E_WORKFLOW_MISSING_EXPOSURE_DISPATCHER |
Python API: the workflow reached a source, prompt or exposure node, and the caller supplied nothing to run it. |
E_WORKFLOW_RESUME_STATE_MISSING |
Approvals are pending on a thread, but the checkpoint store holds no pause state. See External approvals. |
E_GRAPH_NOT_FOUND |
abt graph found no workflow files, or none with that name. |
E_GRAPH_SCHEMA |
abt graph read a workflow file that does not match the schema, or got an unknown --format. |
Approvals, stateless runs and chat
| Code | Raised when |
|---|---|
E_NOT_FOUND |
abt approvals was given an ID that is not in the store. |
E_APPROVAL_STORE_UNSUPPORTED |
A custom approval store has no record_decision, which abt approvals resume needs. |
E_APPROVAL_STORE_ACCESS_DENIED |
The DynamoDB approval store's role lacks dynamodb:Scan on the GSI1 index ARN (abt approvals list). |
E_STATELESS_APPROVALS |
A stateless run uses a checkpoint or approval store that does not outlive the scratch workspace. See Stateless runs. |
E_STATELESS_WORKSPACE |
The stateless temp workspace would sit inside the project root. Set TMPDIR outside it, or unset AGENT_WORKSPACE_DIR. |
E_CHAT_COMPILE |
abt chat could not compile the project, so the session did not start. |
E_CHAT_THREAD_MISMATCH |
abt chat --thread-id names a thread that belongs to a different workflow. |
Publishing and loom
| Code | Raised when |
|---|---|
E_PUBLISH_NO_CONFIG |
abt publish found no publish: section (and no --local), or no targets in it. |
E_PUBLISH_NO_PUBLIC_AGENTS |
No agent has access: public. |
E_PUBLISH_INVALID_TARGET |
A publish: target has an unknown type. |
E_PUBLISH_UPLOAD_FAILED |
Uploading to a target failed. |
E_PUBLISH_COMPILE_NEEDED |
The compile that abt publish runs first produced no manifest. |
E_PUBLISH_REMOTE_SKILL_MISSING |
Remote skills of a published agent did not resolve, so the manifest would ship without them. |
E_LOOM_ACCESS_DENIED |
A loom import names an upstream agent that is not access: public. The invoke API returns it as 403 for a private or unknown agent. |
E_LOOM_AGENT_NOT_COMPILED |
An upstream agent was published with strip_prompts: true. Import it with mode: remote. |
E_LOOM_AGENT_NOT_FOUND |
The include: list names an agent the upstream does not contain. |
E_LOOM_CIRCULAR |
Loom upstreams depend on each other in a cycle. |
E_LOOM_INVALID_AGENT |
An agent row in an upstream manifest is invalid. |
E_LOOM_LOAD_FAILED |
A required upstream failed to load. |
E_LOOM_MANIFEST_MISSING |
The manifest of a required upstream was not found. |
Watch and the invoke API
| Code | Raised when |
|---|---|
E_DISPATCH_REQUEST_INVALID |
A queue message is not a valid dispatch request: an unknown kind, or a missing or empty selector. |
E_IDEMPOTENCY_KEY_REUSED |
HTTP 422: the same idempotency_key was sent with a different input or vars. |
E_INVOKE_VARS_UNKNOWN |
HTTP 400: vars names a variable the agent's prompt does not use. |
E_INVOKE_VARS_INVALID |
HTTP 400: a vars value contains {{, {%, {# or a NUL character. |
The full response table is in the abt watch reference.
Benchmarks
| Code | Raised when |
|---|---|
E_BENCH_INVALID |
A benchmark file is invalid, or its stub_tools match no tool in the workflow. |
E_BENCH_SHAPE |
The baseline cannot be compared: the project does not exist at that ref, or it lacks something your changes added. Use --no-baseline. |
E_BENCH_GIT |
A git command failed, or no default branch was found. Pass --against <ref>. |
E_BENCH_COMPILE |
One side of the comparison failed to compile. |
E_BENCH_IO |
There are too many result folders with the same name. |
abt create and abt modify
Each code exists once with a CREATE and once with a MODIFY form, for example E_CREATE_FAILED and E_MODIFY_FAILED.
| Suffix | Raised when |
|---|---|
USAGE |
Arguments are invalid: --max-attempts below 1, --timeout of 0 or less, no --auto-approve and no confirmation callback, or paths: in abt.yaml moves a folder the command writes to. |
INVALID_PLAN |
The plan is empty or breaks a rule: a path outside the allowed folders, a Python file without --allow-python, a duplicate file, an existing file in files (abt modify changes it with edits), an edit whose old text is missing or occurs more than once, an edit to a file the model never read, or a plan that changes nothing. |
NOTHING_TO_DO |
The model decided the request needs no change, for example the resource already exists or the request asks for a delete, and said why. It is not retried. |
STALE |
A file changed while the plan was under review. Nothing was applied; run the command again. |
IO |
Writing the approved files failed, for example a full disk. Nothing is left half-written. |
TOO_MANY_QUESTIONS |
The model kept asking clarifying questions without producing a plan. The message quotes the last question; put that detail in the prompt. |
NO_PROFILE |
The project has no usable model profile. |
FAILED |
Every attempt failed to compile, or the plan compiled in the copy but not in the project (then it is rolled back). The message holds the last error. |
E_SCAFFOLD_STAGE has no CREATE/MODIFY form. It means the project could not be copied to check the plan in, for example when the disk is full.