Author’s note: getting started with OpenSRE for CI failure investigation in 4 steps: install, log in, connect GitHub, swap in your own model. Start with a read-only 30-day reliability analysis, then let it push fixes to a PR branch for human review.
When CI goes red, the pipeline only tells you which step failed — not why, and not how to fix it. When you’re racing a deadline, most people just hit “re-run” and move on if it passes. That’s how flakes pile up, main stays red for weeks, and eventually a senior engineer has to drop what they’re doing and dig through thousands of lines of logs. What OpenSRE wants to take off your plate is exactly that stretch of the investigation: reading the logs, tracing the cause, and writing a fix that goes to a human for review.
This is not a “fully automatic CI fixer.” It pushes the fix commit to the PR branch or a newly created fix branch, and a human decides whether to merge it after review. It won’t push to PRs from forks, and it never pushes directly to protected branches like main. The top of the project README also says Public Alpha: the core workflow works, but it isn’t fully stable yet.
The payoff: by the end of this article, you’ll have OpenSRE installed, logged in, and connected to GitHub in four steps. Then you’ll run a read-only 30-day reliability analysis to decide whether this repo is even worth handing over, and finally swap the underlying model for your own key, controlling cost separately across the Reasoning and Toolcall tiers.

When CI Breaks, Use AI to Investigate: OpenSRE Essentials
OpenSRE is a command-line agent open-sourced by Tracer-Cloud. According to the repo’s own description, it’s “The open-source agent for CI/CD reliability”: it reads failed runs, tracks down the cause, and then pushes a fix for human review. You can self-host it, and you can use your own model. The project is licensed under Apache-2.0, primarily written in Python, and its pyproject requires Python 3.12+.
As of a GitHub page snapshot dated 2026-11-23, the repo was created on 2026-01-13 and has roughly 14,474 stars, 1,967 forks, and 21 open issues. These are just the numbers we read that day—they’ll keep changing, so don’t treat them as long-term metrics.
| Key point | What it does | Value to you |
|---|---|---|
| Diagnose before acting | Reads failed checks and logs, finds the root cause, then changes code | No need to keep rerunning jobs and hoping for the best |
| Read-only analysis first | 30-day reliability analysis and health scans are read-only | Look at the data before deciding whether to grant write access |
| Fixes go to human review | Commits are pushed to a PR branch or a new fix branch | You decide whether to merge; main never gets changed directly |
| Swappable models | Supports two custom channels, custom-openai and custom-anthropic | Use your own API key and tier models by role to control costs |
| Status: Public Alpha | APIs and integrations will still change | Good for trying out in non-core repos first |
OpenSRE’s 5 CI Capabilities: Which Are Read-Only and Which Write
The official CI/CD docs split the capabilities into five blocks. Figuring out which ones are read-only and which ones write is the prerequisite for deciding how much permission to grant. Right now, the docs only show the GitHub Actions setup for these CI flows.
| Capability | Read / Write | Output |
|---|---|---|
| Reliability analysis | Read-only, runs locally | 30-day failure rate, CI-caused vs code-caused failures, developer hours lost, how long the default branch has been red |
| Health scan | Read-only, writes nothing | Lists across the org which PRs / branches are red, and which check is failing |
| Fix PR | Write, pushes to the PR branch or a new fix branch | One or more fix commits, waiting for review |
| Reliability agent | Read-only report | Covers the last 7 days, one report every workday morning |
| Fix loop | Write | For a single PR, up to three fix pushes within ten minutes |
What OpenSRE’s “push fixes to a branch” actually writes
The “push to a branch” in the title needs to be precise. According to the docs, when fixing a PR, OpenSRE reads the failing checks and their logs, modifies the code, and then pushes the commit to the PR’s own branch or to a newly created fix branch. It rejects PRs from forks, and it never pushes directly to protected branches (such as main). So its output is “a change waiting for your review” — merging is still up to you.
Permissions are granted separately, too. Reading Actions history only needs a read-only token; to let it push fixes, you also have to grant Contents and Pull requests write permission on that repo. In headless mode (no interactive terminal), fixing a PR requires explicitly authorizing the tool — the docs give opensre ask --allowed-tool fix_github_pr_ci "fix failing checks on owner/repo#1234". Without that flag, it won’t touch your code.

OpenSRE Quick Start: 4 Steps to Investigate CI Failures with AI
The four steps below cover installation, sign-in, connecting GitHub, and switching to your own model. Each step tells you what to type and what counts as success. OpenSRE is a pure CLI product, so all commands are shown as inline code—just copy and paste them.
| Step | What to type | Success criteria |
|---|---|---|
| 1. Install | Official curl install script | opensre runs directly in the terminal |
| 2. Sign in | opensre, then select Sign in or create account |
After signing in via the browser, return to the terminal and enter the interactive shell |
| 3. Connect GitHub | opensre integrations setup github |
/integrations verify passes, and you get a 30-day reliability analysis result |
| 4. Switch models | opensre onboard or set environment variables |
opensre --debug prints your provider, host, and model |
Step 1: Install OpenSRE with a single curl command
On macOS / Linux, run curl -fsSL https://install.opensre.com | bash -s -- -gh. On Windows PowerShell, run & ([scriptblock]::Create((irm https://install.opensre.com/install.ps1))) -gh. The official installation page shows -dc. The install script’s comments explain that -lp, -gh, and -dc only mark the install source (landing page, GitHub README, docs); the actual installation is exactly the same, so don’t worry about which one to choose.
Success criteria: You usually don’t need sudo. The script installs the program into a writable directory on your PATH; if it can’t find one, it installs to ~/.local/bin and prints instructions for updating your PATH. After making those changes, open a new terminal, and if opensre runs, you’re set. To upgrade later, use opensre update; to uninstall, use opensre uninstall (this also deletes local data).
Step 2: Sign in to your OpenSRE account and enter the interactive shell
Run opensre, choose Sign in or create account on the welcome screen, then complete the login in your browser. This step activates the hosted model, so you don’t need to bring your own LLM key on first launch. That also means first launch requires an OpenSRE account — for now, there’s no way around this prerequisite.
Acceptance criteria: back in the terminal, confirm the session and enter the shell, where you can choose whether to run the demo. The interactive shell requires a TTY. Once inside, type /help to see the list of slash commands, /status to check current state, and /cost to see consumption. Pressing Ctrl+C only cancels the current turn; session state is preserved.
Step 3: Connect GitHub and run a read-only 30-day reliability analysis first
Run opensre integrations setup github and authorize in the browser, or paste a token that can read Actions history. At this stage, read-only permission is enough — don’t rush to enable write access.
Acceptance criteria: in the shell, /integrations list should show GitHub, and /integrations verify should pass. Then have it run a 30-day reliability analysis on the target repository. The reference material doesn’t give a dedicated subcommand for this analysis, so you can just ask in natural language inside the shell; for headless scenarios, use opensre ask "..." with --json to get structured output.
Once you have the report, focus on three numbers:
- Ratio of CI-caused vs code-caused failures: if CI-caused failures (environment, dependencies, flakes) make up a high share, that means reruns are masking the problem, and it’s worth having it dig deeper.
- How long the default branch has been red: if main has been red for a long time, the team has likely become numb to red lights — which is exactly the situation it should take over.
- Overall failure rate and lost work hours: for repositories whose failure rate is already low, there’s no need to rush into fixes.
Step 4: Switch OpenSRE’s model to an APIYI key
Every diagnosis reads logs and makes multiple rounds of tool calls, which essentially keeps consuming tokens. So “switch to your own model and key” is something most long-term users end up doing. The easiest route is to run opensre onboard, choose a custom provider, then paste the base URL, API key, and model. If either the base URL or model is missing, onboarding and startup will fail outright—you won’t get requests silently sent to the wrong endpoint mid-run.
If you’d rather configure via environment variables, the custom-openai channel needs these (the docs explicitly require OPENSRE_LLM_CONNECTION=local when using your own billing):
LLM_PROVIDER=custom-openaiOPENSRE_LLM_CONNECTION=localCUSTOM_OPENAI_BASE_URL=https://api.apiyi.com/v1CUSTOM_OPENAI_API_KEY=sk-your-keyCUSTOM_OPENAI_MODEL=claude-opus-5-5(this one variable fills both the Reasoning and Toolcall tiers by default)CUSTOM_OPENAI_TOOLCALL_MODEL=gpt-6-luna(use a lighter model for Toolcall only)
The docs say to use the base URL as-is: you need to include the path yourself. The OpenAI-compatible channel must include /v1, and OpenSRE won’t assemble it for you. If you want to use the custom-anthropic channel instead, change to LLM_PROVIDER=custom-anthropic and configure CUSTOM_ANTHROPIC_BASE_URL=https://api.apiyi.com (the root domain), CUSTOM_ANTHROPIC_API_KEY, and CUSTOM_ANTHROPIC_MODEL. This channel only goes through the SDK; forcing OPENSRE_LLM_TRANSPORT=litellm will throw an error. The reference material only gives the variable for setting a separate Toolcall model on the OpenAI channel, so if you want separate billing for the two tiers, it’s best to prioritize custom-openai.
Acceptance criteria: Run opensre --debug, or set TRACER_VERBOSE=1. The terminal will print the resolved provider, the redacted base URL (host only), and the model. If all three match what you entered, the switch worked.

Think of the two model tiers like this: Reasoning handles diagnosis, verification, and multi-step analysis—figuring out where the failure actually is—so it’s worth using a more expensive model here. Toolcall only does tool selection and routing; it’s called often, but each task is light, so switching to a cheaper model can save a big chunk of cost. The table below lists models from the APIYI model catalog that can fill these two roles.
| Model | Input $/1M | Output $/1M | Cache read $/1M | Endpoint | Suggested role | Available platform |
|---|---|---|---|---|---|---|
| claude-opus-5-5 | 4 | 20 | 0.2 | chat + messages (OpenAI and Anthropic both work) | Reasoning | APIYI |
| gpt-6.2-sol | 2 (3 above 272,000 tokens) | 10 | 0.1 | OpenAI only | Reasoning fallback | APIYI |
| gpt-6-luna | 0.1 (0.2 above 272,000 tokens) | 0.5 | 0.01 | OpenAI only | Toolcall | APIYI |
| claude-haiku-5-5 | 0.1 (0.5 above 100,000 tokens) | 0.5 | 0.01 | Not listed in the reference material | Toolcall fallback | APIYI |
💰 Pricing notes: The data above comes from the APIYI apiyi.com model master table, last updated 2026-11-23 10:23 (UTC+8). Units are USD per 1M tokens, and top-ups settle at a 1:7 rate. We re-verified claude-opus-5-5, gpt-6-luna, and gpt-6.2-sol against the live pricing API. Based on these numbers, gpt-6-luna’s input price is 1/40 that of claude-opus-5-5, so moving high-frequency Toolcall work onto the lighter model delivers the most obvious savings.
🎯 Technical recommendation: After creating a token in the APIYI apiyi.com console, start by running a few diagnostics in a non-critical repo using the claude-opus-5-5 plus gpt-6-luna combo. Then watch the actual cost per round with
/cost, and once you’ve confirmed the diagnostic quality is good enough, roll it out to your main repo.
OpenSRE Source Layers: What Comes from Official Sources
This article draws on different sources, and they don’t all carry the same level of reliability. The table below separates them out.
| Source type | Content | How to treat it |
|---|---|---|
| Repository self-description | Public Alpha, Apache-2.0, star / fork counts | The project team’s own description and a snapshot from that day |
| Official documentation text | OPENSRE_LLM_CONNECTION=local, base URL used as-is, no pushing to fork PRs, no direct pushes to main |
Behavior explicitly stated by the official docs |
| What reading the source code reveals | normalize_anthropic_base_url strips the trailing /v1 from Anthropic URLs because the SDK appends /v1/messages itself |
Current implementation, not an official commitment; may change after version updates |
| APIYI overview table | Model names, input/output prices, data date 2026-11-23 | Subject to the platform’s real-time data |
One more point to clarify: the README mentions SWE-bench only to explain why OpenSRE holds itself to real tasks and clear feedback—it’s not a benchmark score or result for OpenSRE.
FAQ: Using AI to Investigate CI Failures
Q1: What is OpenSRE, and what can it do for me?
OpenSRE is an open-source command-line agent for CI/CD reliability. It reads failed GitHub Actions runs and logs, determines whether the failure came from the CI environment or from the code, and when necessary writes a fix and pushes it to the PR branch or a newly created fix branch for a human to review. What it saves you is the “dig through logs to find the cause” part — the merge decision still belongs to a human.
Q2: How is this different from just clicking “re-run”?
Re-running can only make this one run happen to turn green; the flake itself is still there. OpenSRE’s reliability analysis tallies the ratio of CI-caused versus code-caused failures over the past 30 days, plus how long the default branch has been red — turning “where exactly is it unstable” into visible data.
Q3: Will it modify my main directly?
Per the docs, it never pushes directly to protected branches (like main), and it refuses PRs coming from forks. Fixes go only to the PR branch or a newly created fix branch. The fix loop targets a single PR and pushes at most three times within ten minutes. In headless mode, fixing a PR also requires explicitly adding `–allowed-tool fix_github_pr_ci`.
Q4: Which teams are the best fit to try it first?
– **People inheriting a legacy repo**: main has been red for ages and nobody knows where to start looking.
– **Small teams of a few people**: there’s no dedicated SRE, so senior engineers keep getting pulled in to dig through logs.
– **Projects with a lot of flake**: re-running has become a habit, and you need reliability analysis to show the real failure rate.
Q5: How do I supply models to OpenSRE with my own key?
Register at APIYI apiyi.com and create a token, then run `opensre onboard` and choose a custom provider, or set the custom-openai environment variables as described in step 4. Enter the OpenAI-compatible base URL with `/v1` exactly as given, and add `OPENSRE_LLM_CONNECTION=local`. Finally, use `opensre –debug` to confirm that the provider, host, and model are all in effect.
Q6: Roughly how much does one diagnosis cost, and how do I keep costs down?
The cost depends on log length and the number of tool-call rounds — there’s no fixed number. You can check the actual spend per round with `/cost`. The key to cutting costs is splitting the two tiers: use claude-opus-5-5 for Reasoning ($4 input / $20 output) and gpt-6-luna for Toolcall ($0.1 input / $0.5 output). Both models are available on APIYI apiyi.com and can be called with the same key.
Q7: What limitations does OpenSRE currently have?
– **Maturity**: the project is in Public Alpha; APIs and integrations will still change.
– **Account**: an OpenSRE account is required on first launch.
– **Platform**: the CI workflow in the docs only covers the GitHub Actions setup.
– **Headless authorization**: fixing a PR in a headless environment requires separately authorizing the tool.
– **Telemetry and privacy**: first-party product analytics and Sentry error reporting are on by default; you can disable them with `OPENSRE_NO_TELEMETRY=1`. Masking sensitive identifiers before sending to an external LLM is optional, and you need to confirm for yourself whether it’s enabled.
OpenSRE: Investigating CI with AI — Key Takeaways
- What it is: an open-source CLI agent that reads failed logs, traces root causes, and writes fixes for a human to review.
- Read-only first: the 30-day reliability analysis and health scan don’t write anything at all.
- Write boundaries: it only pushes to PR branches or fix branches — never to fork PRs, and never straight to main.
- Four steps to get started: install, log in, connect GitHub, swap models — each with its own verification command.
- Two model tiers: Reasoning handles diagnosis, Toolcall handles routing; configuring them separately saves money.
- Swapping keys: the custom-openai channel points at APIYI apiyi.com’s OpenAI-compatible endpoint — remember to include
/v1. - Expectations: this is Public Alpha, so try it on non-critical repos first.
Summary: How to Roll OpenSRE Into Your CI
Order matters when adopting OpenSRE. In step one, grant read-only access and run the 30-day reliability analysis and health scan once to see what share of failures are CI-induced and how long main has been red. If those numbers show the team has been papering over problems with re-runs, the repo is worth handing over to it. If the failure rate is already low, read-only reporting is enough.
Only then consider turning on fixes: give that repo Contents and Pull requests write access, let it push fixes to PR branches or fix branches, and have a human review every commit before merging. Once diagnosis runs frequently enough that the token bill starts to show, move to step three and switch to your own key — use the expensive model for Reasoning and a lightweight model for Toolcall.
If you need a single key to call both claude-opus-5-5 and gpt-6-luna, you can grab a free trial quota through APIYI apiyi.com, then get the two-tier setup working in a small repo first.
📚 References
-
GitHub – OpenSRE: Project repository and README
- Link:
github.com/Tracer-Cloud/opensre - Note: Project status, license, and the “How it works” flow
- Link:
-
OpenSRE CI/CD docs: Reliability analysis, health scans, and the capabilities and limits of PR fixing
- Link:
github.com/Tracer-Cloud/opensre/blob/main/docs/cicd/overview.mdx - Note: The original text on not pushing to fork PRs and not pushing directly to protected branches
- Link:
-
OpenSRE LLM Providers docs: Custom model channel configuration
- Link:
github.com/Tracer-Cloud/opensre/blob/main/docs/platform/llm-providers.mdx - Note: The custom-openai / custom-anthropic variables and base URL rules
- Link:
-
APIYI model list: Models, pricing, and data update time
- Link:
docs.apiyi.com/models - Note: Source of the pricing data in this article; data updated 2026-11-23
- Link:
Author: APIYI technical team
Technical discussion: If you run into issues while configuring custom model channels, feel free to reach out through the APIYI official website homepage.