-
-
Notifications
You must be signed in to change notification settings - Fork 2.5k
Description
BUG REPORT — Agent0AI incorrectly writes tools to wrong directory and loses ability to call tools (gpt-oss-20b / LMStudio)
Title
Agent0AI attempts to write new tools into /a0/tools/ instead of /a0/python/tools/, causing tool loading failures and empty tool_name calls (gpt-oss-20b via LMStudio)
Environment
Summary of the issue
When using Agent0AI with gpt-oss-20b, the agent frequently:
-
Attempts to save newly generated Python tools into an incorrect directory
→/a0/tools/
even though the official tools path is
→/a0/python/tools/ -
This results in missing tools, because the agent then tries to import them from the wrong directory.
-
The model also begins emitting empty
tool_namefields such as:"tool_name": ""which triggers the fallback handler (
unknown.py) and breaks tool invocations entirely. -
After this happens once, the agent enters a state where:
-
it no longer sees tools in
/a0/python/tools/ -
imports fail
-
it repeatedly dumps the “Available tools” list
-
and stops executing the intended tool call.
-
The behaviour appears systematic when using gpt-oss-20b with agent0’s tool-routing layer.
Steps to reproduce
-
Run Agent0AI inside Docker (
/a0/python/tools/contains all default tools). -
Connect LMStudio model:
gpt-oss-20b. -
Ask the agent to create a new Python tool, e.g.:
“Create a tool named internet_check.py that pings 8.8.8.8.”
-
The model generates a correct Python file, but attempts to write it to:
/a0/tools/internet_check.py -
Ask the agent to use the new tool, or list tools.
-
Agent responds with:
Using tool '' Tool not found Available tools: ... <list of real tools in /a0/python/tools/> -
Agent can no longer call ANY real tools.
Expected behavior
-
Agent0AI should always write and load tools from:
/a0/python/tools/ -
Tool calls must always include a valid, non-empty
tool_name. -
Missing tools should not cause the agent to lose visibility of all valid tools.
Actual behavior
-
New tools are written to a non-existent or unofficial directory (
/a0/tools/) -
Tool loader cannot see them
-
Agent begins calling tools with:
"tool_name": "" -
unknown.pygets invoked repeatedly -
Tools become “invisible” even though they exist in the correct path
Observed log snippet
A0: Using tool '' Tool not found. Available tools: a2a_chat browser_agent code_execution_tool ...
Corrected behaviour after manual intervention:
Tool Name: code_execution_tool Runtime: terminal Code: ls -l /a0/python/tools
Severity
High — breaks tool-calling functionality and prevents the agent from functioning as intended.
Agent must be restarted unless behaviour rules are manually patched.
Probable root cause (hypothesis)
-
gpt-oss-20b tends to hallucinate or normalize file paths (“tools”, “python/tools”, “/tools”) differently than other models.
-
The model can generate a tool call block before deciding the tool_name, leaving it empty.
-
Agent0’s tool loader interprets this as “use Unknown tool”, resetting tool context.
-
Misaligned assumptions between LMStudio’s model output and Agent0’s directory layout.
Temporary workaround implemented
I added behaviour rules via behaviour_adjustment:
When invoking any tool, always include a valid 'tool_name'. Never leave it empty or omitted. If the correct tool does not exist, create it first in /a0/python/tools using code_execution_tool. All new tools must be written to /a0/python/tools only. Never write or use /a0/tools.
After this, tool calls behave correctly.
Request to developers
Please consider:
-
Hard-coding the tools directory to
/a0/python/tools/in tool-loader logic
→ reject any tool written to a different directory. -
Adding safety validation:
-
fail early if tool_name is empty
-
validate tool paths on creation
-
-
Adding optional directory locking via config.
-
Documenting recommended prompt patterns for smaller models (20B)
since these seem significantly more prone to directory hallucination and empty tool_name.