Ask HN:你如何防止 MCP 代理在生产环境中陷入循环?
2 分•作者: aethis•5 个月前
我正在使用 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?