WhoBuilt

Infra that fixes itself, thanks to coding agents

Nov 24, 2025· 18 min· 1.0K views·Watch on YouTube

Speaker

Mahmoud Abdelwahab of Railway explains how coding agents could monitor application infrastructure and propose fixes through pull requests on the AI Engineer channel.

Why infrastructure issues need context

Abdelwahab shows a service with growing memory use, a 94% request error rate, and response times of several seconds. Another service looks healthy on CPU and memory but suffers from slow database queries that can make a page take 30 seconds to load. He argues that thresholds can surface problems, but engineers still have to piece together logs, metrics, and traces to diagnose them.

Monitor services and gather evidence

His proposed workflow checks a project on a schedule, fetches its architecture and service metrics, and identifies services that exceed defined thresholds. It then gathers more context, including project health, logs, and potentially the status of upstream providers. Analyzing a time window can help distinguish persistent issues from noisy spikes, such as CPU reaching 80% during a workload burst.

Use durable workflows and a headless agent

Abdelwahab uses Inngest to coordinate workflows that can retry failed steps and cache successful results, so a retry can resume without repeating completed work. For code changes, he uses OpenCode, an open source terminal agent that can run as a headless server and be controlled through an API. He deploys it on Railway with tools including Git and the GitHub CLI so it can work in a repository and open pull requests.

From Railway metrics to a pull request

In the demo, scheduled workflows fetch project architecture, resource metrics, and HTTP metrics for deployed services. The example reports database CPU averaging 0.93 vCPU and memory usage at 31.96 GB out of 32 GB, alongside service error rates and latency. The system gathers HTTP, build, and deployment logs, asks an AI model to produce a debugging plan, and sends that plan to a coding agent, which opens a pull request for review.

Takeaways

  • Set monitoring thresholds, then give the agent enough time-windowed metrics and logs to investigate an issue.
  • Include architecture and deployment context so proposed fixes account for affected services and dependencies.
  • Use durable workflow steps with retries and cached results to avoid repeating completed work after failures.
  • Have the coding agent propose changes in a pull request so a person can review before merging.

Mentioned in this talk

Search inside this talk

What was claimed 10

Show all 10 facts

Related talks