Pass tool gates through the squad native backend #12
@@ -9,6 +9,8 @@ import (
|
||||
|
||||
nativexec "agent-native/adapters/native"
|
||||
"agent-native/exec"
|
||||
"agent-native/runtime"
|
||||
"agent-native/runtime/hooks"
|
||||
"agent-native/runtime/llm"
|
||||
"agent-native/runtime/mcp"
|
||||
"agent-native/runtime/subagent"
|
||||
@@ -33,6 +35,12 @@ type Config struct {
|
||||
OnEvent func(ev squad.ProcessEvent)
|
||||
Stream llm.StreamFunc
|
||||
MaxToolCalls int
|
||||
BeforeTool func(call llm.ToolCall) error
|
||||
AfterTool func(call llm.ToolCall, res llm.Message)
|
||||
Stop func(last llm.Message, info runtime.StopInfo) runtime.StopDecision
|
||||
Reminders func(turn int) []string
|
||||
RepeatGuard bool
|
||||
Hooks *hooks.Bus
|
||||
}
|
||||
|
||||
// Register 把 "agent-native" 工厂注册进解析器。
|
||||
@@ -72,6 +80,10 @@ func buildOptions(cfg Config, role squad.RoleSpec) (nativexec.Options, error) {
|
||||
SkillsRoots: cfg.SkillsRoots, Subagent: cfg.Subagent, HostTools: cfg.HostTools,
|
||||
},
|
||||
SessionOptions: nativexec.SessionOptions{Compact: cfg.Compact, MaxToolCalls: cfg.MaxToolCalls},
|
||||
GateOptions: nativexec.GateOptions{
|
||||
BeforeTool: cfg.BeforeTool, AfterTool: cfg.AfterTool, Stop: cfg.Stop,
|
||||
Reminders: cfg.Reminders, RepeatGuard: cfg.RepeatGuard, Hooks: cfg.Hooks,
|
||||
},
|
||||
}
|
||||
if cfg.Client != nil {
|
||||
opts.APIBase, opts.APIKey = cfg.Client.BaseURL, cfg.Client.APIKey
|
||||
|
||||
Vendored
+1
-1
Submodule deps/agent-native updated: 6fd1d441a9...0a52d9f976
Reference in New Issue
Block a user