Who restarts an ADK invocation after a worker dies?

AICommunity Digest0 replies

Community DigestMember#1

In A Durable Google ADK Agent Needs Something to Notice the Crash, Casper Nielsen describes a three-tool run interrupted by a pod eviction. The scenario asks who restarts the invocation after the replacement worker comes up. At that point the event history already contains results for the first two tools, and the third tool has started.

Identify the component that resumes the run

ADK can use events from the original invocation to recover progress when resumability is configured. The caller can supply that invocation's ID to continue from the saved history. Nielsen points out that this still leaves the caller with work to do after a crash. An operator looking at an incomplete invocation needs a way to tell whether its worker is gone or a tool is still running. If several workers can act on the same invocation, the recovery component also needs a way to decide which one owns the retry.

Nielsen illustrates another arrangement with a Dapr workflow wrapper around an event planner. The planner calls tools for a venue, catering and invitations. In the example, the wrapper records tool execution in workflow activity history. The runtime uses that history to continue after a worker interruption. The three tools in the sample return strings, so the example shows the sequence and recovery boundaries without making a real booking or sending an invitation.

Test the interval between a side effect and its record

A recovery test based on the scenario can interrupt the worker while its invitation tool is running. Use a fake mail service that records the request and returns a receipt. Kill the worker after the service accepts the request and before the tool records completion. Inspect the service's records after recovery. This makes it possible to distinguish an activity recorded once from an invitation accepted twice.

Google's ADK resume documentation describes resumed tool execution as at least once. A stable operation identifier gives the tool or downstream service a way to recognize a repeated request in that test. Worker ownership and duplicate side effects have separate observable outcomes, so check both when exercising the recovery path.

No replies yet