Skip to main content

orcareplay-openai-agents

Records the OpenAI Agents SDK's own run structure — which agent, which handoff, which guardrail — into an OrcaReplay trace.

pip install orcareplay-openai-agents
orca record generic-openai -- python your_agent.py

That is the whole setup. There is nothing to add to your agent.

What it adds, and what it does not

orca records model traffic at a proxy, and every claim it makes about capture comes from there. This package is not needed for that: a run recorded without it is complete in the sense the rest of the project means. What it adds is the part a proxy structurally cannot see.

Measured on a two-agent run with a handoff and a guardrail — the same script recorded twice:

the trace can answer without with
which agent a turn belonged to no yes
that a handoff happened, and from whom no yes
that a guardrail ran no yes

The middle row is the sharp one. The SDK implements a handoff as a function tool named transfer_to_<agent>, so the proxy records an ordinary tool call and an ordinary next request. A rule could guess a handoff from that name — but a user tool may be called the same thing, and the agent it came from never reaches the wire at all. So a handoff is recorded rather than inferred: orca show and orca events name both ends, which nothing reading the wire could have told you.

Guardrails are the plainest case: one that passes need make no request whatsoever, so it leaves nothing on the wire to reconstruct from.

The model exchanges are deliberately left alone. ResponseSpanData and GenerationSpanData are dropped, because the proxy already holds those byte for byte and a second, lossier copy in the same trace would be worse than none.

How it attaches without editing your agent

orca record writes a sitecustomize.py into the run directory and puts that directory on PYTHONPATH. Python imports sitecustomize at startup from anywhere on sys.path, so the layer attaches to a process nobody modified — the same trick, and the same reason, as the Node adapter's NODE_OPTIONS preload.

It is inert unless ORCA_AGENT_SPANS is set, which only orca record does. On a machine that merely has this package installed, nothing happens.

If you would rather be explicit:

from orcareplay_openai_agents import install

install()

The SDK's own exporter

Installed through sitecustomize, this runs before your first statement — at which point the only registered processor is the SDK's own exporter, which ships traces to OpenAI. It replaces that, because a second egress out of a run being recorded is rarely what anyone wants, and on a machine without a real tracing key it also fills the output with Tracing client error 401.

Anything you register afterwards is added on top and keeps working. To keep the SDK's exporter as well:

ORCA_AGENT_SPANS_KEEP_EXPORT=1 orca record generic-openai -- python your_agent.py

Turning it off

orca record generic-openai --no-agent-spans -- python your_agent.py

What ends up in the trace

Three event types, added to the trace format in schema 0.2.0:

$ orca events --json last | jq -r '.[] | select(.type|startswith("agent.")) | "\(.type) \(.attrs)"'
agent.guardrail {"name":"not_empty","triggered":false}
agent.start     {"name":"Triage","handoffs":"Billing Specialist","tools":0}
agent.handoff   {"from":"Triage","to":"Billing Specialist"}
agent.start     {"name":"Billing Specialist","handoffs":"","tools":0}

They are written with actor: "harness" rather than actor: "orca", because orca did not observe them — it was told.

Failure posture

Nothing in this package may fail a run it is only watching. Every write, every import and every value it renders is guarded, including the repr fallback for objects it cannot describe: a span payload is whatever the agent put in it, and an object whose __repr__ raises would otherwise take the run down from inside a debugging aid. A value that cannot be described becomes <unrepresentable> and the run continues.

Apache-2.0. Part of OrcaReplay.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

orcareplay_openai_agents-0.1.0.tar.gz (13.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

orcareplay_openai_agents-0.1.0-py3-none-any.whl (9.8 kB view details)

Uploaded Python 3

File details

Details for the file orcareplay_openai_agents-0.1.0.tar.gz.

File metadata

  • Download URL: orcareplay_openai_agents-0.1.0.tar.gz
  • Upload date:
  • Size: 13.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for orcareplay_openai_agents-0.1.0.tar.gz
Algorithm Hash digest
SHA256 f44c92e55d1e5f7c6148bfd556eca0be63488c0e55ebc8d52dd651d6b553577e
MD5 7f7fd1419f8853d1d36a36c35ab2a4b8
BLAKE2b-256 faa65f7d911b564981791bc70e6fd894c428b1289b7484e052fdc20b8e03f22d

See more details on using hashes here.

Provenance

The following attestation bundles were made for orcareplay_openai_agents-0.1.0.tar.gz:

Publisher: release-openai-agents.yml on Continuum-AI-Corp/OrcaReplay

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file orcareplay_openai_agents-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for orcareplay_openai_agents-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 e535968ba6ec441215f3dc710dc79c4f2773bd7ee86675b8d51d271882d5d3f7
MD5 2cbefe42465bc0de5e67737a1c555419
BLAKE2b-256 3870cc3bedf2242a941b1a01df71ce99f2c0dc8908d33325ef6b1fc78fe2882f

See more details on using hashes here.

Provenance

The following attestation bundles were made for orcareplay_openai_agents-0.1.0-py3-none-any.whl:

Publisher: release-openai-agents.yml on Continuum-AI-Corp/OrcaReplay

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page