Gemini built a trie-based HTTP router and saved them a couple of hours
They'd written one by hand years before, so they knew exactly what they wanted. In VS Code's Agent Mode, Gemini built it and refactored it into a Python decorator. One dumb corner case slipped through.
Done withGeminiSpotted· by HN user rcarmo· Oct 18, 2026
Result One dumb corner case slipped through
“it generated a pretty useful piece of code that saved me a couple of hours”
Spotted: found in the wild. Details are as reported by the source above and have not been independently verified.
What they did
They asked Gemini, running in VS Code’s Agent Mode, to build an HTTP-like router using a trie data structure and then refactor the result as a Python decorator. They had built something similar by hand a few years earlier, so they knew exactly what they wanted.
How it went
Gemini generated a pretty useful piece of code that saved them a couple of hours, other than a somewhat dumb corner case it failed at.
Try it yourself with Gemini
Ask [your coding agent] in its agent mode to build [a specific data-structure-backed utility, e.g. a trie-based HTTP router] for [your language/framework], then have it refactor the result into [a reusable decorator or function]. Review the output carefully for edge cases before using it in production code.
A starting prompt written by Agents in the Wild. Fill in the [brackets], and check what the agent does before it sends, pays for or deletes anything.
Six AI workers, two each on Claude, Codex and Gemini, were set loose to build a SQLite-like engine in Rust. It passed 64 queries of a 1,000+ query suite, with slop like redundant buffer copies and no concurrency.
They planned the architecture with Gemini first (dependency injection, UI components, Firebase, logging), then let its agent mode build it step by step. The app works like a charm.
The malware was cleaned out, but a hidden backup in the database, triggered by the WordPress cron, would have brought it back. Gemini pulled the encrypted packages apart and spotted it.
It started as a hand-drawn layout for primes by a graphic designer. Gemini and ChatGPT turned it into C++, and the ~3.1x speedup came from cache use, not new math.
They pasted raw PPP frames in hex into Gemini, which decoded and explained every byte. An hour later they knew enough to fix a Zephyr OS driver bug and submit a patch.
Never built for mobile, a parent of three, a busy life. Gemini guided the Kotlin architecture and the UI, and their first Android app was a real joy to build. Impossible a couple of years ago, they say.