AI Autofixer: From an Error Group to a Pull Request
How Temps turns a production error group into a sandboxed AI agent run, a reviewed fix, and a pull request with full debugging context.
Temps Team
May 17, 2026 · 2mo ago
How Temps turns a production error group into a sandboxed AI agent run, a reviewed fix, and a pull request with full debugging context.
Temps Team
May 17, 2026 · 2mo ago
Temps v0.1.0 ships a built-in AI Autofixer: open an error group in your dashboard, click "Fix with AI", and the platform creates a sandboxed agent run that reads the stack trace, edits your repo in an isolated workspace, and opens a pull request on GitHub. No external AI coding tool, no copy-pasting stack traces into a chat window, no leaving the deployment platform.
You get an error spike at 2am. You squint at the stack trace, half-asleep. You check out the repo, find the offending function, write a fix, push it, wait for CI, merge, deploy. By 3am, you're back in bed, exhausted.
Or — in Temps v0.1.0 — you click "Fix with AI" on the error group, an agent reads the stack trace and your repo, makes a fix, opens a pull request, and you review it after coffee.
That's the loop. This post explains how it works, why we built it the way we did, and what to expect (including the parts that aren't magic).
TL;DR: The Autofixer in Temps v0.1.0 ties AI agents to error groups. Click Fix with AI, the agent reads the stack trace, checks out your repo in a sandboxed run, makes a fix, opens a PR via GitHub. Two-phase flow (analyze → fix), real-time SSE streaming of the agent's output, and a split UI showing the error on one side and the conversation on the other. It's young, it's a flagship feature, and it produces PRs you should review like any junior contributor's PR.
Here's what happens when you click Fix with AI on an error group:
agent_runs table gets a new row with phase analyzing. The UI's workflow timeline updates.The agent run history page lets you replay every run with full stdout/stderr, exit code, and timestamps.
That sandbox is a platform primitive, not an Autofixer-specific one: Temps exposes the same kind of isolated container (and, on a Linux host with KVM, Firecracker microVMs) through its sandbox API, which is what keeps agent code on your own server instead of a hosted execution service like E2B or Modal.
| Approach | Time to first fix attempt | Stays in your deployment platform | Has full error context (trace, breadcrumbs) | Opens PR automatically |
|---|---|---|---|---|
| Manual debugging | Hours | Yes | Yes | No |
| AI chat (ChatGPT / Claude) | 10–30 min | No — copy-paste required | No — you summarize it | No |
| GitHub Copilot / Cursor | 5–15 min | No — switch to IDE | No — you paste stack trace | No |
| Temps Autofixer | 2–5 min | Yes | Yes — reads directly | Yes |
The difference is integration depth: the Autofixer reads the actual error event, breadcrumbs, and OTel trace_id from your Temps error tracking store. You don't summarize the problem — the agent sees the same data you see.
The interactive Autofixer flow is deliberately two-phase: analyze → review → fix → review → PR. Not one-shot.
The reason is simple: AI agents make mistakes, and the cost of a wrong fix is higher than the cost of a brief pause for human review. By splitting analyze from fix, we catch the worst class of error — the agent misreading what's broken — before it touches your code.
Phase 1 (analyze): the agent reads the error and proposes a diagnosis and approach. No file edits. You read the analysis and either approve or push back ("no, this is actually a database connection pool issue, not a null check problem").
Phase 2 (fix): the agent implements based on the approved analysis. File edits happen here, in the sandbox.
The two-phase flow isn't a UX decoration. It's a cost-aware design choice: reviewing prose is cheap; reviewing a diff for a fix that addresses the wrong problem is expensive. The human gate is placed at the cheaper side of the loop.
The Autofixer is one application of a general agent framework that landed in v0.1.0 — the new temps-agents crate.
The framework supports two modes:
CronScheduler service. Use case: nightly dependency upgrades, weekly code-quality scans, scheduled refactor passes.Both modes share infrastructure:
agent_runs table with phase, analysis, user_context, status, exit code, timestamps.agent_run_logs table with streamed stdout/stderr..temps/agents/*.yaml is the source of truth, synced during deployment..claude/skills/ in the repo, auto-discovered by the Claude CLI.claude_cli, codex_cli, or opencode (configure per-agent via ai_provider:).push_files_and_create_pr and create_pull_request for PR creation.Citation Capsule: The
temps-agentscrate in Temps v0.1.0 supports two agent modes: autonomous agents that run on cron schedules with configurablesystem:prompts andmax_turns(default: 25), and interactive agents that drive the Autofixer through a two-phase analyze-then-fix flow. Both modes share theagent_runstable, real-time SSE log streaming, and built-in GitHub PR creation viapush_files_and_create_pr. Three providers are supported:claude_cli,codex_cli, andopencode— verified incrates/temps-agents/src/ai_cli/.
1. Phase-aware
agent_runstable with six tracked states. The Autofixer transitions throughanalyzing → analyzed → fixing → fix_ready(orno_fix/failed). Thepush_files_and_create_prcall only happens whenphase = "fix_ready". — verified incrates/temps-agents/src/services/autofixer.rs
2.
max_turnsdefaults to 25, configurable per-agent in YAML. TheAgentYamlConfigstruct intemps-core/src/repo_config.rssetsdefault_max_turns()to25. Autonomous agents set it viamax_turns:in.temps/agents/*.yaml. TheCronSchedulerpolls scheduled agents and fires agent runs against theproject_agentstable. — verified incrates/temps-core/src/repo_config.rslines 186–187 andcrates/temps-agents/src/services/cron_scheduler.rs
3. Three AI providers ship out of the box:
claude_cli,codex_cli,opencode. Each has its own module undercrates/temps-agents/src/ai_cli/. All three emit the sameagent_run_logsshape so provider can be swapped per-agent with no backend changes. — verified vials crates/temps-agents/src/ai_cli/
The Autofixer UI is a two-pane layout:
A workflow timeline at the top shows the current phase. SSE streams the agent's output in real time, with auto-scroll and a "working" indicator when the agent is mid-thought.
The AutofixButton on the error group detail page is status-aware. Before the first run: "Fix with AI." During a run: "Run in progress" with a link to the conversation. After a successful PR: "PR #123 opened."
Streaming the agent's chain-of-thought live is the single most valuable part of the UI. Watching the agent narrate what it's looking at makes it dramatically easier to catch wrong reasoning before the fix phase starts — an important safeguard given that fixing the wrong problem wastes everyone's time.
The agent's stdout is parsed as Claude CLI's stream-json format. Each line is a JSON event with a type (content, tool_use, tool_result, error, etc.). The Rust backend parses line by line via BufReader, normalizes events, and pushes them onto an SSE channel.
The frontend subscribes via EventSource and renders events into the conversation pane. Auto-scroll keeps the latest output visible. A working indicator appears when the agent is mid-message.
This is harder than it sounds, because Claude CLI's output is line-buffered but not strictly line-delimited — partial lines arrive when the network flushes mid-message. The line-by-line BufReader approach handles partial reads correctly and avoids the "frozen UI for 30 seconds, then 200 lines at once" pattern.
Honest list:
You should treat AI-generated PRs the way you'd treat a junior contributor's PR: read carefully, run the tests, think about edge cases. The point isn't autopilot — it's getting a working first draft faster than starting from scratch.
Same framework, different trigger. Autonomous agents run on cron schedules. Configure once with a system prompt:
# .temps/agents/dependency-upgrades.yaml
name: dependency-upgrades
ai_provider: claude_cli
max_turns: 20
on:
schedule:
cron: "0 9 * * 1" # Mondays at 9am
system: |
You are a dependency upgrade assistant. Each week, check for available
minor and patch upgrades to dependencies in this repo. For any safe upgrade,
run the test suite locally, then open a PR with the changes.
The CronScheduler service watches the project_agents table for scheduled agents and fires runs. Output streams to the UI just like Autofixer runs. PRs get opened the same way.
Honest TODO: manual triggers for autonomous agents currently use the same one-shot pipeline as scheduled runs. We'd like manual triggers to use the interactive flow with human gates. Coming in a future release.
The framework ships three AI provider backends:
claude_cli — Claude CLI, with --continue for multi-turn sessions in the same working directory. Strong at code reading and following structured output formats. Configure model with ai_model: in the YAML.codex_cli — OpenAI Codex CLI (GPT-4.1 / o-series). Different cost profile, different strengths.opencode — OpenCode (multi-provider terminal agent). Configure via opencode auth add.Set ai_provider: in your agent YAML. All three produce the same agent_run_logs shape, so you can swap providers without UI changes.
--continue support is per-run for multi-turn within a single conversation, not across runs.The Autofixer is live in v0.1.0. To use it:
The full agent framework is documented in .temps/agents/README.md in your project. Temps is Apache 2.0 — free to self-host. Temps Cloud is ~$6/mo (Hetzner cost + 30%, no per-seat fees).
The agent runs in a sandbox with a clean checkout of your repo. It has read access to source files and can edit files within the sandbox. It doesn't have access to your production environment, your databases, or your secrets — only what's in the repo.
The sandbox doesn't have access to your project's runtime env vars. If your repo includes a .env.example with placeholder values, the agent can read that, but real secrets stay in Temps's encrypted store.
Yes, if your repo has a standard test runner (bun test, npm test, cargo test, pytest). The agent will detect and run tests as part of the fix phase.
You bring your own AI API key, so cost depends on your provider and usage. A typical Autofixer run consumes 10k–50k tokens — at current Claude and OpenAI pricing, well under $1 per run.
It's a flagship feature with production-ready UI across 8 surfaces and tests for 19/19 core services. We're shipping it as v0.1.0 because the loop works end to end, but the AI agent space moves fast and we expect to iterate. Treat it like any new tool — run it on a non-critical project first, learn its quirks, then expand.
GitHub Copilot Autofix works on static analysis (SAST) findings before code ships. The Temps Autofixer works on runtime error groups — production exceptions from your Sentry-compatible error tracking, complete with stack trace, breadcrumbs, and OTel trace context. They're complementary: Copilot Autofix catches static issues pre-merge; Temps Autofixer handles what slips through to production.
Yes. Temps is Apache 2.0. The temps-agents crate, autofixer service, and all related code are in the public repo. Temps Cloud (~$6/mo) is available if you don't want to manage the infrastructure.
Related: Read the full v0.1.0 release notes