fix(skills): isolate per-toolset failures in SkillToolset additional-tools resolution#6203
Open
hawktang wants to merge 1 commit into
Open
fix(skills): isolate per-toolset failures in SkillToolset additional-tools resolution#6203hawktang wants to merge 1 commit into
hawktang wants to merge 1 commit into
Conversation
|
Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA). View this failed invocation of the CLA check for more information. For the most up to date status, view the checks section at the bottom of the pull request. |
SkillToolset._resolve_additional_tools_from_state gathered get_tools_with_prefix() from every provided toolset in a single asyncio.gather() with no error isolation. One toolset that raises while listing its tools -- e.g. an McpToolset whose remote MCP server is restarting or returns 503 -- aborted the whole gather, so no skill-gated additional tools resolved, including unrelated individual function tools that needed zero I/O. Use return_exceptions=True and skip (with a warning) any toolset that fails, re-raising CancelledError so cooperative cancellation is preserved. A failing toolset now contributes no tools and recovers on the next invocation. Adds a regression test: a failing toolset in the additional_tools pool no longer prevents the healthy tools and core skill tools from resolving. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
606f312 to
f506006
Compare
Collaborator
|
Response from ADK Triaging Agent Hello @hawktang, thank you for creating this PR! It looks like there are a couple of things missing based on our contribution guidelines:
Once these are addressed, we will triage and label your PR. Thank you! |
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.
Summary
SkillToolset._resolve_additional_tools_from_stateresolves a skill's declaredadk_additional_toolsby gatheringget_tools_with_prefix()from every provided toolset in a singleasyncio.gather(...)with no per-toolset error isolation:If any one toolset raises while listing its tools — most commonly an
McpToolsetwhose remote MCP server is restarting / unreachable / returns 503 — the entiregatherpropagates and no additional tools resolve for the activated skill, including unrelated individual function tools that were already available with zero I/O.In practice, a single optional remote MCP being briefly down breaks every skill that declares
adk_additional_tools— surfacing as an internal error even for skills that never reference the failing MCP.Fix
return_exceptions=Trueto the gather, then skip (with alogger.warning) any toolset whose listing failed.asyncio.CancelledErrorso cooperative cancellation is not swallowed.A failing/unreachable toolset now contributes no tools and recovers automatically on the next invocation (tool listing is cached per
invocation_id).Test
Adds
test_skill_toolset_resolution_isolates_failing_toolset: a toolset whoseget_tools_with_prefixraises is placed in theadditional_toolspool alongside a healthy tool. After activating a skill, the healthy tool and core skill tools still resolve, the failing toolset contributes nothing, and a warning is logged. Verified red before the change, green after.Notes
main._MCP_GRACEFUL_ERROR_HANDLINGguards the MCP session layer, but not this aggregation layer, so the failure still propagated.adk_additional_tools? Happy to adjust.🤖 Generated with Claude Code