CoAgent8 - Source API
    Preparing search index...

    Interface TaskOptions

    Per-call options of executeTask set by the server and tool handlers, never by tool arguments.

    interface TaskOptions {
        askConsent?: ConsentPrompt;
        budget?: ExecutionBudget;
        clock?: MonotonicClock;
        context?: BackendReadContext;
        createHistoryWriter?: (
            handle: string,
            workspace: string,
            provider: "codex" | "claude" | "agy",
            turnId: string,
        ) => {
            accept: (event: AdapterEvent) => void;
            disabled: boolean;
            flush: () => Promise<void>;
        };
        onTiming?: TimingObserver;
        releaseSessionTurn?: (
            handle: string,
            token?: string | undefined,
        ) => Promise<SessionResult<void>>;
        requireEnvelope?: boolean;
        reviewContext?: ReviewGateContext;
        reviewIdentity?: { scope: string; snapshot: string };
        simulateRegistrationFault?: () => void;
        tracker?: PhaseTracker;
        updateSession?: (
            handle: string,
            updates?: Partial<SessionRecord>,
            token?: string | undefined,
        ) => Promise<SessionRecord | null>;
        verifyReviewSnapshot?: () => Promise<string | undefined>;
        warnings?: string[];
    }
    Index
    askConsent?: ConsentPrompt

    Absent when the client cannot ask the user; a model that needs approval is then refused.

    Optional execution budget contract tracking call deadlines.

    Optional custom monotonic clock for timing.

    Optional context for observation and read operations.

    createHistoryWriter?: (
        handle: string,
        workspace: string,
        provider: "codex" | "claude" | "agy",
        turnId: string,
    ) => {
        accept: (event: AdapterEvent) => void;
        disabled: boolean;
        flush: () => Promise<void>;
    }

    Optional factory override to inject history writer errors or custom writers during tests.

    onTiming?: TimingObserver

    Optional observer callback receiving the timing trace, including on early errors.

    releaseSessionTurn?: (
        handle: string,
        token?: string | undefined,
    ) => Promise<SessionResult<void>>

    Optional hook to simulate lease release failure during finalization.

    requireEnvelope?: boolean

    Gate review results on the State Envelope.

    reviewContext?: ReviewGateContext

    Input binding supplied by the review handler.

    reviewIdentity?: { scope: string; snapshot: string }

    Collected review snapshot and scope. With the resolved backend and model they identify the request: an equal completed review in this workspace answers without a model turn (AX-007c).

    simulateRegistrationFault?: () => void

    Optional hook to simulate failure immediately during turn registration.

    tracker?: PhaseTracker

    Optional existing phase tracker to compose spans into a single trace.

    updateSession?: (
        handle: string,
        updates?: Partial<SessionRecord>,
        token?: string | undefined,
    ) => Promise<SessionRecord | null>

    Optional hook to simulate metadata update failure during finalization.

    verifyReviewSnapshot?: () => Promise<string | undefined>

    Rechecks the workspace after the turn; a change or failed read blocks readiness.

    warnings?: string[]

    Notices added to the result, such as a deprecated tool name.