跳到正文
DEV Community· Chris Sellers·· 3 小時前AI 評分41

Agent Middleware(Preview)中,delivery_uncertain 曾是錯誤標籤

When delivery_uncertain was the wrong label

AI 導讀

Agent Middleware (Preview) 的 MCP 路徑經兩項合併修正,避免把已收到上游結果的呼叫錯誤標記為 delivery_uncertain。

正文

Chris Sellers

delivery_uncertain is the honest label when a call went out and the response never came back. It is the wrong label when a well formed upstream result did arrive and the gateway still signed the call as uncertain.

That bug showed up on the governed MCP path in Agent Middleware (Preview). After the upstream answered, the MCP SDK could still raise while checking the live outputSchema, including after a second tools/list. The adapter had already crossed the dispatch boundary, so the generic handler saw dispatch_started and recorded delivery_uncertain. The debit stood. The call was never redispatched. The receipt said uncertain for a call that had finished.

Two merges fixed the classification (PRs 853 and 854 on https://github.com/agentmiddleware/agent-middleware-api , 24 Oct 2026):

  1. A well formed upstream result is now charged success, even when the live schema would have rejected it after the fact. The adapter no longer runs that post dispatch schema check on the call path.
  2. An upstream envelope the SDK cannot parse (for example content as a string, or isError not a bool) is now response_rejected with code upstream_response_invalid. It stays charged, is never redispatched, and no longer feeds the optional circuit breaker the way a true uncertain call did.

What did not change: a lost response after send is still delivery_uncertain, stays charged, and is never resent by AMW. A same key retry still returns the original receipt instead of dispatching again. A new key is still a new request. This is Preview, not a claim that remote side effects are exactly once.

If you build agent tool loops, how do you tell "finished but schema disagreed" from "we never got an answer"?

Chris

來源:DEV Community · dev.to