We saw the news about Nubank using Devin to refactor millions of lines of code. Can OpenHands handle that same level of multi-file synchronization? We are looking to split a legacy ETL monolith into sub-modules. Is the agent capable of maintaining import integrity across 50+ files?
3 answers
This is where the "Planning Agent" in OpenHands shines. For a massive refactor, you don't just ask it to "fix the code." You use the waterfall-style workflow where the Planning Agent maps out the dependency tree first. It creates a step-by-step checklist. Then, the CodeAct agent executes those steps one by one, running tests after each change to ensure it hasn't broken the build. We used it for a 100k-line migration from JavaScript to TypeScript. It handled about 85% of the conversions autonomously. The remaining 15% were complex edge cases that required a human architect. It didn't do the whole job alone, but it turned a 6-month project into a 4-week project.
How does it manage the "token context" during a refactor that large? Doesn't it forget the first file by the time it gets to the fiftieth?
The "Evaluation" pipeline is also key. It checks its work against your existing unit tests in real-time.
Agreed, Monica. If it breaks a test, it sees the error in the terminal and attempts to fix it immediately before moving on.
It uses a "browsing" mechanism. It doesn't keep every file in the prompt at once. Instead, it "searches" the codebase, reads a file, makes a change, and then summarizes its findings into a persistent "state log." This way, the agent knows what it changed and why, without blowing up your API costs. It mimics how a human developer works—one file at a time, but with a clear plan in mind.