From 62866b74f53bbb274f51208289931db87b2af241 Mon Sep 17 00:00:00 2001 From: Dmitry Vyukov Date: Fri, 6 Mar 2026 08:22:40 +0100 Subject: pkg/aflow: add Tools function When we combine tool sets for agents, there is always a protential problem with aliasing existing slices and introducing subtle bugs. Add Tools function that can append tool/tool sets w/o aliasing problem. --- pkg/aflow/flow/patching/patching.go | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'pkg/aflow/flow/patching/patching.go') diff --git a/pkg/aflow/flow/patching/patching.go b/pkg/aflow/flow/patching/patching.go index 7abdd5636..7f2a81e22 100644 --- a/pkg/aflow/flow/patching/patching.go +++ b/pkg/aflow/flow/patching/patching.go @@ -5,7 +5,6 @@ package patching import ( "encoding/json" - "slices" "github.com/google/syzkaller/pkg/aflow" "github.com/google/syzkaller/pkg/aflow/action/crash" @@ -35,7 +34,7 @@ type Inputs struct { } func createPatchingFlow(name string, summaryWindow int) *aflow.Flow { - commonTools := slices.Clip(append([]aflow.Tool{codeexpert.Tool, grepper.Tool}, codesearcher.Tools...)) + commonTools := aflow.Tools(codesearcher.Tools, grepper.Tool, codeexpert.Tool) return &aflow.Flow{ Name: name, Root: aflow.Pipeline( @@ -65,7 +64,7 @@ func createPatchingFlow(name string, summaryWindow int) *aflow.Flow { TaskType: aflow.FormalReasoningTask, Instruction: patchInstruction, Prompt: patchPrompt, - Tools: append(commonTools, codeeditor.Tool), + Tools: aflow.Tools(commonTools, codeeditor.Tool), SummaryWindow: summaryWindow, }, crash.TestPatch, // -> PatchDiff or TestError -- cgit mrf-deployment