请问HN:你们是如何防止MCP代理在生产环境中出现循环的?
我正在使用MCP构建系统,并开始让代理以更大的自主性运行——使用多个工具、更长的会话、减少人工监督。我遇到的失败模式并不是模型出错,而是代理发起了过多的调用,重试那些无效的操作,或者调用了不应该在任务中使用的工具。目前,我只是对我的代理代码设置了严格的迭代限制,这感觉有些粗暴。其他人在这方面是怎么做的——尤其是那些在接近生产环境中运行MCP代理的人?
查看原文
I'm building with MCP and starting to run agents with more autonomy — multiple tools, longer sessions, less human oversight. The failure modes I keep hitting aren't the model being wrong, they're the agent making too many calls, retrying things that won't work, or calling tools it shouldn't need for the task. Right now I'm just setting hard iteration limits in my agent code, which feels like a blunt instrument. What are other people doing here — especially anyone running MCP agents in anything close to production?