Skip to content
Documentation

Errors and uncertain results

First distinguish a transport failure from a tool result. An HTTP or connection error does not tell you whether the requested mutation ran. Patch, process, and coordination states have separate identifiers.

Transport failures

Authentication rejection before a handler creates no operation. A disconnect or proxy error can occur after dispatch, so it does not prove that no operation exists. HTTP 401/403, 404, 408, 429, and 502/503/504 are classified as transport failures by the domain helper; inspect the actual request stage and recover recorded work where possible.

Tool error codes

Errors use uppercase identifiers and a message. An operation_id may be present if a patch record was created before the failure. An approval_id is present on confirmation-hold errors. Policy, occupancy, and key-conflict failures before a patch record do not have an operation id.

CodeMeaning
UNAUTHORIZEDAction denied by tool policy
WORKSPACE_NOT_FOUNDWorkspace ID is not registered
WORKSPACE_BUSYAnother mutation or live command owns the workspace
INVALID_PATCHPatch parsing, preflight, or result verification failed; also retained in some helper/input error paths
INVALID_COMMANDMalformed argv rejected before dispatch
PROCESS_SPAWN_FAILEDBackend confirmed no managed process was established
PATH_ESCAPERequested path leaves workspace scope
FILE_NOT_FOUNDTarget path does not exist
PATH_NOT_DIRECTORYA required directory component is not a directory
FILE_OPERATION_FAILEDFilesystem operation failed within the authorized scope
SYMLINK_REJECTEDA symlink path was rejected
SPECIAL_FILE_REJECTEDDevice, socket, FIFO, or other non-regular target rejected
ADD_FILE_EXISTSAdd destination already exists
MOVE_DESTINATION_EXISTSMove destination already exists
VERSION_CONFLICTCurrent content does not match the expected version
OPERATION_KEY_CONFLICTSame patch key was used with different arguments
OPERATION_NOT_FOUNDUnknown lookup ID/key, or not exactly one identifier supplied
PROCESS_NOT_FOUNDProcess handle missing, expired, or stdin already closed on write
PROCESS_NOT_TTYprocess_resize on a pipe-backed (tty: false) process
PROCESS_NOT_RUNNINGprocess_resize on a handle that exists but is not running
OUTPUT_LIMITHelper output exceeded its bound; process reads instead discard old bytes
TIMEOUTA managed command or helper exceeded its time limit
WORK_NOT_FOUNDUnknown logical work
WORK_CLOSEDOperation requires an open work
INTENT_NOT_FOUNDUnknown user instruction
INTENT_ALREADY_CLAIMEDInstruction has already been claimed
INTENT_NOT_EDITABLEInstruction state does not permit editing
INTENT_REVISION_CONFLICTInstruction revision changed
QUEUE_NOT_EMPTYReserved code; work_finish currently returns closed:false
APPROVAL_REQUIREDPolicy allowed the mutation; confirmation is required before execution. Includes approval_id. Not a privilege grant
APPROVAL_NOT_FOUNDUnknown confirmation-hold id
APPROVAL_CONFLICTHold is still pending, already decided, or a resume is already in progress
APPROVAL_AMBIGUOUSResume was interrupted and the terminal result is not on disk. Includes approval_id; patch cases may also include operation_id

Dispatch and completion

dispatch_status: unknown is a successful exec result describing an uncertain dispatch, not proof that no process started. Use the returned process handle if reachable and avoid duplicate launches. confirmed acknowledges dispatch; it does not mean command success.

Linux helper preparation/protocol/start errors occur before a managed process exists and use PROCESS_SPAWN_FAILED. Once the helper is running, plan load, inner sandbox, or proxy-start failure becomes process termination. Use process_status to observe that outcome; EOF is not success. On Linux sandbox the wait status belongs to the managed child (helper argv).

For patches, see the status table and rollback limits. For retries, timeouts, missing handles, and user-instruction completion, follow Agent Loop integration. A work_finish response with closed: false and reason: "pending_user_input" is an application result, not a transport failure.