CodeScene PR Refactoring Agent
Following the work on the CodeScene CodeHealth MCP, for the past 2 months we at CodeScene have been busy packaging that into an autonomous agent that when spawned can go over the changes in your pull request, analyze its code health and fix whatever issues come up on its own, culminating in a new commit into your PR branch. We call it the PR Refactoring Agent.
It is a single executable that packages everything, so you don’t need any dependencies to run it. It has a ready-made GitHub Action you can install, but you can also just download the binary and integrate it into your workflow however you see fit.
Under the hood we’ve decided to use OpenCode for the Agent part, because it supports a huge selection of AI providers and configuration options, allowing us to focus on the core parts of the job of this particular agent rather than the low-level implementation of the agent. OpenCode even supports bringing your own self-hosted LLM which makes it a very nice and forward-looking solution in my opinion.
The hard part of any autonomous agent is, of course, reliability and security. We believe there is still quite a bit we can do to improve on both fronts, but we’ve made great strides already, and as of last week we believe that the PR Refactoring Agent is ready for general use.
I think it’s a great first step into the world of autonomous agents for us, tipping our toes in with this particular one, since it tends to be run in a isolated environment which takes care of a lot of the risk that would otherwise come from running non-deterministic autonomous systems.