AI-generated text

OpenAI uses Codex agents to investigate performance regressions

Tools · November 19, 2026

OpenAI uses Codex agents to investigate performance regressions

OpenAI has built a cloud-based system that uses Codex agents to investigate performance alerts, propose fixes and verify recovery after deployment.

In this article · 4

OpenAI has built a cloud-based agent system to automate the investigation of performance regressions in its services, including ChatGPT. Called the Performance Factory, it uses Codex to analyze alerts, propose fixes and check the results after deployment. Engineers still review the changes and decide whether to merge them.

Okay Zed and Cyrus Forbes, members of OpenAI’s technical staff, said the first workflow, called the Regression Workflow, tracked more than 1,700 investigations and identified the root cause in over 600 cases in just over three months. That amounted to an average of 17 automated investigations a day.

From manual debugging to workflows

Before using Codex, engineers investigated slowdowns by examining metrics and logs, comparing traces, debugging live machines and reading code. Recurring problems, including latency before ChatGPT’s first token, led the team to build more than 30 performance tools over time.

Codex later became a partner in navigating large codebases and interactions between services, but engineers still had to direct its investigations. The team therefore captured its methods in a shared skill called perf-forensics, which describes which tools to use and when. Testing against past regressions helped refine it until, for certain latency and availability problems, Codex could produce a diagnosis from an alert without step-by-step guidance.

The next stage let alerts automatically launch cloud-based Codex investigations that posted findings in Slack. Engineers still had to develop and verify fixes, however, and reviewing the accumulating threads became work in itself. The Performance Factory extends automation across the full process.

How the system works

The system has four main components: a task tracker with configurable workflows, a dispatch loop that assigns ready work, an internal API that runs Codex in the cloud, and event subscriptions that resume work when something changes.

Engineers use configuration files to define task states, permitted transitions and steps requiring human involvement. Separate instructions for agents are written in Markdown. Task state and findings persist outside any one agent’s context, allowing another agent or an engineer to continue the work. Workflows can be followed and shared through an interface.

Cloud-based agents can access company code repositories and the observability tools engineers use, including metrics, logs, traces, CPU profiles and memory snapshots. They operate under a service identity so their permissions can be scoped and their actions distinguished. When work must wait for a review or deployment, an agent does not need to keep running: an event such as a comment on a GitHub pull request or a completed deployment can make the task ready again.

Investigating and fixing regressions

The Regression Workflow creates a task when a configured performance alert fires. An agent first determines which metrics worsened, when the change began and which requests were affected. Because a threshold may be crossed hours after a problem starts, it looks back through the data. It also compares whether similar requests became slower or whether the service was simply handling more requests that were already slow.

The agent then examines deployments, feature flag changes and relevant code, using logs and traces to test possible causes. Early agents sometimes stopped at the first plausible explanation, so OpenAI added a separate Codex turn to challenge the diagnosis. It checks, for example, whether similar requests not exposed to a suspected change remained healthy, or whether a metric recovered after the change was rolled back.

In one case, an agent attributed failures in ChatGPT conversations to image download errors. A reviewer noticed that the internal service responsible for locating files had already recovered while image requests were still failing. The investigation was reopened. In a manual assessment of 100 root-cause suggestions, OpenAI found 70% accurate; 30% needed further refinement or did not fully establish causality.

Once a diagnosis passes review, Codex prepares a fix and opens a pull request. The engineer receives a summary of the impact, root cause and proposed change, with charts, CPU flame graphs and traces where useful. The engineer can edit the proposal, write a separate fix and decide whether to merge it. Comments can wake an agent to continue the work.

After deployment, an agent checks whether performance has returned to its previous baseline. If recovery is complete, it closes the task. If recovery is partial, it closes the original task and opens another for the remaining slowdown. If there is no improvement, it sends the issue back for investigation.

Limits, testing and future plans

OpenAI said producing the right fix has proved harder than finding the cause: agents sometimes suggest unnecessarily complex changes or introduce new problems. A separate agent therefore reviews proposed fixes as well. Some decisions still require engineering judgment: a cache, for example, might improve speed but introduce stale data.

The team compares agent proposals with the changes engineers ultimately merge and is working on synthetic performance tests so agents can measure and revise fixes before human review. The company is also exploring whether other agent-based review tools could eventually allow low-risk changes to be deployed without a human in the loop.

Another operational lesson is that the results of numerous investigations must be prioritized and made readable. The system now links related incidents, groups them by important metrics and ranks them by estimated impact.

Changes to investigation skills and models are tested against past production incidents, with diagnoses and the usefulness of summaries evaluated separately. The team takes care to prevent expiring telemetry or evidence generated after recovery from distorting historical tests. The agents themselves are also monitored daily: a separate agent searches for tool failures and access errors and, when needed, opens a repair task for an engineer to review.

Beyond responding to alerts, OpenAI plans more proactive searches. Agents might detect smaller regressions by comparing CPU and memory profiles, memory dumps and request traces across releases. Other workflows could regularly look for known optimization patterns, such as autoscaling settings that keep more service replicas running than necessary.

Certified Services Partner, Claude Partner Network