AgentLifecycle
Reactive timestamps for LangGraph streaming, interrupt, thread, and tool-call milestones, reset when the agent switches threads.
import type { AgentLifecycle } from '@threadplane/langgraph';Declaration
export interface AgentLifecycle {
readonly interruptReceivedAt: Signal<number | null>;
readonly interruptResolvedAt: Signal<number | null>;
readonly streamErrorAt: Signal<{
at: number;
kind: AgentErrorKind | string;
} | null>;
readonly streamStartedAt: Signal<number | null>;
readonly threadCreatedAt: Signal<number | null>;
readonly threadPersistedAt: Signal<number | null>;
readonly toolCallCompletedAt: Signal<number | null>;
readonly toolCallStartedAt: Signal<number | null>;
}Members
interruptReceivedAt
Epoch ms of the first interrupt$ non-null in this stream. Resets on switchThread().
readonly interruptReceivedAt: Signal<number | null>;interruptResolvedAt
Epoch ms of the most recent submit({ resume }) call. Resets on switchThread().
readonly interruptResolvedAt: Signal<number | null>;streamErrorAt
Epoch ms + failure class of the most recent stream error. Resets on switchThread().
kind is the AgentErrorKind of the normalized AgentError
(connection | auth | server | interrupted | aborted) — the same
value agent.error()?.kind carries. For a failure the runtime could not
normalize it falls back to the error's constructor name.
readonly streamErrorAt: Signal<{
at: number;
kind: AgentErrorKind | string;
} | null>;streamStartedAt
Epoch ms of the first stream chunk arrival. Resets on switchThread().
readonly streamStartedAt: Signal<number | null>;threadCreatedAt
Epoch ms when the agent's "create new thread" branch fired. Resets on switchThread().
readonly threadCreatedAt: Signal<number | null>;threadPersistedAt
Epoch ms when an existing thread was restored from server (proves persistence). Resets on switchThread().
readonly threadPersistedAt: Signal<number | null>;toolCallCompletedAt
Epoch ms of the first tool call result transition. Resets on switchThread().
readonly toolCallCompletedAt: Signal<number | null>;toolCallStartedAt
Epoch ms of the first tool call append. Resets on switchThread().
readonly toolCallStartedAt: Signal<number | null>;