Repository navigation
fix(agent-service): keep disabled tools away from the model - #9149
shaynhornik wants to merge 1 commit into
Conversation
Tools listed in settings.disabledTools were reported as disabled by system-info but were still passed to generateText, so the agent could call and run them. sendMessage now passes only the enabled tools; system info still lists every tool with its enabled flag. Closes apache#9122 Generated-by: Claude Code (Claude Opus 5.5) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Backport auto-label reportThis
|
Automated Reviewer SuggestionsBased on the
|
|
👋 Thanks for your first contribution to Texera, @shaynhornik! If you're looking for a good place to start, browse issues labeled You can drive common housekeeping yourself by commenting one of these commands on its own line:
Each command must match exactly: |
What changes were proposed in this PR?
Tools in
settings.disabledToolswere shown asenabled: falsebysystem-info, butsendMessagestill passed every tool togenerateText, so the agent could call a disabled tool and it ran.sendMessagenow passes only the enabled tools, through a smallgetEnabledTools()helper.this.toolsis unchanged, sogetSystemInfo()still lists every tool with itsenabledflag.Any related issues, documentation, discussions?
Closes #9122
How was this PR tested?
Two new tests in
texera-agent.spec.ts, both using theai/testmock model:modifyOperatordisabled, the model call gets onlydeleteOperatorandaddOperator, and system info still listsmodifyOperatoras disabled.deleteOperatordisabled, a model that calls it anyway does not delete the operator.Both fail without the change. Locally:
bun test(312 pass),tsc --noEmitandprettier --checkare 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