Loading page...Загружаем страницу...正在加载页面...
AtlasRepo

Dear Past Me: Three Agent Loop Mistakes That Cost a Day

说明与用途

LLM 驱动的代码审查代理因无限工具调用、缺失文件处理不当和部分 JSON 解析而浪费一天。通过设置循环预算、返回详细缺失文件信息和严格的 JSON 验证,可停止循环并节省时间。

问题

An LLM-powered review agent can waste a day due to unbounded tool calls, missing file handling, and partial JSON parsing.

结果

The agent loop now stops after a defined number of steps or tool calls, avoids retrying missing files, and only processes complete JSON tool calls, saving time and preventing infinite loops.

工作流

  • 1. Set a hard budget: cap maxSteps and maxToolCalls. 2. Track and abort on repeated identical tool calls. 3. Log each step as a structured event. 4. Return detailed missing file results with path, cwd, and retry hint. 5. Buffer tokens until stream signals done before parsing. 6. Validate tool call payloads against a schema and allowed set. 7. Reject or abort on schema violations or partial JSON.

证据

Set a hard budget before the first call.

来源

Return the path, the cwd, and a stop hint.

来源

  • 记录日期: 2026-09-09T18:01:40.860Z