Agent Events

techrevati.runtime.agent_events

Agent Events — Typed lifecycle events with a failure taxonomy.

Provides a structured event schema for agent execution. Events are JSON-serializable and include both an 'event' (full path) and 'type' (short tail) field so they can be routed by either consumers.

AgentEventName

Bases: str, Enum

Typed event names for agent and phase lifecycle.

AgentEventStatus

Bases: str, Enum

Current status at time of event emission.

AgentFailureClass

Bases: str, Enum

Failure taxonomy for structured error classification.

AgentEvent dataclass

AgentEvent(
    event,
    status,
    emitted_at=_now_iso(),
    role=None,
    phase=None,
    project_id=None,
    failure_class=None,
    detail=None,
    data=None,
)

A typed lifecycle event for agent orchestration.

oversight_review_requested classmethod

oversight_review_requested(
    role, phase, *, decision_id, reviewer_id=None
)

Article 14 — a turn paused awaiting a human review decision.

oversight_review_resolved classmethod

oversight_review_resolved(
    role, phase, *, decision_id, decision, reviewer_id=None
)

Article 14 — a human reviewer resolved (or the timeout decided) a pause.

to_dict

to_dict()

JSON-serializable dict. Includes 'type' for backward compat.

to_json

to_json()

JSON string representation.

from_dict classmethod

from_dict(data)

Reconstruct AgentEvent from dict. Handles enum conversions.

from_json classmethod

from_json(s)

Reconstruct AgentEvent from JSON string.

to_otel_attributes

to_otel_attributes()

Convert to semantic-convention-style telemetry attributes.