Inspiration
Most coding agents stop at "I wrote the code" — they never check whether it actually runs. I wanted an agent that treats its own output the way a careful engineer would: write it, run it, read the real error, fix it, and only call the job done after proving it works. Nemotron on Nebius Token Factory made it possible to build the "brain" of that loop without worrying about inference infrastructure from day one.
What it does
Loopwright is a self-correcting coding agent with two modes: give it a public repo with a failing test and it diagnoses and patches it, or give it a one-paragraph spec and it scaffolds a working Node app from scratch, including tests. It plans a checklist, then loops — read_file / write_file / run_command — using NVIDIA Nemotron via Nebius Token Factory for every reasoning step. It starts on Nemotron Nano and automatically escalates to Super, then Ultra, after repeated consecutive failures, so easy fixes stay cheap and only genuinely stuck problems use the bigger models. When it believes it's done, a separate verification step re-runs the tests and, for generated apps, boots the server and screenshots it with headless Chromium — proof it works, not just a claim. The whole loop streams live to the browser: a five-stage pipeline view, the plan, every tool call, command output, and the final verification.
How we built it
The agent runs inside a Docker container (Node 22 + git + headless Chromium), one container per mission, launched by a small Express orchestrator that tails the container's NDJSON stdout and relays each event to the React frontend over Server-Sent Events. All reasoning goes through Nebius Token Factory's OpenAI-compatible API against three Nemotron tiers (Nano/Super/Ultra), with an escalation policy keyed on consecutive failures. File tools are confined to the mission workspace via strict path resolution, and verification uses Node's built-in test runner plus Playwright-core for a real screenshot of the running app.
Challenges we ran into
I first designed around Nebius Serverless Jobs for code execution, then discovered mid-build that Token Factory credits and Nebius AI Cloud (where Jobs live) are separate accounts, and I only had the former. Instead of stalling, I moved the sandbox to per-mission Docker containers — the same isolation pattern — since Token Factory alone satisfies the hackathon's requirement.
The more interesting challenges came from the models themselves. When I ran every step on Nemotron Ultra, it would get the tests passing and then keep going: booting the server by hand, hitting "address already in use", and burning its whole iteration budget fighting the port. Telling it not to in the system prompt didn't work — so I enforced it in the tool layer: run_command now refuses server/background/kill commands and tells the model to call finish. That took build-from-spec missions on Ultra from 0/3 to 4/4 successes. Separately, a single call to a nonexistent tool used to crash the entire mission; now tool errors are fed back to the model like any failed command, so it self-corrects instead of dying.
Accomplishments that we're proud of
Both modes work end-to-end on the live public demo. In production today, fix-tests patched a real bug in 26 seconds using only Nemotron Nano, and build-from-spec produced a working HTTP server, a passing test, and a live verified screenshot in 71 seconds — escalating on its own from Nano to Super to Ultra along the way. The recorded demo runs every step on Nemotron Ultra to show the biggest model doing the work. And because escalation only triggers when the agent is stuck, most missions never need the expensive tier at all.
What we learned
Verification is the feature, not an afterthought — an agent that trusts its own "done" is only as reliable as its last guess. Prompts are suggestions; tools are rules: when a behavior must never happen, enforce it in code, not in instructions. A bigger model isn't automatically more reliable inside an agent loop — Ultra was more thorough, which made it more likely to wander off-task until the tools constrained it. And keeping the loop boring (plain JavaScript, built-in test runner, no build steps) bought more reliability than any clever prompting.
What's next for Loopwright
Replace Docker with Nebius Token Factory Sandboxes: I already prototyped against its REST API and measured 1–2s cold starts, so it's a drop-in path to a fully Nebius-native execution layer. Beyond that: more languages than JavaScript, persistent mission history with per-tier cost dashboards, and a "pair mode" where a human can approve a risky command or redirect the plan mid-loop.
Built With
- azure
- chromium
- docker
- express.js
- javascript
- nebius-token-factory
- node.js
- nvidia-nemotron
- playwright
- react
- server-sent-events
- vite
Log in or sign up for Devpost to join the conversation.