yrenat opened a new issue, #9122:
URL: https://github.com/apache/texera/issues/9122

   ### What happened?
   
   If a tool is in `settings.disabledTools`, the agent can still call it, and 
the call still runs.
   
   `updateSettings` saves `disabledTools`, and `GET 
/api/agents/:id/system-info` shows that tool as `enabled: false`. But 
`sendMessage` gives the model all tools:
   
   ```ts
   const result = await generateText({
     ...
     tools: this.tools,
   ```
   
   `createTools()` never checks `disabledTools`, so a disabled tool is still 
given to the model.
   
   Example on `main` with claude-haiku-4.5. The agent was created with 
`{"settings": {"maxSteps": 5, "disabledTools": ["executeOperator"]}}`. 
`system-info` showed:
   
   ```json
   
[{"name":"deleteOperator","enabled":true},{"name":"addOperator","enabled":true},
    
{"name":"modifyOperator","enabled":true},{"name":"executeOperator","enabled":false}]
   ```
   
   Prompt: "Add a CSV File Scan operator that reads the file data.csv, then 
call the executeOperator tool on it to run it." The agent called `addOperator`, 
then `executeOperator({"operatorId":"op1"})`, and the workflow really ran on 
the backend (it failed with `FileNotFoundException`, because the file does not 
exist).
   
   Expected: tools in `disabledTools` should not be passed to `generateText`, 
or should be rejected when called.
   
   **Screenshots**
   
   Step 2, tool call: the agent calls `executeOperator` and it runs, even 
though system-info says `enabled: false`.
   
   
![B-step2-toolcall.png](https://raw.githubusercontent.com/yrenat/texera/agent-bug-screenshots/B-step2-toolcall.png)
   
   The chat and canvas: the agent added a CSV File Scan, ran it, and reported 
the error.
   
   
![B-workspace.png](https://raw.githubusercontent.com/yrenat/texera/agent-bug-screenshots/B-workspace.png)
   
   ### How to reproduce?
   
   1. Create an agent with `POST /api/agents` and `"settings": 
{"disabledTools": ["executeOperator"]}`. (The panel has no switch for this, so 
use the API.)
   2. `GET /api/agents/<id>/system-info` shows `executeOperator` with `enabled: 
false`.
   3. In the agent panel, send: `Add a CSV File Scan operator that reads the 
file data.csv, then call the executeOperator tool on it to run it.`
   4. Step 2's details show an `executeOperator` call and its result.
   
   ### Version/Branch
   
   1.4.0-incubating-SNAPSHOT (main)
   
   ### Commit Hash (Optional)
   
   57faa6b
   
   ### What browsers are you seeing the problem on?
   
   Chrome
   
   ### Relevant log output
   
   ```shell
   agent-service/src/agent/texera-agent.ts  sendMessage: generateText({ tools: 
this.tools }); createTools() does not check settings.disabledTools
   ```


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to