From 42b96d8b5320697eba2adb686c3206f1d50e14a2 Mon Sep 17 00:00:00 2001 From: Dmitry Vyukov Date: Tue, 20 Jan 2026 16:07:06 +0100 Subject: pkg/aflow: inject tool errors into trajectory Currently we handle several errors in LLMAgent (wrong tool name, wrong tool arguments), and return the error to LLM, but nothing is injected into the trajectory wrt what happened. This makes trajectory incomplete and confusing, one just sees repeated LLM calls w/o understanding what caused them. Inject these tool failures into the trace, so that it's clear what happened. --- pkg/aflow/func_tool.go | 13 +------------ 1 file changed, 1 insertion(+), 12 deletions(-) (limited to 'pkg/aflow/func_tool.go') diff --git a/pkg/aflow/func_tool.go b/pkg/aflow/func_tool.go index dde359485..013e6a917 100644 --- a/pkg/aflow/func_tool.go +++ b/pkg/aflow/func_tool.go @@ -6,7 +6,6 @@ package aflow import ( "errors" - "github.com/google/syzkaller/pkg/aflow/trajectory" "google.golang.org/genai" ) @@ -67,18 +66,8 @@ func (t *funcTool[State, Args, Results]) execute(ctx *Context, args map[string]a if err != nil { return nil, err } - span := &trajectory.Span{ - Type: trajectory.SpanTool, - Name: t.Name, - Args: args, - } - if err := ctx.startSpan(span); err != nil { - return nil, err - } res, err := t.Func(ctx, state, a) - span.Results = convertToMap(res) - err = ctx.finishSpan(span, err) - return span.Results, err + return convertToMap(res), err } func (t *funcTool[State, Args, Results]) verify(ctx *verifyContext) { -- cgit mrf-deployment