OpenAI's Performance Factory: how do Codex agents track down ChatGPT slowdowns?

OpenAI described the Performance Factory, which opens a task on every alert, has Codex agents find the root cause and propose a fix, then verifies recovery. The four parts, adversarial review and lessons for your team.

Paylaş
OpenAI's Performance Factory: how do Codex agents track down ChatGPT slowdowns?

The next time ChatGPT slows down, the first one on the case may not be an engineer. In an engineering post published November 19, OpenAI described an internal system it calls the Performance Factory. When a performance alert fires, the system opens a task on its own; Codex agents dig for the root cause, record their findings and propose a fix for an engineer to approve. After the fix ships, another agent returns to the same task to check whether performance is back to baseline.

By OpenAI's count, the system's first workflow ran more than 1,700 investigations and found the root cause in over 600 cases in just over three months, about 17 automated investigations a day. The bigger value is the recipe: OpenAI walks through what it built to run agents safely in production and what mistakes taught it. Here it is, in a form you can adapt for your own team.

The problem: when agents write code, slowdowns arrive faster too

Software teams write code with agents far faster than before, and every change can introduce a small slowdown somewhere. OpenAI says traditional performance engineering could no longer keep pace. An engineer used to examine metrics and logs by hand, compare traces, debug live machines and read code. The team had built more than 30 performance tools over time, but knowing which one to reach for still took deep knowledge of each service.

Six steps from manual work to a factory

OpenAI describes the shift in six stages and suggests other teams will go through the same path.

First, Codex became a partner: an engineer asked "why did this get slower?" and investigated together with it. Then the team wrote its own method into a shared skill file called perf-forensics. It tells Codex which tools exist, when to use them and in what order to work through a slowdown: when did it start, which requests were affected, could a deployment or configuration change explain it. The skill was refined with tests built from past regressions, and now an alert can produce a diagnosis in a single run.

At some point engineers felt like a copy-paste relay between alerts and Codex. Investigations moved to the cloud, an alert started a Codex session automatically and findings landed in Slack. But the automation stopped there; a person still had to turn the diagnosis into a fix and check the result. The last step was the Performance Factory: an end-to-end system that tracks each task and assigns an agent when the next step is ready.

The factory's four parts

Task service. Engineers define workflows with a configuration file and instructions written in Markdown. The configuration lists the states a task can move through, the allowed transitions and which steps need an engineer. Each state gets its own instruction file; a code-change workflow, for example, has one for "implementing" and one for "reviewing".

Dispatch loop. It regularly checks which tasks are ready for their next step and starts a Codex turn with that step's instructions. The agent writes progress to the task and moves it forward when the step is done.

Codex in the cloud. Agents run in an environment inside OpenAI's network with the same tools engineers use: code repositories, metrics, logs, traces, CPU profiles and memory snapshots. They run under a service identity, so permissions can be scoped and every agent action is traceable. Not depending on engineers' laptops also makes parallel work possible.

Subscriptions. Some steps must wait for a person or a deployment. Rather than keep an agent running, the task subscribes to events like a GitHub review comment or a failed CI check, and becomes ready again when one arrives.

The first workflow: from alert to recovery

The first flow, the Regression Workflow, moves a slowdown through four stages: needs investigation, root caused, fix proposed, resolved. The agent first works out which metric got worse and when it began, since an alert fires at a threshold but the problem may have started hours earlier. It then compares groups of requests: did similar requests really get slower, or are more already-slow requests coming in? Those point to different causes. Then it checks deployments, feature flags and the relevant code.

The most instructive detail is adversarial review. Early on, agents sometimes stopped at the first plausible explanation and some diagnoses were wrong. OpenAI added a separate Codex session that tries to disprove the diagnosis, rechecking assumptions and testing counterfactuals: did similar requests not exposed to the change stay healthy, did the metric recover when the change was rolled back? In one example, an agent blamed failing conversations on image download errors and closed the case; the reviewer noticed that the internal file-locating service had already recovered while image requests were still failing, and reopened the investigation. In a manual check of 100 root-cause suggestions, OpenAI graded 70% as accurate and 30% as needing more work.

Writing the fix turned out harder than finding the cause. Agent proposals were sometimes more complicated than needed or introduced new issues, so fixes got their own adversarial review. Architectural calls, such as adding a cache that may serve stale data, still need an engineer who knows the service. The engineer reviews the pull request and decides whether to merge; any comment wakes an agent to address it. After the fix ships, the task closes if performance fully recovers, spawns a new task for any remaining slowdown, or goes back to investigation if nothing changed.

Lessons for your own team

OpenAI stresses three lessons. First, protect engineers' attention: raw agent output can be a wall of text, so each task produces a short report backed by metric charts, CPU flame graphs and traces, and related alerts are grouped and ranked by estimated impact.

Second, evaluate every change to the agent. Updating a skill or upgrading the model can improve some cases and hurt others. The team turns past production incidents into a test suite; each run starts fresh, with details that could give away the answer removed, and without access to saved notes or the incident writeup. Timing, size and affected requests are scored separately, because an agent can get the timing right and still blame the wrong deployment.

Third, monitor the agents themselves. A broken profiler or missing permission can quietly block an investigation. Every day an agent scans recent runs for tool failures and access errors, and when the same error blocks several investigations, the factory opens a task to fix itself.

The post does not share measurements of speed gains seen by users. As next steps, OpenAI says it is exploring proactive workflows that catch small slowdowns in profile and trace data before any alert fires, and shipping low-risk fixes without a human in the loop.

In an independent assessment, the most useful part of the post is how simple the pattern is: tasks with explicit states, a separate instruction file per step and a second agent whose job is to disprove the first are ideas a team far smaller than OpenAI can reuse.

Sources: OpenAI engineering blog: Performance Factory