config: rename agent autoLoad field to tools
The autoLoad name implied an automatic tool-loading path that no longer exists; tools now come only from agent config plus the /tool_load ctl command. Rename the AgentConfig.AutoLoad field (json autoLoad) to Tools (json tools), rename LoadAutoLoadTools to LoadTools, and update all 14 agent JSON profiles and the tool-not-loaded error message.
This commit is contained in:
parent
eff0880737
commit
9395a0e07b
|
|
@ -33,7 +33,7 @@ type AgentConfig struct {
|
|||
Backend string `json:"backend,omitempty"`
|
||||
Model string `json:"model,omitempty"`
|
||||
|
||||
AutoLoad []string `json:"autoLoad,omitempty"`
|
||||
Tools []string `json:"tools,omitempty"`
|
||||
CompactionModel string `json:"compactionModel,omitempty"`
|
||||
// SystemPrompt overrides the embedded system prompt with a file path.
|
||||
SystemPrompt string `json:"systemPrompt,omitempty"`
|
||||
|
|
|
|||
|
|
@ -12,7 +12,7 @@ import (
|
|||
)
|
||||
|
||||
// These tests lock in the "no tools loaded" compatibility path: an agent with
|
||||
// an empty autoLoadTools set (and no /tool_load) produces an empty tool slice,
|
||||
// an empty tools set (and no /tool_load) produces an empty tool slice,
|
||||
// and every backend must then emit a request with NO "tools" field. This keeps
|
||||
// Ollie compatible with models that do not support tool/function calling — the
|
||||
// answer for such a model is simply to use a tool-free agent.
|
||||
|
|
|
|||
|
|
@ -989,7 +989,7 @@ func buildAgentChildren(a *agent.Agent, s *session.Session) []virtfs.FsNodeDecl
|
|||
// Reload tools for the new profile
|
||||
if ts := a.ToolServer(); ts != nil {
|
||||
ts.ClearTools()
|
||||
session.LoadAutoLoadTools(cfg, ts, s.ID, a.ID(), nil)
|
||||
session.LoadTools(cfg, ts, s.ID, a.ID(), nil)
|
||||
}
|
||||
return []byte(args[0] + "\n"), nil
|
||||
},
|
||||
|
|
|
|||
|
|
@ -416,7 +416,7 @@ func buildAgent(sess *Session, p AgentParams) (*agent.Agent, error) {
|
|||
layers := BuildPromptLayers(cfg, cwd, sessID, p.ID, infra.Platform, infra.IsGitRepo, "")
|
||||
|
||||
// Load tools
|
||||
LoadAutoLoadTools(cfg, infra.ToolsConn, sessID, p.ID, func(f string, a ...any) {
|
||||
LoadTools(cfg, infra.ToolsConn, sessID, p.ID, func(f string, a ...any) {
|
||||
pkgLog.Error("session %s agent %s: "+f, append([]any{sessID, p.ID}, a...)...)
|
||||
})
|
||||
|
||||
|
|
|
|||
|
|
@ -509,7 +509,7 @@ func rebuildAgentRuntime(ag *agent.Agent, sessID string) error {
|
|||
}
|
||||
rt.Backend = be
|
||||
ag.SetRuntime(rt)
|
||||
LoadAutoLoadTools(cfg, ag.ToolServer(), sessID, ag.ID(), func(f string, a ...any) {
|
||||
LoadTools(cfg, ag.ToolServer(), sessID, ag.ID(), func(f string, a ...any) {
|
||||
pkgLog.Error("session %s agent %s: "+f, append([]any{sessID, ag.ID()}, a...)...)
|
||||
})
|
||||
return nil
|
||||
|
|
|
|||
|
|
@ -169,10 +169,10 @@ func BuildPromptLayers(cfg *agent.AgentConfig, cwd, sessID, uname, platform stri
|
|||
}
|
||||
}
|
||||
|
||||
// LoadAutoLoadTools loads all tools from the agent config's autoLoad list.
|
||||
// LoadTools loads all tools from the agent config's tools list.
|
||||
// It first sends the session ID and uname to the tool server so that
|
||||
// ollie-remote can attach its tool registry before processing tool_load RPCs.
|
||||
func LoadAutoLoadTools(cfg *agent.AgentConfig, conn *toolclient.ToolsrvConn, sessID, uname string, logError func(string, ...any)) {
|
||||
func LoadTools(cfg *agent.AgentConfig, conn *toolclient.ToolsrvConn, sessID, uname string, logError func(string, ...any)) {
|
||||
if cfg == nil || conn == nil {
|
||||
return
|
||||
}
|
||||
|
|
@ -186,10 +186,10 @@ func LoadAutoLoadTools(cfg *agent.AgentConfig, conn *toolclient.ToolsrvConn, ses
|
|||
conn.SetAgentID(uname)
|
||||
}
|
||||
|
||||
for _, tl := range cfg.AutoLoad {
|
||||
for _, tl := range cfg.Tools {
|
||||
if err := LoadToolOnConn(conn, tl); err != nil {
|
||||
if logError != nil {
|
||||
logError("autoLoad tool %q: %v", tl, err)
|
||||
logError("load tool %q: %v", tl, err)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -305,7 +305,7 @@ func (st *State) NewProc(ctx context.Context, payload string, background bool) (
|
|||
|
||||
info, ok := reg.Lookup(aid, toolName)
|
||||
if !ok {
|
||||
return "", 0, fmt.Errorf("tool not loaded: %s (add to autoLoad in agent config)", toolName)
|
||||
return "", 0, fmt.Errorf("tool not loaded: %s (add to tools in agent config)", toolName)
|
||||
}
|
||||
|
||||
// Reject shell calls that invoke a native tool.
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@
|
|||
"userPrompts": [
|
||||
"$XDG_CONFIG_HOME/ollie/prompts/user-preferences.md"
|
||||
],
|
||||
"autoLoad": [
|
||||
"tools": [
|
||||
"shell",
|
||||
"client_9p",
|
||||
"memory_wake",
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@
|
|||
"userPrompts": [
|
||||
"$XDG_CONFIG_HOME/ollie/prompts/user-preferences.md"
|
||||
],
|
||||
"autoLoad": [
|
||||
"tools": [
|
||||
"client_9p",
|
||||
"subagent_spawn",
|
||||
"reasoning_think",
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@
|
|||
"userPrompts": [
|
||||
"$XDG_CONFIG_HOME/ollie/prompts/user-preferences.md"
|
||||
],
|
||||
"autoLoad": [
|
||||
"tools": [
|
||||
"memory_wake",
|
||||
"memory_recall",
|
||||
"memory_remember",
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@
|
|||
"userPrompts": [
|
||||
"$XDG_CONFIG_HOME/ollie/prompts/user-preferences.md"
|
||||
],
|
||||
"autoLoad": [
|
||||
"tools": [
|
||||
"shell",
|
||||
"client_9p",
|
||||
"reasoning_think",
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@
|
|||
"userPrompts": [
|
||||
"$XDG_CONFIG_HOME/ollie/prompts/user-preferences.md"
|
||||
],
|
||||
"autoLoad": [
|
||||
"tools": [
|
||||
"shell",
|
||||
"client_9p",
|
||||
"subagent_spawn",
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@
|
|||
"userPrompts": [
|
||||
"$XDG_CONFIG_HOME/ollie/prompts/user-preferences.md"
|
||||
],
|
||||
"autoLoad": [
|
||||
"tools": [
|
||||
"reasoning_think",
|
||||
"memory_wake",
|
||||
"memory_recall",
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@
|
|||
"userPrompts": [
|
||||
"$XDG_CONFIG_HOME/ollie/prompts/user-preferences.md"
|
||||
],
|
||||
"autoLoad": [
|
||||
"tools": [
|
||||
"client_9p",
|
||||
"memory_wake",
|
||||
"memory_recall",
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@
|
|||
"userPrompts": [
|
||||
"$XDG_CONFIG_HOME/ollie/prompts/user-preferences.md"
|
||||
],
|
||||
"autoLoad": [
|
||||
"tools": [
|
||||
"reasoning_think",
|
||||
"memory_wake",
|
||||
"memory_recall",
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@
|
|||
"userPrompts": [
|
||||
"$XDG_CONFIG_HOME/ollie/prompts/user-preferences.md"
|
||||
],
|
||||
"autoLoad": [
|
||||
"tools": [
|
||||
"reasoning_think",
|
||||
"memory_wake",
|
||||
"memory_recall",
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@
|
|||
"prompt": [
|
||||
"$XDG_CONFIG_HOME/ollie/prompts/agent-observer.md"
|
||||
],
|
||||
"autoLoad": [
|
||||
"tools": [
|
||||
"memory_wake",
|
||||
"memory_recall",
|
||||
"memory_remember",
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@
|
|||
"userPrompts": [
|
||||
"$XDG_CONFIG_HOME/ollie/prompts/user-preferences.md"
|
||||
],
|
||||
"autoLoad": [
|
||||
"tools": [
|
||||
"client_9p",
|
||||
"memory_wake",
|
||||
"memory_recall",
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@
|
|||
"userPrompts": [
|
||||
"$XDG_CONFIG_HOME/ollie/prompts/user-preferences.md"
|
||||
],
|
||||
"autoLoad": [
|
||||
"tools": [
|
||||
"client_9p",
|
||||
"memory_wake",
|
||||
"memory_recall",
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@
|
|||
"userPrompts": [
|
||||
"$XDG_CONFIG_HOME/ollie/prompts/user-preferences.md"
|
||||
],
|
||||
"autoLoad": [
|
||||
"tools": [
|
||||
"client_9p",
|
||||
"reasoning_think",
|
||||
"memory_wake",
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@
|
|||
"userPrompts": [
|
||||
"$XDG_CONFIG_HOME/ollie/prompts/user-preferences.md"
|
||||
],
|
||||
"autoLoad": [
|
||||
"tools": [
|
||||
"reasoning_think",
|
||||
"memory_wake",
|
||||
"memory_recall",
|
||||
|
|
|
|||
Loading…
Reference in New Issue