# OpenAI's CI playbook (for GitHub Actions)

> Source: <https://starsling.dev/blog/openai-ci>
> Published: 2026-10-22 00:00:00+00:00

**Recommendation:** Have your coding agent read your GitHub Actions run history, list CI optimizations in a table ranked by estimated minutes saved per day, then ship the top fixes as reviewable PRs.
More in the playbook "Working with AI coding agents": <https://wpnews.pro/playbooks/coding-agents>

# OpenAI's CI playbook (for GitHub Actions)

[Yonas Beshawred](https://starsling.dev/about), Co-founder & CEO, StarSling

Last week, OpenAI shared [how its Core Experimentation team uses Codex](https://developers.openai.com/blog/maintaining-software-with-the-gpt-6-family) to maintain its software, from removing unused code and stale feature flags to speeding up CI.

One example stood out: the team asked Codex to analyze their CI run history and rank potential optimizations by how many minutes each would save. They shipped roughly 30 CI optimization PRs based on those recommendations. **Median CI time dropped 55%, from roughly 10 minutes to 4.5 minutes (2.2x faster)**, while the 90th percentile improved from 12.5 minutes to 6 minutes (2.1x faster).

The [post, also shared by OpenAI Developers on X](https://x.com/OpenAIDevs/status/2111213093577691337), explains how the team identifies opportunities, gathers evidence, and prepares changes for review.

We took that approach further. We analyzed OpenAI's post alongside **855 CI workflow changes across 20 of its most popular repositories, 120 pull requests, and 33 additional blog posts and guides**. We then mapped the techniques to actionable GitHub Actions patterns in our [ci-speedup](https://github.com/starslingdev/skills#ci-speedup) skill, so your coding agent can apply them to your own repository.

The analysis uncovered seven new patterns, bringing ci-speedup to **over 80 CI optimizations**.

Below, we break down ten of OpenAI's CI optimization techniques, drawing on its blog post and public pull requests, and show how your agent can apply them.

**To try them yourself**, just send this post to your coding agent. It can work through the techniques and suggest installing ci-speedup to find even more opportunities, including optimizations inspired by [Anthropic's](https://starsling.dev/blog/anthropic-ci) and [Linear's](https://starsling.dev/blog/linear-ci) CI playbooks.

You can find ci-speedup on [GitHub](https://github.com/starslingdev/skills#ci-speedup) or [skills.sh](https://www.skills.sh/starslingdev/skills/ci-speedup).

StarSling is agent-native CI: [fast GitHub Actions runners](https://starsling.dev/products/runners) paired with AI agents that continuously find and ship optimizations like these, even while you sleep.

Trusted by AI-first teams like Mastra and Better Auth (Vercel). [Install StarSling for free](https://runners.starsling.dev/login) or explore our [docs](https://docs.starsling.dev/getting-started/quickstart).

Start here

Run OpenAI’s ten CI techniques on your repo

## Prompt for your agent: apply all ten

Source: [ci-speedup](https://starsling.dev/skills/ci-speedup)

The quoted passages below are from Rodrigo Roim’s article for OpenAI’s developer blog, and the tables link pull requests in OpenAI’s public GitHub repositories that apply these techniques. OpenAI is not affiliated with StarSling and did not review this post.

Reducing cost and runtime of continuous integration:

`What ideas do you have to relieve CI load in this repository? List your ideas in a table and rank all of them by estimated CI minutes saved per day based on this repo's CI run history`

This last idea helped us reduce CI time. After running it and following up on the suggestions, we landed about 30 CI optimization PRs. We saw median CI completion time fall from roughly 10 minutes to 4.5 minutes, while the 90th percentile fell from 12.5 minutes to 6 minutes.

The ranking is the technique that produced the headline numbers. It works on any repo with a CI history: every run on GitHub Actions records how long each job and step took, so an agent can price each fix in minutes per day before anyone writes a line of YAML. ci-speedup runs this ranking: it reads your last runs, checks them against its whole catalog, and orders what it finds by measured saving.

Rank by minutes saved

## Prompt for your agent

Each prompt below has your agent check your repo against the technique, using the ci-speedup catalog where a pattern covers it, and bring you the change to review.

Fixing flaky tests:

`/goal Look at all recent CI runs to find flaky tests. For each flaky test, try a fix and if successful put up a PR. Your job is to find clear fixes to simple issues, not to exhaustively fix every flaky test.`

| PR | Result | 
|---|---|
| [openai/codex#16825](https://github.com/openai/codex/pull/16825) | Windows CI flake fixed by asserting the policy instead of timing a subprocess | 

A flaky test costs its full run time on every failure, and again on the rerun. The run history already names the jobs that fail and then pass on the same commit, so an agent can start from the evidence and fix the simple causes first.

Flaky tests

## Prompt for your agent

In a later fix, adding a missing mock cut a 63-test resolver suite’s runtime from 592.6 seconds to 29.8 seconds

That is a 95% cut, with all 63 tests kept. A test that calls a real service waits on that service every run. OpenAI’s evals repo applies the same idea to model calls: its CI uses a [dummy model call](https://github.com/openai/evals/commit/feed6c75), so validation runs without waiting on an API. The tests stay, the assertions stay, and the wait goes.

Mock slow dependencies

## Prompt for your agent

| PR | Result | 
|---|---|
| [openai/codex#2633](https://github.com/openai/codex/pull/2633) | Core test suite: 8:49 to 21 seconds, timed on a developer machine | 
| [openai/openai-python#3830](https://github.com/openai/openai-python/pull/3830) | Test job back from 7m00s to 2m41s | 

Two repos, two languages, one cost: starting a process. In Codex, the core suite ran in 8:49 across many test binaries and in 21 seconds as one, timed on a developer machine on a second run with no file changes. In the Python SDK, a matrix of 1,760 policy cases had grown its test job from 2m24s to 7m00s; calling the checker in-process brought it back to 2m41s.

Fewer processes

## Prompt for your agent

| PR | Result | 
|---|---|
| [openai/openai-python#3573](https://github.com/openai/openai-python/pull/3573) | Two CI jobs: 10m42s to 2m12s and 8m37s to 1m53s | 

A package manager falls back to compiling from source when no prebuilt package matches the runner, and the install log is the only place it says so. The same pull request also restored the dependency cache and trimmed a duplicate suite, so the gain comes from all three together. Whisper’s CI takes the [same approach](https://github.com/openai/whisper/blob/main/.github/workflows/test.yml) to PyTorch, installing the CPU-only build for its CPU test matrix.

Prebuilt packages

## Prompt for your agent

| PR | Result | 
|---|---|
| [openai/codex#22408](https://github.com/openai/codex/pull/22408) | Windows tests: a 22m26s median down to about 7m29s | 
| [openai/codex#49103](https://github.com/openai/codex/pull/49103) | Shards balanced by estimated test duration | 

Sharding came first and balancing followed four and a half months later. A sharded job finishes when its slowest shard does, so once the work is split, the next minutes come from giving each shard the same amount of it.

Balanced shards

## Prompt for your agent

| PR | Result | 
|---|---|
| [openai/codex#23358](https://github.com/openai/codex/pull/23358) | Built once on x64, tested on native ARM64 shards | 

Sharding splits the tests, and each shard still compiles the same code before it runs its slice. One build job that hands its output to every shard pays for compilation once, and it can run on whichever machine compiles fastest.

Build once

## Prompt for your agent

| PR | Result | 
|---|---|
| [openai/codex#31352](https://github.com/openai/codex/pull/31352) | Slowest shard: 835.5s to 609.3s at 8 test jobs | 

Doubling the cap cut every shard’s time by 19 to 29%, and going to 12 was slower than 8. The fastest setting depends on the runner’s cores, memory and disk, so the way to find it is to run the same commit at a few settings and compare.

Measured concurrency

## Prompt for your agent

| PR | Result | 
|---|---|
| [openai/codex#11540](https://github.com/openai/codex/pull/11540) | Cache saves cost 66,295s against 1,515s of restores | 

A cache pays off when later runs find it. Release builds on new tags rarely did, so each cache save took about half a minute, adding about three minutes to a release run for a cache the next run would not use. The step timings in the run history show the save and restore cost side by side.

Drop a costly cache

## Prompt for your agent

| PR | Result | 
|---|---|
| [openai/codex#24952](https://github.com/openai/codex/pull/24952) | Windows Bazel jobs, often the long pole, moved to a dedicated runner group | 

OpenAI moved its Windows Bazel jobs, frequently the long pole for pull requests, onto a dedicated runner group. The same move works on any repo: find the long pole, then benchmark it on a faster machine beside its current one and compare the medians.

Faster runners

## Prompt for your agent

**Disclosure:** We make [StarSling Runners](https://starsling.dev/products/runners), one of the two options OPT81 can suggest benchmarking (the other is a larger GitHub-hosted runner). If you want faster runners without changing anything else, try them on the job this prompt names.

So far, my team has merged more than 1,400 maintenance pull requests that started from GPT-6 proposals. This resulted in faster test execution, smaller images, lower CPU utilization, and many other benefits. However, some proposals added more complexity than their expected benefit justified, so prioritization and measurement remained an important part of our workflow.

Most pull requests in the tables above carry their own measurement: a before and after, a median, a step count. Each prompt in this post asks for the same, so a change lands with the numbers that justify it.

If you want to try this in your own codebase, I’d start with one small maintenance task: some unused code, a stale feature flag, or a flaky test. Ask Codex to find an instance, gather evidence, and propose a small draft PR. Compare different models and efforts for that small task, since a cheaper configuration may be enough.

OpenAI built parts of this on infrastructure of its own: a dedicated Windows runner group and a remote build cache shared across its Bazel jobs. Most teams run their CI on GitHub Actions as it comes, and they can get most of these gains right there. Eight of the techniques above are workflow and test changes that work on any GitHub Actions runner, and ci-speedup finds the ones your repo needs from your own run history.

Run it again whenever CI slows down, and it checks your latest runs against its whole catalog, these ten techniques included, and names the next bottleneck with numbers from your own history. For the long pole that is left, [StarSling Runners](https://starsling.dev/products/runners) give the job a faster machine without leaving GitHub Actions, and come with agents that keep opening PRs to make your runs faster.

**Install ci-speedup on its own:**

## Prompt for your agent: install ci-speedup

Start here

Run OpenAI’s ten CI techniques on your repo

## Prompt for your agent: apply all ten

Source: [ci-speedup](https://starsling.dev/skills/ci-speedup)

Keep reading
