OmniCoreAgent
Constructor
agent_config takes the agent settings, and
telemetry_config the telemetry settings.
Methods
abandon_run
status (cancelled, failed or timeout) and why, and the request’s own budget counters are released, keeping what it spent on the record. A run that already ended is left as it is. Found on the steward’s server: such runs stayed “running” or “awaiting_budget” for good, each with its counter still in the ledger.
budget_status
claim_orphaned_runs
running whose heartbeat is older than its lease, started by this agent (by name) and not by a background supervisor, which recovers its own. A decided run is one waiting for an approval or a budget decision that a person has made, and that nobody has resumed for decided_grace_seconds (the client that should have called resume was refused or is gone). A run with a decision still pending is left waiting.
Each run is claimed with the record’s own version check: the claim writes a new owner and a fresh heartbeat, and a second process that read the same record fails the check and skips it, so a run is never resumed twice. A client’s resume that read the record before the claim fails its first save the same way and is refused. Each claim is then given to resume_claimed. An orphan claimed max_recoveries times and still not finished is ended failed instead (it is probably what kills its process); a decided run’s claim does not count.
Orphans were added after the support desk chaos run (2026-10-07), where runs whose process died stayed running until someone called resume. Decided runs were added after the ramp at 100 users the same day, where 119 approved runs waited for a resume that the admission limit had answered 503.
cleanup
cleanup_mcp_servers
clear_session_history
connect_mcp_servers
deny_budget
resume(run_id) ends it cleanly.
export_trace
generate_run_id
generate_session_id
get_latest_trace
get_memory_store_type
get_metrics
get_run
get_run_trajectory
telemetry_config["retention_days"], run records after run_retention_days) has trace_kept: False; traces_missing counts them, and totals cover only the traces still kept, so they are empty rather than zero when none is. The record’s usage remains.
get_session_history
get_telemetry_events_after
cursor, as a list, in the order they were recorded, filtered like stream_telemetry_after; it returns at once instead of waiting for more.
cursor=None returns every stored event in scope. Poll with the last event’s stream_cursor to get only what is new.
get_telemetry_stream_cursor
stream_telemetry_after or get_telemetry_events_after to get only events recorded from here on.
Take it before starting a run to follow that run from its first event. Cursors are opaque strings that increase with every event.
get_telemetry_trace
None if it is not stored (never recorded, or pruned after telemetry_config["retention_days"]).
normalize=True sorts spans by start and events by sequence, and marks capture gaps and missing references. For a readable story use get_trajectory (one segment) or get_run_trajectory (a whole run, across pauses and resumes).
get_trace
get_trace_family
run_id seed, every trace carrying that run id is included before linked ancestors and descendants are added. This avoids treating the latest trace for a session as the complete execution history.
get_trajectory
get_run_trajectory(run_id) gives the whole run. Look up by trace_id (exact) or run_id (the latest segment of that run; the others are listed in other_trace_ids_for_run). Delegated child runs are nested under the tool call that started them. See build_trajectory for the shape.
grant_budget
amount defaults to what the run said it was short of. resume(run_id) then continues the work.
initialize
interrupt
interrupted and resume continues it.
list_all_available_tools
delegate_<name> tool for each of sub_agents.
list_runs
list_telemetry_traces
TraceFilter, not both. A run that paused and resumed has one trace per segment; run_id= lists them all. normalize is as in get_telemetry_trace.
prune_runs
run_retention_days now (30 by default; None keeps every record). A run still waiting for a person or a resume is never removed. Returns what was removed.
prune_telemetry
prune_telemetry_payloads
read_telemetry_payload
record_outcome
source says who is reporting it (github, reviewer, an evaluator’s name), reward is the number a trainer or an evaluator uses, label is what it is called, and detail is anything else worth keeping. A run may gather several. The outcome goes on the run’s record and into its trace.
release_claim
resolve_approval
decision is "approve" or "deny". A denial’s note reaches the model. arguments approves an edited call instead of the one asked for. The decision applies once, to that exact request.
resume
resolve_approval), or one whose process stopped (its heartbeat is older than run_lease_seconds). Completed tool calls never run again.
trigger says who resumed it, for the run’s trace and the omniserve_runs_resumed_total metric: a person or client (explicit), or the background supervisor retrying (background_retry).
resume_claimed
claim_orphaned_runs returned, with the same durable rules as resume: completed calls never run again, and a call that did not finish becomes unknown_outcome unless its tool is idempotent.
run
steer
stream
contextlib.aclosing when stopping iteration early. Deltas are not replayed from telemetry; the completed answer is persisted normally.
stream_telemetry_after
cursor, then keep yielding new ones as they are recorded; it does not end on its own.
Events come in the order they were recorded, each once, filtered to the trace, run, session or task and the event_types given. cursor=None starts from the first stored event. Each event carries its stream_cursor: keep the last one to resume after a disconnect. A reader that falls 1,000 events behind is stopped with an error rather than silently skipping events.
switch_memory_store
telemetry_retention_status
runs).