Repository navigation
fix(agent-service): keep disabled tools away from the model - #9149
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 <[email protected]>
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: |
|
Looks good to me! |
|
@xuang7 do we still want to backport to v1.2 ? |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #9149 +/- ##
============================================
- Coverage 91.60% 91.60% -0.01%
Complexity 5037 5037
============================================
Files 1283 1283
Lines 57004 56997 -7
Branches 7419 7417 -2
============================================
- Hits 52221 52214 -7
Misses 2914 2914
Partials 1869 1869
*This pull request uses carry forward flags. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
|
Removing release/v1.2. The fix applies there, but nothing on that branch sets disabledTools: the frontend has no control for it and only ever sends an empty list, so the setting is reachable only through the settings REST API. Keeping it on main. |
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