Skip to content

Conversation

@majiayu000
Copy link
Contributor

Fixes #1714

Changes

  • Modified filterToolsByName to return all tools matching the name instead of just the first one
  • This allows proper feature flag filtering when multiple tools share the same name but are controlled by different feature flags (e.g., GetJobLogs and ActionsGetJobLogs both use name "get_job_logs")
  • Added test TestForMCPRequest_ToolsCall_FeatureFlaggedVariants to cover this scenario

…ltering

When multiple tools share the same name but have different feature flags
(like GetJobLogs and ActionsGetJobLogs both named "get_job_logs"),
filterToolsByName was only returning the first match. This caused the
remote server to fail with "unknown tool" error when the first matching
tool was disabled by feature flags, even though another variant was enabled.

The fix modifies filterToolsByName to return ALL tools with matching names,
allowing the feature flag filtering in AvailableTools to select the correct
variant based on the enabled flags.

Fixes github#1714

Signed-off-by: majiayu000 <1835304752@qq.com>
@majiayu000 majiayu000 requested a review from a team as a code owner January 2, 2026 00:02
Copy link
Collaborator

@SamMorrowDrums SamMorrowDrums left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you, this is an excellent contribution. I'll check with @tommaso-moro to ensure it behaves as anticipated, but I'm pretty certain it does. It does seem clearly just a bug with a function that wasn't designed to accommodate feature flag changes.

@SamMorrowDrums SamMorrowDrums merged commit 116c574 into github:main Jan 5, 2026
11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

get_job_logs fails

2 participants