Skip to Content

How do I see which agent version handled a request in an agent built with the OpenAI Agents SDK?

Rius shows the agent version on every trace once you set RIUS_MAIN_AGENT_VERSION, and the OpenAI Agents SDK integration does not set it for you. The integration records each model call with tokens and cost. You read the version in the Version column of the trace list and in the header of each trace. You can also filter the list by it, so you can see which version handled a given request.

How it works

  • What the integration records on its own. The framework drives the OpenAI client underneath, so Rius captures every model call as a generation with model, tokens, cost and time to first token. The OpenAI Agents SDK integration does not record a version, because the framework has no version to report.
  • What you add. The version comes from the setting RIUS_MAIN_AGENT_VERSION, which Rius stores as the attribute rius.main_agent.version on the agent’s resource. The SDK reads it when init() runs, so it is set once for the process and labels every trace that process sends.
  • What it does not do. A handoff produces no span of its own, and model-call spans are all named Response. The version is therefore about the process that handled the request, not about which agent inside the run spoke. If you need agent boundaries in the trace, wrap each agent entry in observe, as the integration page describes.
  • Where it shows. The trace list has a Version column that appears when traces carry a version. If a trace has no agent version, the column shows the build instead. The trace header shows the agent version too, next to the session and the end user. The Agents page uses the same version to compare two versions of an agent.

The integrations overview lists what each integration captures on its own.

Set it up

  1. Set the version before the process starts, in the environment of each deployment. Use any string that identifies the release, such as a release tag or a git tag.
export RIUS_MAIN_AGENT_VERSION=2026.10.2
  1. Initialize Rius as usual and wrap the entrypoint that calls the runner. This is the only code your agent needs. The installation, the openai integration and the tool wrappers are covered on the OpenAI Agents SDK page.
import rius from agents import Agent, Runner from rius import SpanKind rius.init(api_key="ri_...", service_name="my-agent") support_agent = Agent( name="support_agent", instructions="Answer support questions.", model="gpt-5-mini", ) @rius.observe(name="handle-ticket", kind=SpanKind.AGENT) def handle_ticket(ticket: str) -> str: result = Runner.run_sync(support_agent, ticket) return str(result.final_output) print(handle_ticket("Is the account for ana@example.com active?"))
  1. Change the value each time you ship a new release. Traces from the old release keep the old version, so both stay readable side by side.

  2. Send a request, then open Traces. Find the row for the request and read the Version cell. Click the trace and read the version in its header.

  3. To list every trace from one release, click Add filter, pick the version field, choose is and type the value. You can also open a span’s Raw tab, open the menu on the rius.main_agent.version attribute and choose Filter traces by this. Attribute filters match exact values, so type the version exactly as you set it. The exploring traces page covers the filters and the trace view in full.

For the wider picture of what to watch once traces arrive, see Monitor AI agents in production.

What you get

  • The version on every trace from the process, with no per-call code and no change to your tools or agents.
  • A Version column and a filter on the trace list, so you can pull up all traces from one release.
  • The version in each trace header, next to the end user and the session, so you see it while reading the waterfall.
  • The same version powering the comparison of two agent versions on the Agents page.
  • Model calls with tokens and cost from the integration, so you can see what a release costs per trace.

When something else fits

  • If you need to know which agent inside a run handed off or answered, the version is not the right tool. Add an observe wrapper per agent entry so each boundary becomes a span.
  • If one process serves several releases at once, one value per process cannot tell them apart. Run each release as its own process so each carries its own version.

Still stuck? Get help

Last updated on