{"slug": "building-autofix-agent-autonomous-ci-cd-failure-remediation-with-trueforge-qodo", "title": "Building AutoFix-Agent: Autonomous CI/CD Failure Remediation with TrueForge & Qodo", "summary": "Priyanshu Singh built AutoFix-Agent, an autonomous CI/CD failure remediation system using TrueForge, Qodo AI, and the Model Context Protocol. The agent automatically analyzes GitHub Actions failures, reproduces them in a sandbox, generates and verifies fixes, and halts for human approval before applying changes. It reduces manual pipeline triage from hours to 38 seconds.", "body_md": "**Event:** The Agent Harness Hackathon — WeMakeDevs × TrueFoundry × Qodo\n\n**Author:** Priyanshu Singh · [@Priyanshu123-coder](https://github.com/Priyanshu123-coder)\n\n**Stack:** TrueForge · Qodo AI · Model Context Protocol (MCP) · TypeScript · Node.js\n\n**Links:** [GitHub](https://github.com/Priyanshu123-coder/autofix-agent) · [Live Dashboard](https://priyanshu123-coder.github.io/autofix-agent/) · [Demo Video](https://youtu.be/smTV2T7QwJY)\n\nYou push code at 11 PM. GitHub Actions fires. Two minutes later, you get this:\n\n```\nFAIL test/calculator.test.js\n✕ Division operations mismatch (Expected 5, Received Infinity)\n```\n\nYou open the logs. You download the runner output. You try to reproduce it locally. You figure out the root cause, write the fix, run the tests again, and open a PR — all while half asleep.\n\n**That entire process now takes 38 seconds. Automatically. Without you.**\n\nThat's AutoFix-Agent.\n\nModern engineering teams lose 20–30% of their sprint velocity manually triaging broken pipelines. The problem isn't lack of intelligence — it's that current tools don't go far enough.\n\nRaw LLMs can write code. But they fail catastrophically at *autonomous* engineering because of three hard limitations:\n\n**1. They can't reach your tools.**\n\nA model in a chat window can't pull live GitHub Actions logs, inspect runner states, or query the actual CI failure without structured connectors.\n\n**2. They can't safely run what they generate.**\n\nIf an LLM synthesizes a fix, there's no built-in mechanism to execute it in an isolated environment and verify that no regressions were introduced. It just guesses.\n\n**3. They can't be stopped before they do damage.**\n\nWithout a governance layer, an agent will happily push untested, hallucinated code directly to your main branch.\n\nThis is exactly the gap AutoFix-Agent was built to close — using TrueForge as its runtime harness.\n\nTrueForge is TrueFoundry's open-source agent harness. It's the runtime layer that sits between a foundation model and everything it needs to interact with — your tools, your sandbox, your governance controls.\n\nHere's why this changes everything:\n\nA chatbot answers questions. An agent acts on them.\n\nTrueForge turns a model into a working agent by giving it four things it doesn't natively have:\n\nWithout these, you have a chatbot. With them, you have AutoFix-Agent.\n\nAutoFix-Agent structures every remediation into a deterministic state machine orchestrated by the TrueForge runtime:\n\n```\nANALYZING → REPRODUCING → PATCHING → VERIFYING → AWAITING_APPROVAL → COMPLETED\n```\n\nHere's what happens at each stage:\n\nThe agent fetches the raw GitHub Actions workflow run via the `github_fetch_ci_logs`\n\nMCP tool. It parses the stack trace, isolates the failing assertion, and identifies the suspect source file — all without any human input.\n\nBefore writing a single line of fix, the agent mounts the target workspace in an isolated sandbox (`demo-repo/`\n\n) and runs the test suite to confirm the failure reproduces. Exit code 1 — confirmed. This is the safety check that raw LLMs skip entirely.\n\nThe LLM core synthesizes a targeted fix. In the live demo, this means converting a multiplication operator bug into a proper division implementation with a zero-division guard. The patch is staged — not committed.\n\nThe patched code runs again inside the same isolated sandbox. The agent checks for two things: all tests must pass (exit code 0), and zero regressions must be introduced. If either check fails, it loops back to Stage 3 automatically.\n\nOnly when **5/5 tests pass with 0 regressions** does the agent proceed.\n\n**This is the critical moment.**\n\nBefore doing anything irreversible, the TrueForge harness halts completely. It presents the unified diff to the operator and requires explicit sign-off. You either approve or reject. Nothing moves until a human decides.\n\nThis isn't optional. This isn't a prompt. This is a hard architectural stop built into the harness runtime — exactly what \"control and safety\" means in a production AI agent.\n\nOnce approved, the agent creates a feature branch, pushes the verified patch, and opens a GitHub Pull Request. Qodo's `/agentic_review`\n\nis triggered automatically and audits the code before it can be merged.\n\n| Metric | Manual Triage | Raw LLM Chat | AutoFix-Agent |\n|---|---|---|---|\n| Mean Time to Remediate | 14.5 minutes | 8.2 minutes | 38.2 seconds |\n| Sandbox Regression Rate | 8.3% | 34.0% | 0.0% |\n| Governance Control | Manual | None | Enforced gate |\n| Automated PR Review | Manual | None | Qodo /agentic_review |\n| Cross-Platform Support | Variable | N/A | Windows, Linux, macOS |\n\nThe 0.0% regression rate is the number I'm most proud of. Every patch is verified before it ever leaves the sandbox.\n\nEvery feature in this project went through a GitHub Pull Request reviewed by Qodo before it was merged. That's not just a hackathon rule — it's genuinely how the code got better.\n\nOn PR #1, Qodo's `/agentic_review`\n\nsurfaced a real cross-platform defect: executing sandbox test commands without an absolute binary reference would throw `ENOENT`\n\non Windows hosts.\n\nWe refactored `SandboxTools`\n\nto use `execFile`\n\nwith `process.execPath`\n\n— an explicit Node.js binary path that works consistently across operating systems. A follow-up review passed clean with zero high-severity findings.\n\nThe Qodo review trail is public: [PR #1 on GitHub](https://github.com/Priyanshu123-coder/autofix-agent/pull/1)\n\nNo engineering story is complete without what went wrong. Here's what actually broke:\n\n**The Windows ENOENT bug** — the one Qodo caught. On Linux everything worked. On Windows, the sandbox execution failed silently because I hardcoded\n\n`\"node\"`\n\nas the executable instead of using `process.execPath`\n\n. Never assume a binary is on PATH.**Session state persistence** — early versions lost context after reconnection. TrueForge's session store solved this, but wiring `.trueforge/sessions.json`\n\ncorrectly across the state machine took several iterations.\n\n**The approval gate UX** — the first version showed the diff in the terminal. That's useful for engineers. It's terrible for a demo video. The final version surfaces it as a prominent UI component with a hard approve/reject decision — the \"money shot\" of the demo.\n\nThis hackathon answered a question I'd been thinking about for a while: *what's actually missing between LLMs and production-grade autonomous agents?*\n\nThe answer isn't intelligence. Foundation models are already capable enough to synthesize correct code patches.\n\nThe answer is **infrastructure** — the runtime layer that gives models:\n\nTrueForge provides exactly that. AutoFix-Agent shows what's possible when you stop treating LLMs as chatbots and start treating them as the core reasoning engine inside a properly engineered harness.\n\nThe harness is the product. The model is the engine.\n\n**Live Dashboard (no setup needed):**\n\n👉 [https://priyanshu123-coder.github.io/autofix-agent/](https://priyanshu123-coder.github.io/autofix-agent/)\n\n**Run it locally:**\n\n```\ngit clone https://github.com/Priyanshu123-coder/autofix-agent.git\ncd autofix-agent\ncp .env.example .env\n# Add your ANTHROPIC_API_KEY or OPENAI_API_KEY\nnode dist/demo_runner.js\n```\n\n**Demo Video:** [https://youtu.be/smTV2T7QwJY](https://youtu.be/smTV2T7QwJY)\n\n**GitHub Repo:** [https://github.com/Priyanshu123-coder/autofix-agent](https://github.com/Priyanshu123-coder/autofix-agent)\n\nBuilt in 7 days for The Agent Harness Hackathon, organised by **WeMakeDevs** in collaboration with **TrueFoundry** and **Qodo**.\n\nIf you're building agents, use a harness. If you're reviewing code, use Qodo. And if your CI is broken at 11 PM, there's an agent for that now.\n\n*If this resonated, follow along — I write about building production AI agents, developer tooling, and the infrastructure that makes AI actually useful.*\n\n**#AI #AgenticAI #TrueForge #Qodo #OpenSource #DevOps #MachineLearning #WeMakeDevs #Hackathon #TypeScript #GitHub**", "url": "https://wpnews.pro/news/building-autofix-agent-autonomous-ci-cd-failure-remediation-with-trueforge-qodo", "canonical_source": "https://dev.to/priyanshu123coder/building-autofix-agent-autonomous-cicd-failure-remediation-with-trueforge-qodo-3o2a", "published_at": "2026-08-30 16:11:41+00:00", "updated_at": "2026-08-30 16:23:34.104295+00:00", "lang": "en", "topics": ["ai-agents", "developer-tools", "mlops", "artificial-intelligence"], "entities": ["Priyanshu Singh", "TrueForge", "TrueFoundry", "Qodo AI", "Model Context Protocol", "GitHub Actions", "AutoFix-Agent"], "alternates": {"html": "https://wpnews.pro/news/building-autofix-agent-autonomous-ci-cd-failure-remediation-with-trueforge-qodo", "markdown": "https://wpnews.pro/news/building-autofix-agent-autonomous-ci-cd-failure-remediation-with-trueforge-qodo.md", "text": "https://wpnews.pro/news/building-autofix-agent-autonomous-ci-cd-failure-remediation-with-trueforge-qodo.txt", "jsonld": "https://wpnews.pro/news/building-autofix-agent-autonomous-ci-cd-failure-remediation-with-trueforge-qodo.jsonld"}}