{
  "id": 7282870,
  "title": "Six Bugs That Taught Me How to Build an AI Agent That Doesn't Fall Over",
  "url": "https://urgent.news/2026/09/14/six-bugs-that-taught-me-how-to-build-an-ai-agent-that-doesnt-fall-over",
  "topic": "ai",
  "section": "AI",
  "published": "2026-09-14T08:49:51.000Z",
  "source": {
    "name": "Dev.to",
    "slug": "dev-to",
    "url": "https://dev.to/kiita1302/six-bugs-that-taught-me-how-to-build-an-ai-agent-that-doesnt-fall-over-3mpp"
  },
  "original_language": "en",
  "account": "Over the past few months, the author has been running a continuous, unattended voice-driven AI assistant with over 240 tools and real API integrations. Building the demo took just a weekend, but keeping it alive for months required much longer effort, often revealing issues that aren't covered in framework quickstarts. Three significant failures taught the author crucial lessons in building resilient AI agents.\n\nFirst, an OAuth helper hung for hours when triggered from a background task with an expired token and no human present. The fix is simple: prevent any code from blocking indefinitely when it might be unattended. However, achieving this across Windows and POSIX systems without forcing a kill on a stuck call proved challenging, as Python lacks a cross-platform signal-based way to interrupt arbitrary blocking calls from non-main threads.\n\nSecond, the model sometimes issued the same tool call twice in a single turn, which is usually harmless. However, in one instance, two simultaneous calls to a session launch tool occupied the same microphone, causing conflicts. The solution is a short time-windowed dedupe check, verifying tool names and arguments against recent executions. Though obvious in hindsight, this check wasn't considered until the issue arose.\n\nThird, two unrelated features shared a single provider API key. When one feature experienced a surge in usage, it consumed its quota quota, starving other features mid-conversation, with no warning or isolation. The remedy is to allocate a budget ceiling per feature, rather than per account, preventing one feature's runaway loop from affecting others.\n\nThe author has incorporated these lessons into a Python library called kevlar-agent, which provides dedupe, silent (timeout) and budget guarding features. With 24 tests, MIT licensing and no framework lock-in, kevlar-agent can be easily integrated into existing Python projects using decorators and functions. For more details, visit https://github.com/KiitaInternet/kevlar or https://kiitainternet.github.io/kevlar/.",
  "summary": "For the past several months I've been running a voice-driven AI assistant of my own design, continuously, unattended — 240+ tools, real API integrations, real background jobs, no human babysitting it around the clock. Building the demo version took a weekend. Keeping it alive, unsupervised, for months took a lot longer — and almost none of what I had to fix ever shows up in a framework's…",
  "key_points": [],
  "editors_take": null,
  "illustration": null,
  "coverage": {
    "outlets": 1,
    "also_reported_by": []
  },
  "ai_generated": true,
  "disclaimer": "Summaries, key points and the editor’s take are written by software from other outlets’ reporting and may contain errors — always check the linked original."
}