AMW 如何處理工具呼叫逾時後的交付不確定狀態
A timeout does not tell you whether the tool ran
工具呼叫逾時只代表 Agent 停止等待,無法判斷工具是否已執行;盲目重試可能造成重複電郵、工單或扣款。AMW(Agent Middleware, Preview)會將發送後遺失回應的呼叫記錄為 `delivery_uncertain`,不會自行重發。同一個 key 重試會返回原有收據,新 key 則視為新請求。
When an agent calls a tool and the response never arrives, you know one thing: you stopped waiting. You do not know whether the tool did the work.
That gap is where duplicate emails, duplicate tickets and duplicate charges come from. The retry is reasonable. The missing information is the problem.
In AMW (Agent Middleware, Preview), which I am building, a lost response after the send is recorded as delivery_uncertain. AMW never sends that call again on its own. It keeps the state visible so a person or the tool owner can decide.
A same key retry returns the original receipt instead of dispatching again. A new key is a new request. That is the whole contract, and it is narrower than exactly once on purpose.
If you run agents against MCP tools, I would like you to try to break it: github.com/agentmiddleware/agent-middleware
Chris
來源:DEV Community · dev.to