aboutsummaryrefslogtreecommitdiffstats
path: root/pkg/aflow/flow/patching/patching.go
diff options
context:
space:
mode:
authorDmitry Vyukov <dvyukov@google.com>2026-03-06 08:22:40 +0100
committerDmitry Vyukov <dvyukov@google.com>2026-03-06 07:48:35 +0000
commit62866b74f53bbb274f51208289931db87b2af241 (patch)
treedd9de51740ae8bada292c54844cbc5a8fe7c6a65 /pkg/aflow/flow/patching/patching.go
parent31e9c887f7dc24e04b3ca70d0d54fc34141844b0 (diff)
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.
Diffstat (limited to 'pkg/aflow/flow/patching/patching.go')
-rw-r--r--pkg/aflow/flow/patching/patching.go5
1 files changed, 2 insertions, 3 deletions
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