Skip to main content

Failure classification

Terminal execution errors retain their broad code and human-readable message. New failures also carry an evidence-based cause, shared by the runtime, CLI JSON output, API run responses, and plugin error events. Session-list responses expose it as errorCause; full session records use error.cause. Causes are additive. Consumers must tolerate missing or future values. Historical errors are not rewritten or guessed from message text. INCOMPLETE remains an agent-declared outcome, not a crash: its cause is the blocker kind (missing_tool, no_access, waiting_on_human, and so on), with error.subject naming the stuck thing and error.causeSource (runtime, approval, agent, or inferred) saying how it was established. agentuse sessions list --json exposes these as errorCause and errorCauseSource. Failure classification does not change retry policy or imply that replaying a run with prior side effects is safe.

Reviewer-rejected incomplete runs

A human rejection can leave a run error/INCOMPLETE while automatically setting dismissedAt, which removes it from attention queues without erasing history. An incomplete report_outcome accepts an optional rejectionOnly boolean: set it to true when a human rejection in the run or a delegated child is the sole blocker. The runtime verifies the recorded human decision and leaves the run visible if any descendant is still active or has an independent failure. Machine review rejections and manually dismissed failures do not establish human rejection. When independent failures remain, set rejectionOnly: false and describe those unresolved failures in reason, rather than repeating the rejected action. Older declarations without the field retain same-session rejection handling; propagating dismissal to a parent requires an explicit rejection-only declaration. Existing historical sessions are not rewritten.

Directory Structure

Sessions are stored under AGENTUSE_DATA_DIR, which defaults through XDG conventions to ~/.local/share/agentuse:

Path Components

Subagent Sessions

When an agent invokes subagents, their sessions are nested:
Each descendant repeats the same structure beneath its direct parent. The stored parentSessionID preserves that hierarchy for recursive delegation and lets session views render important nested work in context.

Data Schemas

SessionInfo

Stored in session.json at the root of each session directory.

Message

Stored in {messageID}/message.json. Contains both user input and assistant response.

Parts

Stored in {messageID}/part/{partID}.json. Each part represents a discrete unit of content.

Base Fields

All parts include these fields:

Part Types

TextPart

ReasoningPart

ToolPart

FilePart

AgentPart

StepStartPart

StepFinishPart

The mock flag is what keeps test runs out of the operational views. It is set by agentuse test and agentuse run --mock, and absent on a normal run. agentuse sessions show surfaces it as a warning line so a fabricated result is never mistaken for a real one:
List views mark the same sessions with a trailing · mock.