Cap the Turns: A Weekend Call Envelope for Agent Side Projects
说明与用途
文件回调包限制模型和工具调用,防止代理循环无限运行。
问题
Side‑project agents can run forever, consuming model and tool calls until the laptop is closed, wasting capacity and budget.
结果
The envelope stops agent loops when the local budget is exhausted, preventing overnight idle consumption and providing a clear, testable stop condition.
工作流
- Persist remaining call budget in a JSON file
- Wrap model and tool calls behind a try_consume() gate
- Return EnvelopeEmpty exception when budget is exhausted
- Provide CLI to inspect, reset, and dry‑run the envelope
- Prove halt with a unit test that does not hit the network
证据
Persist remaining call budget in a JSON file.
Wrap both model calls and tool calls behind one try_consume() gate.
- 记录日期: 2026-09-22T12:45:51.747Z