Skip to content

fix(agent-service): keep disabled tools away from the model - #9149

Open
shaynhornik wants to merge 1 commit into
apache:mainfrom
shaynhornik:fix/agent-disabled-tools
Open

shaynhornik wants to merge 1 commit into
apache:mainfrom
shaynhornik:fix/agent-disabled-tools

Conversation

@shaynhornik

Copy link
Copy Markdown

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

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>
@Yicong-Huang Yicong-Huang added release/v1.3 back porting to release/v1.3 release/v1.2 back porting to release/v1.2 labels Oct 26, 2026
@github-actions
github-actions Bot requested review from mengw15 and xuang7 October 26, 2026 13:09
@github-actions

Copy link
Copy Markdown
Contributor

Backport auto-label report

This fix: PR was checked against each actively-supported release branch. A release/* label nominates a backport target; the branch's release manager approving this PR is what sends the fix there. The required Backport Approvals check stays red until every label below is approved, so each manager either approves or removes their own label — which is why the labels left on a merged PR are exactly the branches it reached.

Release branch Analysis
✅ release/v1.3 Change detected on this branch — label added; this fix is queued to backport here. @mengw15 decides: approving sends the fix here, removing this label declines it. The merge waits on one or the other. Review requested.
✅ release/v1.2 Change detected on this branch — label added; this fix is queued to backport here. @xuang7 decides: approving sends the fix here, removing this label declines it. The merge waits on one or the other. Review requested.

Auto-label run.

@github-actions

Copy link
Copy Markdown
Contributor

Automated Reviewer Suggestions

Based on the git blame history of the changed files, we recommend the following reviewers:

  • Contributors with relevant context: @roshiiiz
    You can notify them by mentioning @roshiiiz in a comment.

@github-actions

Copy link
Copy Markdown
Contributor

👋 Thanks for your first contribution to Texera, @shaynhornik!

If you're looking for a good place to start, browse issues labeled starter-task; they're scoped to be approachable for newcomers.

You can drive common housekeeping yourself by commenting one of these commands on its own line:

  • Issues. Comment /take to assign an open issue to yourself, or /untake to release it. You can find unclaimed work with the search filter is:issue is:open no:assignee.
  • Sub-issues. To link issues into a parent/child hierarchy, comment /sub-issue #5166 #5222 on the parent to attach those children (or /unsub-issue #5166 #5222 to detach them). From a child issue, comment /parent-issue #5166 to set its parent, or /unparent-issue to clear it (the current parent is detected automatically). References may be written as #5166 or as a bare 5166; cross-repository references are not supported.
  • Pull requests (author only). Comment /request-review @user to request a review from someone, or /unrequest-review @user to withdraw that request.

Each command must match exactly: /take this will not work, only /take does. For the full contribution flow, see CONTRIBUTING.md.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agent-service fix release/v1.2 back porting to release/v1.2 release/v1.3 back porting to release/v1.3

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Disabled tools can still be called by the agent

2 participants