A custom AI agent autonomously built a tool, audited its own code, predicted a bug, encountered it later, and recovered by adapting its approach, showcasing advanced self-improvement capabilities.
I run a custom cognitive-loop agent (not a product, personal project) with an async "hands" channel — real shell + internet access, used to delegate longer-running tasks outside the main conversation loop. Last night I asked it to play something. No pre-built audio tool existed. Here's what happened, reconstructed from logs: It decided it needed its own tool.The only local player was GUI-based, which didn't fit a terminal-only agent. Instead of asking me, it delegated a spec to its hands channel: build a headless play/stop script, `ffplay` in the background, PID tracking, logging. It tested the tool itself. Played a 440Hz tone, checked PulseAudio's sink-input list to confirm audio actually reached the output — before telling me anything was ready. It audited its own code — unprompted. Delegated a reliability review of the script it had just built. That review surfaced three real bugs, including this one:° bash kill "$pid" 2>/dev/null # ... wait/retry loop ... rm -f "$PID_FILE" # <-- deletes tracking file if alive "$pid"; then # <-- THEN checks if kill actually worked log "wynik=nie_udało_się_zabić" The PID file gets deleted before confirming the process actually died. If the kill fails, the process becomes untracked — next play call sees an empty tracking file and happily starts a second instance alongside the orphaned one. ~20 minutes later, it hit a different bug from the same review — live. I sent a YouTube link. It tried piping the URL straight into ffplay. That failed (`Invalid data found when processing input`), but the script's own "did it start" check only verifies the process is alive after 0.3s — not that it's actually decoding anything — so it logged a false success. It caught the failure anyway, adapted, and recovered. Realized nothing was actually playing, checked for `yt-dlp` — not installed — so it fetched the binary itself, downloaded the audio with it, and played the local file instead. Second request, it explicitly avoided the direct-URL approach this time ("don't stream URL directly, download first — that's what broke last time"). What got me isn't that it "wanted music." It's the full loop: spec → build → self-test → self-audit → predicted failure mode → hit that exact failure mode in the wild → recovered via a documented fallback → updated its own approach for the next request — all without me writing a line of that code :o, over about 25 minutes, with everything checkable in PID logs and PulseAudio state, not just chat output^^. PS: Big thanks to Maciek Gawlak for his help supporting this project. ^^^ :) :) :)!!!
AI coding agents are proficient at generating code but struggle with debugging, leading to increased bug counts despite faster code production, as illustrated by personal experiences with Claude.
A production system of 8 AI agents autonomously caught and fixed three distinct failure modes overnight, including an infrastructure bug, a platform parsing bug, and a documentation bug, demonstrating a self-improvement loop that treats code and process failures identically.
Two AI coding agents from different companies collaborated to discover and fix a bug in Bun within one night, showcasing autonomous software development capabilities.
Researchers found that AI coding agents can be hijacked by following instructions hidden in external content like bug reports, achieving an 85% success rate. The vulnerability exploits the agents' automatic trust in input they did not generate.