Make agent-tool subtrees suspendable
Propagate graceful-suspend signals through detached run contexts and let only opt-in suspendable tools re-attach cancellation, so AsTool sub-agents can checkpoint and restore across nested trees while leaf tools keep running detached. Add focused agent and worker tests for single and multi-level suspend/ restore flows, plus heartbeat lease-loss and nested-restore error paths to harden functional behavior under failure conditions. Signed-off-by: Bryan Frimin <bryan@probo.com>
This commit is contained in:
@@ -41,6 +41,8 @@ type (
|
||||
|
||||
var (
|
||||
agentToolParamsSchema = mustJSONSchemaFor[agentToolParams]()
|
||||
|
||||
_ SuspendableTool = (*agentTool)(nil)
|
||||
)
|
||||
|
||||
func agentToolDepth(ctx context.Context) int {
|
||||
@@ -62,6 +64,8 @@ func newAgentTool(agent *Agent, name, description string) *agentTool {
|
||||
|
||||
func (t *agentTool) Name() string { return t.toolName }
|
||||
|
||||
func (t *agentTool) Suspendable() {}
|
||||
|
||||
func (t *agentTool) Definition() llm.Tool {
|
||||
return llm.Tool{
|
||||
Name: t.toolName,
|
||||
|
||||
Reference in New Issue
Block a user