fix: initialize tools list when None before extending with MCP/platform tools#4645
Open
giulio-leone wants to merge 5 commits intocrewAIInc:mainfrom
Open
fix: initialize tools list when None before extending with MCP/platform tools#4645giulio-leone wants to merge 5 commits intocrewAIInc:mainfrom
giulio-leone wants to merge 5 commits intocrewAIInc:mainfrom
Conversation
143ee17 to
f8174e6
Compare
Author
|
Friendly ping — CI is green and this is ready for review. Happy to address any feedback. Thanks! |
f8174e6 to
0d1fe00
Compare
|
You have run out of free Bugbot PR reviews for this billing cycle. This will reset on March 28. To receive reviews on all of your PRs, visit the Cursor dashboard to activate Pro and start your 14-day free trial. |
There was a problem hiding this comment.
Pull request overview
Fixes a kickoff-time tool initialization bug in Agent._prepare_kickoff where platform/MCP tools were not loaded if self.tools started as None, leaving the agent with no tools.
Changes:
- Initialize
self.toolsto an empty list when needed before extending with platform tools. - Initialize
self.toolsto an empty list when needed before extending with MCP tools.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
…rm tools When an Agent is created with mcps but without explicit tools, self.tools is None. The condition 'mcps and self.tools is not None' silently skips MCP tool loading, so the agent runs with no tools at all. Initialize self.tools to [] before extending when it is None. Applied to both platform_tools and MCP tools branches. Fixes crewAIInc#4568
Initialize self.tools once before processing apps and mcps, instead of checking in each block. Added regression test for the specific bug scenario (tools=None with apps + mcps).
Initialize self.tools once before processing both platform and MCP tools, removing duplicate None checks. Add regression test verifying tools=None condition with MCP tools. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
459bc18 to
ee8f6bc
Compare
Rewrote test_tools_none_with_apps_and_mcps to call the actual _prepare_kickoff method instead of reimplementing the guard logic inline. This ensures the test catches any future divergence in the real code path. Refs: crewAIInc#4568
Author
|
No worries — this is just an automated summary, no action needed. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
When an Agent is created with
mcpsbut without explicittools,self.toolsisNone. The condition at line 1163:silently skips MCP tool loading because
self.tools is not Noneevaluates toFalse. The agent runs with no tools.The same issue exists for
platform_toolsat line 1159.Fix
Initialize
self.toolsto[]before calling.extend()when it isNone.Fixes #4568
Note
Low Risk
Low risk bug fix that only changes how
Agent._prepare_kickoffappends platform/MCP tools whenself.toolsis unset; minimal behavioral impact beyond correctly enabling tool loading.Overview
Fixes standalone
Agentkickoff tool initialization so platform app tools and MCP tools are still added whenself.toolsstarts asNone._prepare_kickoffnow initializesself.toolsto an empty list before calling.extend()for platform/MCP tool lists, preventing those integrations from being silently skipped.Written by Cursor Bugbot for commit f8174e6. This will update automatically on new commits. Configure here.