Ai::Agent

Beta

An agent runtime with a budget, context management, memory, checkpoints and deterministic replay. Its step-by-step API fits the tick of a game server or any event loop.

Optional module: turn it on with -DETHEREAL_AI_AGENT=ONInclude #include <ethereal/cpp/ai/agent/agent_inc.hpp>C layer

agent_inc.hpp

#include <ethereal/cpp/ai/agent/agent_inc.hpp>

The whole of Ai::Agent.

agent.hpp

#include <ethereal/cpp/ai/agent/agent.hpp>

Ai::Agent: the loop that talks to the model, runs the tools, manages the context, the memory and the budget, and can be paused, resumed and replayed.

C++
Agent::SAgentConfig Config;
Config.pClient = &Client;            /// Ai::Llm, shared by many agents
Config.pTools = &Registry;           /// Ai::Tools, final
Config.sModel = "claude-opus-5-5";
Config.Budget.uMaxOutputTokens = 20000;
Agent::CAgent A;
Agent::CAgent::Create( Config, &A );
A.AddUserMessage( "Find the open tickets and summarize them." );

/// Synchronous:
Agent::SRunResult R;
A.Run( R );

/// Or one step per tick, never blocking:
while( true )
{
    const Agent::EState e = A.Step();
    if( e == Agent::EState::eWaitingApproval ) { ... A.Approve( Id, Tools::EApproval::eApprove ); }
    if( e == Agent::EState::eDone || e == Agent::EState::eFailed || e == Agent::EState::eCancelled ) break;
    /// the rest of the tick
}

An agent is used by one thread at a time (Interrupt and RequestCancel may come from any thread). Many agents can share one client, one registry and one memory index.

struct

SMessageView

Ethereal::Ai::Agent#
C++
struct   SMessageView
{
    Llm::ERole                        eRole = Llm::ERole::eUser;
    bool                            bPinned = false;
    std::span< const Llm::SBlock >    Blocks;
};

One message of the history, as views (valid until the history changes).

class

CAgent

Ethereal::Ai::Agent#
class CAgent
constructor

CAgent

#
CAgent() noexcept = default;
function

Create

#
static EStatus Create( const SAgentConfig & Config, CAgent * pOut ) noexcept;

A new agent in eReady with an empty history.

eOk, eInvalidArgument (no backend and no client, no model name, a registry that is not final), eOutOfMemory, eNotLicensed.
function

AddUserMessage

#
EStatus AddUserMessage( std::string_view sText, bool bPinned = false ) noexcept;

A user message for the next turn. In eDone it opens a new turn (eReady).

eOk, eInvalidState (a model call, tools or approvals in progress, or a failed or cancelled run), eFiltered is reported by the state (the filter blocked it).
function

Run

#
EStatus Run( SRunResult & Out ) noexcept;

Runs until the run stops or waits for an approval (then Approve and Run again).

function

Step

#
EState Step( void ) noexcept;

Advances as far as possible without waiting, and returns the state.

function

Approve

#
EStatus Approve( std::string_view sCallId, Tools::EApproval eDecision, std::string_view sText = {} ) noexcept;

The decision on a pending call: eApprove, eDeny (sText is the reason the model sees) or eModify (sText is the JSON of the new arguments). When the last pending call is decided, the next Step runs the batch.

function

PendingCount

#
ETL_UINT32 PendingCount( void ) const noexcept;

The calls waiting for Approve.

function

Pending

#
SPendingCall Pending( ETL_UINT32 u ) const noexcept;
function

Cancel

#
EStatus Cancel( void ) noexcept;

Cancels now: the model call in flight is cancelled and the state is eCancelled.

function

RequestCancel

#
void RequestCancel( void ) noexcept;

Asks for a cancel from any thread: the next Step cancels.

function

Interrupt

#
EStatus Interrupt( std::string_view sText ) noexcept;

A user message from any thread, injected before the next model call.

function

State

#
EState State( void ) const noexcept;
function

StopReason

#
EStopReason StopReason( void ) const noexcept;
function

Used

#
const SUsed & Used( void ) const noexcept;
function

MessageCount

#
ETL_UINT32 MessageCount( void ) const noexcept;
function

Message

#
SMessageView Message( ETL_UINT32 u ) const noexcept;
function

LastText

#
std::string_view LastText( void ) const noexcept;
function

HistoryTokens

#
ETL_UINT64 HistoryTokens( void ) const noexcept;
function

Config

#
const SAgentConfig & Config( void ) const noexcept;
function

ReserveHistory

#
EStatus ReserveHistory( ETL_UINT32 uMessages, ETL_UINT32 uBlocks, std::size_t uTextBytes ) noexcept;

Room for the history up front (the messages, their blocks, the bytes of their texts): the steps then allocate nothing until it is used up.

function

SetScratch

#
EStatus SetScratch( std::string_view sKey, std::string_view sValue ) noexcept;

The scratchpad of the run (key and value, both copied).

function

GetScratch

#
bool GetScratch( std::string_view sKey, std::string & Out ) const noexcept;
function

SaveCheckpoint

#
EStatus SaveCheckpoint( std::string & Out, ECheckpointFormat eFormat = ECheckpointFormat::eBinary ) const noexcept;

The whole state of the agent (history, usage, scratchpad, stash, the machine) in the versioned binary format or in JSON. A model call in flight is not saved: the agent loaded from it calls again. A batch of tools in flight (bAsyncTools) is saved as calls: the agent loaded from it runs them again.

function

SaveCheckpoint

#
EStatus SaveCheckpoint( char * pOut, std::size_t uCapacity, std::size_t * pWritten, ECheckpointFormat eFormat = ECheckpointFormat::eBinary ) const noexcept;

The same into a buffer. With eBufferTooSmall, pWritten has the size needed.

function

LoadCheckpoint

#
static EStatus LoadCheckpoint( std::string_view sData, const SAgentConfig & Config, CAgent * pOut ) noexcept;

An agent from a checkpoint (either format), with Config (not saved in it).

eOk, eFormatError, eVersionMismatch, and the errors of Create.
function

AsTool

#
EStatus AsTool( std::string_view sName, std::string_view sDescription, Tools::CToolRegistry & Target ) noexcept;

Adds to Target (not final) a tool that runs a sub-agent with the configuration of this agent: the argument {"task": "..."} is its first user message, its final text is the result. The sub-agent has its own history (isolated) and its own budget, cut to what is left of the budget of the agent that calls the tool, and what it uses is charged to that agent. This agent is the template: it must outlive Target.

class

CLlmModel

Ethereal::Ai::Agent#

The backend over an Ai::Llm client (StartAsync): what an agent with pClient and no pModel uses. Exposed for the agents that share a backend setup.

class CLlmModel final : public IModel
constructor

CLlmModel

#
explicit CLlmModel( Llm::CClient & Client, bool bPump = false ) noexcept;
bPump
Poll runs the loop of the client (SClientConfig::bAsyncOwnThread false).
function

Begin

#
EStatus Begin( Llm::CRequest & Request ) noexcept override;
function

Poll

#
EPoll Poll( SModelReply & Out ) noexcept override;
function

Wait

#
void Wait( ETL_UINT32 uTimeoutMs ) noexcept override;
function

Cancel

#
void Cancel( void ) noexcept override;
class

CScriptedModel

Ethereal::Ai::Agent#

A backend that answers from a script: the replies pushed, in order. For the tests of an agent (the module's and the customers'). Hold makes the replies wait (Poll says ePending) until Release. With the script exhausted a call fails.

class CScriptedModel final : public IModel
constructor

CScriptedModel

#
CScriptedModel() noexcept;
function

Push

#
void Push( const SModelReply & Reply );

The next reply.

function

PushText

#
void PushText( std::string_view sText, Llm::EStopReason eStop = Llm::EStopReason::eEndTurn, ETL_UINT64 uIn = 10u, ETL_UINT64 uOut = 5u );

A text reply.

function

PushToolUses

#
void PushToolUses( std::span< const std::array< std::string_view, 3 > > Calls, std::string_view sText = {}, ETL_UINT64 uIn = 10u, ETL_UINT64 uOut = 5u );

A reply with tool uses: (id, name, input JSON) triples, with an optional text first.

function

PushError

#
void PushError( std::string_view sError );

A failed call.

function

Hold

#
void Hold( bool bHold ) noexcept;
function

HoldFrom

#
void HoldFrom( ETL_UINT32 uCall ) noexcept;

The calls from the uCall-th on (1 is the first) wait as with Hold. Zero: off.

function

Calls

#
ETL_UINT32 Calls( void ) const noexcept;
function

Left

#
ETL_UINT32 Left( void ) const noexcept;
alias

void

#
using PFN_OnRequest = void ( * )( void * pUser, const Llm::CRequest & Request );
function

OnRequest

#
void OnRequest( PFN_OnRequest pfn, void * pUser ) noexcept;
function

Begin

#
EStatus Begin( Llm::CRequest & Request ) noexcept override;
function

Poll

#
EPoll Poll( SModelReply & Out ) noexcept override;
function

Wait

#
void Wait( ETL_UINT32 uTimeoutMs ) noexcept override;
function

Cancel

#
void Cancel( void ) noexcept override;
function

Replay

Ethereal::Ai::Agent#
EStatus Replay( std::string_view sTracePath, const SAgentConfig & Config, SReplayReport & Report, bool bReplayTools = true ) noexcept;

Runs a recorded trace again: the model replies (and, with bReplayTools, the tool results) come from the trace, the agent is built from Config, and each request it sends, each tool call it makes and the way it stops are compared with the trace. Config.pModel and the trace settings are ignored.

eOk (Report says whether it is the same), eIoError, eFormatError.
function

ReplayText

Ethereal::Ai::Agent#
EStatus ReplayText( std::string_view sTraceJsonl, const SAgentConfig & Config, SReplayReport & Report, bool bReplayTools = true ) noexcept;

The same from the JSONL text of a trace.

agent_types.hpp

#include <ethereal/cpp/ai/agent/agent_types.hpp>

The types of Ai::Agent: status, states, stop reasons, budgets, the context policy, the memory, the trace, and the model backend interface the agent talks to.

enum

EStatus

Ethereal::Ai::Agent#
C++
enum class   EStatus : ETL_UINT8
{
    eOk = 0,
    eInvalidArgument,
    eOutOfMemory,
    eNotLicensed,
    eInvalidState,        /// The call does not fit the state of the agent (Approve with nothing pending).
    eNotFound,            /// A call id that is not pending.
    eFormatError,        /// A checkpoint or a trace that is not what it says.
    eVersionMismatch,    /// A checkpoint of a newer format.
    eModelError,        /// The model backend failed.
    eIoError,            /// A trace file that cannot be read or written.
    eBufferTooSmall,
    eUnsupported,
    eDivergence            /// Replay: the agent decided differently than in the trace.
};
function

StatusName

Ethereal::Ai::Agent#
const char * StatusName( EStatus eStatus ) noexcept;
enum

EState

Ethereal::Ai::Agent#
C++
enum class   EState : ETL_UINT8
{
    eReady = 0,            /// Prepares the next request (or idles, with nothing to say).
    eWaitingModel,        /// A model call is in flight.
    eProcessing,        /// The reply is being processed.
    eRunningTools,        /// A batch of tools runs (asynchronously, with bAsyncTools).
    eWaitingApproval,    /// Calls wait for Approve.
    eDone,                /// Stopped for a reason that allows a new user message.
    eFailed,            /// Stopped by an error or a budget.
    eCancelled
};

The states of the loop. eProcessing is only seen from inside a step (the hooks).

function

StateName

Ethereal::Ai::Agent#
const char * StateName( EState eState ) noexcept;
enum

EStopReason

Ethereal::Ai::Agent#
C++
enum class   EStopReason : ETL_UINT8
{
    eNone = 0,
    eEndTurn,            /// The model ended its turn (eDone).
    eMaxSteps,            /// uMaxSteps model calls (eDone).
    eInputTokens,        /// The input token budget (eFailed, as every budget).
    eOutputTokens,
    eCost,
    eWallTime,
    eToolCalls,
    eCancelled,            /// Cancel (eCancelled).
    eStopHook,            /// The stop hook said so (eDone).
    eTerminalTool,        /// A tool marked terminal ran (eDone).
    eModelError,        /// The backend failed (eFailed).
    eRefusal,            /// The model refused (eDone).
    eMaxTokens,            /// The reply hit the output limit of the call (eDone).
    eFiltered            /// The content filter blocked a text (eFailed).
};
function

StopReasonName

Ethereal::Ai::Agent#
const char * StopReasonName( EStopReason eReason ) noexcept;
struct

SToolCallLimit

Ethereal::Ai::Agent#
C++
struct   SToolCallLimit
{
    std::string_view    sTool;
    ETL_UINT32            uMaxCalls = 0u;
};

The most calls of one tool in a run. A call over it is not run: the model gets an error result and goes on.

struct

SBudget

Ethereal::Ai::Agent#
C++
struct   SBudget
{
    ETL_UINT64                            uMaxInputTokens = 0u;    /// Input, cache reads and writes included.
    ETL_UINT64                            uMaxOutputTokens = 0u;
    ETL_DOUBLE                            dMaxCost = 0.0;            /// In the currency of Prices.
    std::span< const Llm::SPrice >        Prices;                    /// The price table of dMaxCost (Llm::FindPrice).
    ETL_UINT64                            uMaxWallMs = 0u;
    ETL_UINT32                            uMaxToolCalls = 0u;        /// Every tool together.
    std::span< const SToolCallLimit >    PerTool;
};

The limits of a run. Zero is no limit.

Checked before each model call (with the estimate of the request) and after it (with the usage it reports). The output limit of each call is cut to what is left of uMaxOutputTokens, so the output is never exceeded. The input and the cost can be exceeded by at most the call in flight (the estimate is lower than the real count): then the run stops right after that call.

struct

SUsed

Ethereal::Ai::Agent#
C++
struct   SUsed
{
    ETL_UINT64        uInputTokens = 0u;
    ETL_UINT64        uOutputTokens = 0u;
    ETL_UINT64        uCacheReadTokens = 0u;
    ETL_UINT64        uCacheWriteTokens = 0u;
    ETL_DOUBLE        dCost = 0.0;
    ETL_UINT64        uWallMs = 0u;
    ETL_UINT32        uSteps = 0u;            /// Model calls of the loop (the summaries not counted).
    ETL_UINT32        uModelCalls = 0u;        /// Every model call (the summaries counted).
    ETL_UINT32        uToolCalls = 0u;        /// Calls that ran.

    ETL_UINT64 TotalInput( void ) const ETL_NOEXCEPT { return uInputTokens + uCacheReadTokens + uCacheWriteTokens; }
};

What a run used so far.

enum

EContextStrategy

Ethereal::Ai::Agent#
C++
enum class   EContextStrategy : ETL_UINT8
{
    eDropOldToolResults = 0,    /// The oldest tool results become a marker (the pair stays).
    eTruncateToolOutputs,        /// Large tool results keep their head, the rest goes to the stash (agent_fetch_output reads it).
    eSummarize                    /// The oldest messages become a summary written by the model.
};
struct

SContextPolicy

Ethereal::Ai::Agent#
C++
struct   SContextPolicy
{
    ETL_UINT64            uMaxContextTokens = 0u;        /// Zero: no management.
    float                fTrigger = 0.8f;
    float                fTarget = 0.6f;
    EContextStrategy    aOrder[ 3 ] = { EContextStrategy::eDropOldToolResults, EContextStrategy::eTruncateToolOutputs, EContextStrategy::eSummarize };
    ETL_UINT32            uStrategies = 3u;            /// How many of aOrder run.
    ETL_UINT32            uKeepRecentToolResults = 2u;
    ETL_UINT32            uTruncateAboveBytes = 4000u;
    ETL_UINT32            uTruncateKeepBytes = 1000u;
    std::string_view    sSummaryPrompt;                /// Empty: a default prompt.
    ETL_UINT32            uSummaryMaxTokens = 1024u;
    ETL_UINT32            uKeepRecentMessages = 4u;    /// The summary leaves these out.
};

What happens when the history nears the context of the model.

Before each call the history is counted. Above fTrigger x uMaxContextTokens the strategies run in the given order until it is below fTarget x uMaxContextTokens. The system prompt, the pinned messages and the last turn are never touched, a tool use and its result are never separated, and the reasoning blocks of the last assistant turn go back unchanged (the providers require it in a tool loop).

struct

SMemoryConfig

Ethereal::Ai::Agent#
C++
struct   SMemoryConfig
{
    Rag::CIndex *        pIndex = nullptr;
    ETL_UINT32            uAutoRecall = 0u;        /// Before each user turn, the top k memories go with it. Zero: off.
    bool                bTools = false;            /// memory_remember and memory_search for the model.
    ETL_UINT32            uRecallMaxBytes = 4000u;
};

The long term memory: an index of Ai::Rag (needs ETL_AI_RAG).

enum

EFilterPoint

Ethereal::Ai::Agent#
C++
enum class   EFilterPoint : ETL_UINT8 { eUserInput = 0, eModelOutput, eToolOutput, eRetrieved };
enum

EFilterVerdict

Ethereal::Ai::Agent#
C++
enum class   EFilterVerdict : ETL_UINT8 { ePass = 0, eReplace, eBlock };
alias

EFilterVerdict

Ethereal::Ai::Agent#
using PFN_Filter = EFilterVerdict ( * )( void * pUser, EFilterPoint ePoint, std::string_view sText, std::string & sReplacement );

The content filter: sees each text at ePoint, may replace it (sReplacement) or block the run (eFiltered).

alias

bool

Ethereal::Ai::Agent#
using PFN_StopHook = bool ( * )( void * pUser, const CAgent & Agent );

Called after each step: true stops the run (eStopHook).

alias

ETL_UINT64

Ethereal::Ai::Agent#
using PFN_NowNs = ETL_UINT64 ( * )( void * pUser );

The clock of the agent (the wall time budget, the trace). Null: the monotonic clock.

enum

ETraceKind

Ethereal::Ai::Agent#
C++
enum class   ETraceKind : ETL_UINT8
{
    eUserMessage = 0,    /// {"text":..}
    eModelRequest,        /// {"messages":n,"tokens":estimate,"fingerprint":sha256 hex}
    eModelReply,        /// {"stop":..,"usage":{..},"blocks":[..]}
    eToolCall,            /// {"id":..,"name":..,"input":..}
    eToolResult,        /// {"id":..,"text":..,"is_error":..}
    eApproval,            /// {"id":..,"decision":..,"reason":..}
    eContext,            /// {"strategy":..,"before":..,"after":..}
    eStop,                /// {"state":..,"reason":..}
    eError                /// {"message":..}
};
function

TraceKindName

Ethereal::Ai::Agent#
const char * TraceKindName( ETraceKind eKind ) noexcept;
struct

STraceEvent

Ethereal::Ai::Agent#
C++
struct   STraceEvent
{
    ETraceKind            eKind = ETraceKind::eUserMessage;
    ETL_UINT32            uStep = 0u;
    ETL_UINT64            uTimeNs = 0u;
    std::string_view    sJson;
};

One event of the trace. sJson is one JSON object (valid during the call).

alias

void

Ethereal::Ai::Agent#
using PFN_OnTrace = void ( * )( void * pUser, const STraceEvent & Event );
struct

SReplyBlock

Ethereal::Ai::Agent#
C++
struct   SReplyBlock
{
    Llm::EBlock        eType = Llm::EBlock::eText;
    std::string        sText;            /// eText, eThinking.
    std::string        sId;            /// eToolUse.
    std::string        sName;            /// eToolUse.
    std::string        sInput;            /// eToolUse: a JSON object.
    std::string        sSignature;        /// eThinking.
    std::string        sData;            /// eRedactedThinking.
};

One block of a reply, owned.

struct

SModelReply

Ethereal::Ai::Agent#
C++
struct   SModelReply
{
    std::vector< SReplyBlock >    Blocks;
    std::size_t                    uBlocks = 0u;
    Llm::EStopReason            eStop = Llm::EStopReason::eNone;
    Llm::SUsage                    Usage;
    bool                        bFailed = false;
    std::string                    sError;

    void Clear( void ) ETL_NOEXCEPT
    {
        uBlocks = 0u;
        eStop = Llm::EStopReason::eNone;
        Usage = Llm::SUsage();
        bFailed = false;
        sError.clear();
    }

    /// @brief  The next block (cleared). Grows Blocks only past its size.
    SReplyBlock & Add( const Llm::EBlock eType )
    {
        if( uBlocks == Blocks.size() )
            Blocks.emplace_back();

        SReplyBlock & B = Blocks[ uBlocks++ ];
        B.eType = eType;
        B.sText.clear();
        B.sId.clear();
        B.sName.clear();
        B.sInput.clear();
        B.sSignature.clear();
        B.sData.clear();
        return B;
    }
};

What a model call gave. The blocks are the first uBlocks of Blocks: the vector never shrinks, so a reply reused across steps does not allocate once warm.

enum

EPoll

Ethereal::Ai::Agent#
C++
enum class   EPoll : ETL_UINT8 { ePending = 0, eReady, eFailed };
class

IModel

Ethereal::Ai::Agent#

Where the replies come from. The agent calls it from one thread at a time.

class IModel

Begin starts a call and returns at once. Poll hands the reply when it is there (eReady, or eFailed with SModelReply::sError) and never blocks. Wait blocks up to uTimeoutMs for the reply to be there (Run uses it, Step never). The request stays alive and untouched until the reply is handed (or Cancel).

function

Begin

#
virtual EStatus Begin( Llm::CRequest & Request ) noexcept = 0;
function

Poll

#
virtual EPoll Poll( SModelReply & Out ) noexcept = 0;
function

Wait

#
virtual void Wait( ETL_UINT32 uTimeoutMs ) noexcept;
function

Cancel

#
virtual void Cancel( void ) noexcept = 0;
destructor

~IModel

#
virtual ~IModel() = default;
struct

SAgentConfig

Ethereal::Ai::Agent#
C++
struct   SAgentConfig
{
    /// @brief  The backend. Null: an internal backend over pClient (StartAsync).
    IModel *                            pModel = nullptr;
    Llm::CClient *                        pClient = nullptr;
    Llm::EProvider                        eProvider = Llm::EProvider::eAnthropic;    /// The dialect of the tools and the rules of the context.
    bool                                bPumpClient = false;    /// pClient runs its loop in Poll (SClientConfig::bAsyncOwnThread false).

    std::string_view                    sModel;
    std::string_view                    sSystem;
    ETL_UINT32                            uMaxTokens = 4096u;        /// Per call.
    ETL_UINT32                            uMaxSteps = 50u;

    /// @brief  The tools (a final registry), and how they run.
    const Tools::CToolRegistry *        pTools = nullptr;
    Tools::EApprovalScope                eApprovalScope = Tools::EApprovalScope::eDestructive;
    Job::IParallelFor *                    pToolParallel = nullptr;    /// The calls of a turn in parallel.
    bool                                bAsyncTools = false;        /// The batch runs on a thread of the agent: Step never waits for a tool.
    ETL_INT32                            iToolTimeoutMs = 0;
    std::span< const std::string_view >    TerminalTools;                /// A successful call of one of these stops the run.

    SBudget                                Budget;
    SContextPolicy                        Context;
    SMemoryConfig                        Memory;
    bool                                bScratchTools = false;        /// scratch_set and scratch_get for the model.

    /// @brief  The token counter of the history (CountWithTokenizer of AI-01). Null: bytes / 4.
    Llm::PFN_CountText                    pfnCount = nullptr;
    void *                                pCountUser = nullptr;

    /// @brief  Untrusted content (tool results, retrieved documents): delimited and cut here.
    ETL_UINT32                            uMaxUntrustedBytes = 50000u;

    PFN_Filter                            pfnFilter = nullptr;
    void *                                pFilterUser = nullptr;
    PFN_StopHook                        pfnStop = nullptr;
    void *                                pStopUser = nullptr;
    PFN_NowNs                            pfnNow = nullptr;
    void *                                pNowUser = nullptr;

    /// @brief  The trace: a callback, a JSONL file (appended), the spans of a tracer (ETL_TELEMETRY).
    PFN_OnTrace                            pfnTrace = nullptr;
    void *                                pTraceUser = nullptr;
    std::string_view                    sTracePath;
    Telemetry::CTracer *                pTracer = nullptr;
};

What an agent is. The pointers must outlive the agent. Many agents may share the client, the registry and the memory index.

struct

SRunResult

Ethereal::Ai::Agent#
C++
struct   SRunResult
{
    EState                eState = EState::eReady;
    EStopReason            eStop = EStopReason::eNone;
    SUsed                Used;
    std::string_view    sFinalText;        /// The text of the last assistant message (valid until the next call).
};

The end of Run.

struct

SPendingCall

Ethereal::Ai::Agent#
C++
struct   SPendingCall
{
    std::string_view    sId;
    std::string_view    sName;
    std::string_view    sArgs;
};

A call waiting for Approve.

struct

SReplayReport

Ethereal::Ai::Agent#
C++
struct   SReplayReport
{
    bool                bSame = false;
    ETL_UINT32            uSteps = 0u;            /// Model calls replayed.
    ETL_UINT32            uDivergedAtStep = 0u;    /// The first step that differs (valid when !bSame).
    std::string            sWhy;
    EStopReason            eStop = EStopReason::eNone;
};

The result of Replay.

enum

ECheckpointFormat

Ethereal::Ai::Agent#
C++
enum class   ECheckpointFormat : ETL_UINT8 { eBinary = 0, eJson };