tool_load: add dynamic tool loader with bash script

Add a tool_load tool that writes a tool name to the session's 9P
tools file via ollie-9p, enabling on-demand tool loading.

Reduce autoLoad lists in default.json and theo.json to bare
essentials — everything else is loaded via tool_load.
This commit is contained in:
Ollie Agent 2026-08-03 00:15:36 +02:00
parent 0a418c20f4
commit 7beef106e0
4 changed files with 42 additions and 39 deletions

View File

@ -6,33 +6,11 @@
],
"autoLoad": [
"file_read",
"file_write",
"file_edit",
"file_glob",
"file_grep",
"memory_recall",
"memory_remember",
"lsp_definition",
"lsp_diagnostics",
"lsp_hover",
"lsp_references",
"lsp_symbols",
"gui_screenshot",
"gui_windows",
"gui_clipboard",
"gui_notify",
"image_read",
"skill_list",
"skill_load",
"subagent_generate",
"process_list",
"process_output",
"process_signal",
"process_dismiss",
"logseq",
"system_logs",
"browser_screencap",
"route"
"file_write",
"tool_load"
],
"maxSteps": 50,
"temperature": 0.5,

View File

@ -7,24 +7,11 @@
"shell",
"reasoning_think",
"file_read",
"file_edit",
"file_glob",
"file_grep",
"file_write",
"file_edit",
"gui_screenshot",
"gui_windows",
"gui_clipboard",
"gui_notify",
"image_read",
"memory_recall",
"memory_remember",
"lsp_definition",
"lsp_diagnostics",
"lsp_hover",
"lsp_references",
"lsp_symbols",
"skill_list",
"skill_load"
"tool_load"
],
"maxSteps": 30,
"temperature": 0.3,

20
data/tools/tool_load Normal file
View File

@ -0,0 +1,20 @@
#!/bin/bash
# args_json: {"type":"object","required":["name"],"properties":{"name":{"type":"string","description":"Tool name to load into the current session/agent"}}}
# ollie:prompt
# ## tool_load
#
# Load a tool into the current session/agent by writing its name to
# `session/{sid}/agent/{aid}/tools` via ollie-9p.
#
# **Args**: `name` (required) — the tool name to load.
#
# ```
# tool_load(name="file_read")
# ```
# ollie:end
set -euo pipefail
name=$(grep -oP '"name"\s*:\s*"\K[^"]+')
echo "$name" | ollie-9p write "session/$OLLIE_SESSION_ID/agent/$OLLIE_UNAME/tools"
echo "loaded: $name"

18
data/tools/tool_load.meta Normal file
View File

@ -0,0 +1,18 @@
{
"description": "Load a tool into the current session/agent via ollie-9p.",
"prompt": "## tool_load\n\nLoad a tool into the current session/agent by writing its name to\n`session/{sid}/agent/{aid}/tools` via ollie-9p.\n\n**Args**: `name` (required) — the tool name to load.\n\n```\ntool_load(name=\"file_read\")\n```",
"args": {
"type": "object",
"required": [
"name"
],
"properties": {
"name": {
"type": "string",
"description": "Tool name to load into the current session/agent"
}
}
},
"tier": "hot",
"readOnly": false
}