The GitHub Actions job "Required Checks" on 
texera.git/gh-readonly-queue/main/pr-9149-26f6487daaec4df625b9f07ad77407a499476977
 has succeeded.
Run started by GitHub user xuang7 (triggered by xuang7).

Head commit for run:
b516b2c65b3293887cafd03d92145b0283bb8328 / Shayn Hornik <[email protected]>
fix(agent-service): keep disabled tools away from the model (#9149)

### What changes were proposed in this PR?

Tools in `settings.disabledTools` were shown as `enabled: false` by
`system-info`, but `sendMessage` still passed every tool to
`generateText`, so the agent could call a disabled tool and it ran.

`sendMessage` now passes only the enabled tools, through a small
`getEnabledTools()` helper. `this.tools` is unchanged, so
`getSystemInfo()` still lists every tool with its `enabled` flag.

### Any related issues, documentation, discussions?

Closes #9122

### How was this PR tested?

Two new tests in `texera-agent.spec.ts`, both using the `ai/test` mock
model:

- With `modifyOperator` disabled, the model call gets only
`deleteOperator` and `addOperator`, and system info still lists
`modifyOperator` as disabled.
- With `deleteOperator` disabled, a model that calls it anyway does not
delete the operator.

Both fail without the change. Locally: `bun test` (312 pass), `tsc
--noEmit` and `prettier --check` are clean.

### Was this PR authored or co-authored using generative AI tooling?

Generated-by: Claude Code (Claude Opus 5.5). I reviewed and tested the
change.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-authored-by: Claude Opus 5.5 <[email protected]>
Co-authored-by: Xuan Gu <[email protected]>

Report URL: https://github.com/apache/texera/actions/runs/43810945976

With regards,
GitHub Actions via GitBox

Reply via email to