Six Bugs That Taught Me How to Build an AI Agent That Doesn't Fall Over
说明与用途
作者说明如何通过创建 kevlar-agent 库来解决阻塞 OAuth、重复工具调用和共享 API 密钥配额竞争问题,该库提供超时、去重和按功能预算功能。
问题
Unattended AI assistants can silently fail due to blocking OAuth flows, duplicate tool calls, and shared API key quota starvation.
结果
The agent now runs unattended for months without silent failures, thanks to timeout handling, dedupe, and per‑feature quota management.
工作流
- Identify failure modes during real‑world operation
- Implement cross‑platform timeout for OAuth calls
- Add time‑windowed dedupe for tool calls
- Track per‑feature API usage and enforce budget ceilings
- Package solutions into kevlar-agent library
- Integrate library into existing agent stack
- Run 24 tests to validate behavior
证据
The OAuth helper that hung for hours… just… waited. For hours. No error, no timeout, no log line saying anything was wrong
Two duplicate tool calls… two near‑simultaneous calls to a "launch session" tool spun up two concurrent audio sessions
Two unrelated features shared a single provider API key… silently ate into the quota the other feature needed
- 记录日期: 2026-09-19T21:30:41.018Z