Skip to content

Add queryable run record as the source of truth #3

Description

@perixtar

Context

Launch feedback pointed out that logs are observable, but they are not enough for product workflows. The runtime needs a queryable run record that both the product and the agent can inspect.

Problem

Today AgentRouter exposes events, sessions, artifacts, and logs, but the product direction should make the run record the central state primitive. Developers should be able to ask what happened, what is available, what was approved or denied, and why the run is in its current state.

Proposed direction

Add a structured run record that aggregates durable run state across events, artifacts, runtime decisions, tool/action availability, approval outcomes, and terminal status.

The record should be useful for two audiences:

  • Product/API callers that need to render state, audit runs, and resume workflows.
  • Agents/runtime logic that need to reason about current state without rediscovering it from logs.

Acceptance criteria

  • Define a run record schema exposed by the API and SDK.
  • Include run status, current phase, runtime kind, attempts, artifacts, latest patch metadata, and event cursor.
  • Include action/tool availability and policy state when available.
  • Include approval and denial summaries once approvals are implemented.
  • Add tests covering record creation, updates, and SDK retrieval.

Notes

This should become the primitive that logs, artifacts, approvals, and future dashboard views hang off of.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions