@runloop/remote-agents-sdk
    Preparing search index...

    Interface CodexAxonConnectionOptions

    Options for a native Codex connection.

    interface CodexAxonConnectionOptions {
        afterSequence?: number;
        approvalHandlers?: Partial<
            Record<
                | "item/commandExecution/requestApproval"
                | "item/fileChange/requestApproval"
                | "item/tool/requestUserInput"
                | "item/permissions/requestApproval"
                | "applyPatchApproval"
                | "execCommandApproval",
                ApprovalHandler,
            >,
        >;
        initializeParams?: Partial<InitializeParams>;
        onDisconnect?: () => void | Promise<void>;
        onError?: (error: unknown) => void;
        replay?: boolean;
        requestTimeoutMs?: number;
        source?: string;
        threadStartParams?: ThreadStartParams;
        verbose?: boolean;
    }

    Hierarchy (View Summary)

    Index

    Properties

    afterSequence?: number

    Axon sequence number to resume from. When set, the initial SSE subscription uses { after_sequence } so only events after this sequence are delivered — earlier events are skipped.

    Omit (or pass undefined) to replay the full event history from the beginning of the Axon channel.

    Typical usage: persist AxonEventView.sequence from a previous session and pass it here to avoid re-processing events you have already seen.

    Mutually exclusive with replay.

    approvalHandlers?: Partial<
        Record<
            | "item/commandExecution/requestApproval"
            | "item/fileChange/requestApproval"
            | "item/tool/requestUserInput"
            | "item/permissions/requestApproval"
            | "applyPatchApproval"
            | "execCommandApproval",
            ApprovalHandler,
        >,
    >
    initializeParams?: Partial<InitializeParams>

    Overrides merged into the initialize request sent by initialize(). Defaults identify this SDK as the client with no extra capabilities.

    onDisconnect?: () => void | Promise<void>

    Async teardown callback invoked by disconnect() (e.g. devbox shutdown).

    onError?: (error: unknown) => void

    Called when a non-critical error occurs (e.g. unparseable event, listener exception). Defaults to console.error.

    replay?: boolean

    When true, the connection queries the axon for the current head sequence and replays all events up to that point without invoking handlers. Unresolved permission/control requests are dispatched to handlers after replay completes. Timeline events are emitted for all replayed events regardless.

    Set to false to replay the full history with handlers firing for every event (legacy behavior).

    Mutually exclusive with afterSequence.

    true

    requestTimeoutMs?: number
    source?: string

    The source string attached to every event this client publishes to the Axon API. Use it to identify which client produced a user prompt (e.g. distinguishing multiple integrations writing to the same channel).

    Defaults to the built-in client identifier ("claude-sdk-client" or "acp-sdk-client" depending on the connection type).

    threadStartParams?: ThreadStartParams
    verbose?: boolean

    When true, emit timestamped diagnostic logs to stderr for every transport read/write and lifecycle event. Useful during development; too noisy for production.

    false