fix: critical tool registration bug - ChatPanel.setAgent() was overwriting all tools
Some checks are pending
CI / build-check-test (push) Waiting to run
Some checks are pending
CI / build-check-test (push) Waiting to run
ROOT CAUSE: agent.setTools() registered 8 tools (bash, browser, web-search, image-gen, tts, memory, repl), then chatPanel.setAgent(agent) with no config called this.agent.setTools([artifactsTool]) internally, OVERWRITING all tools. FIX: Pass tools via toolsFactory config parameter so ChatPanel merges them with its own artifacts tool instead of replacing them. This fixes all 'Tool X not found' errors in the web UI.
This commit is contained in:
parent
11af96265a
commit
6c0037f8a1
1 changed files with 12 additions and 11 deletions
|
|
@ -406,9 +406,11 @@ Persist information across sessions. Use to save important context, user prefere
|
||||||
renderApp();
|
renderApp();
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
// Register tools with the agent
|
// Register tools via toolsFactory so ChatPanel includes them alongside its artifacts tool
|
||||||
const replTool = createJavaScriptReplTool();
|
const replTool = createJavaScriptReplTool();
|
||||||
agent.setTools([
|
costTracker.bindAgent(agent);
|
||||||
|
chatPanel?.setAgent(agent, {
|
||||||
|
toolsFactory: () => [
|
||||||
replTool,
|
replTool,
|
||||||
createWebSearchTool(),
|
createWebSearchTool(),
|
||||||
createBashTool(),
|
createBashTool(),
|
||||||
|
|
@ -416,9 +418,8 @@ Persist information across sessions. Use to save important context, user prefere
|
||||||
createImageGenTool(),
|
createImageGenTool(),
|
||||||
createTTSTool(),
|
createTTSTool(),
|
||||||
...createMemoryTools(),
|
...createMemoryTools(),
|
||||||
]);
|
],
|
||||||
costTracker.bindAgent(agent);
|
});
|
||||||
chatPanel?.setAgent(agent);
|
|
||||||
// Hook: live model badge + immediate empty state hide
|
// Hook: live model badge + immediate empty state hide
|
||||||
requestAnimationFrame(() => {
|
requestAnimationFrame(() => {
|
||||||
if (chatPanel?.agentInterface) {
|
if (chatPanel?.agentInterface) {
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue