Repository navigation
Rework common.ai Strands support into a plugin and add Google ADK - #73898
Merged
Merged
Conversation
kaxil
added this pull request to stack #73905
September 29, 2026 12:49
kaxil
marked this pull request as ready for review
September 29, 2026 13:17
kaxil
force-pushed
the
commonai-native-frameworks
branch
from
September 29, 2026 14:03
2ad375c to
a291ac4
Compare
vatsrahul1001
approved these changes
Sep 29, 2026
The Strands adapter from #73587 built plain function tools, and Strands hands any exception such a tool raises back to the model, so a tool that kept raising ModelRetry looped without end. AirflowTools is now a Strands plugin whose AfterToolCallEvent hook re-raises ToolCallError out of the run, and failures the model can correct are bounded by the tool's max_retries: counted once per tool per model turn and afresh on every run, as pydantic-ai counts them. Tools a toolset marks sequential, such as the sandbox's, run one at a time in the order the model called them. AirflowTools in tools.adk gives an ADK agent the same tools. airflow_tools() moves to the shared toolset base, collect_tools() flattens what an adapter is given and refuses duplicate tool names, and the LangChain bridge runs on the same interface. SandboxToolset can own its sandbox from synchronous code with a with block, and MCPToolset refuses the native path, since an MCP session belongs to the Pydantic AI run that opens it.
kaxil
force-pushed
the
commonai-native-frameworks
branch
from
September 30, 2026 06:01
a291ac4 to
2d96878
Compare
1 task done
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.
Follow-up to #73587, which added Strands support through
as_strands_tools(). A tool that kept raisingModelRetry, or kept failing argument validation, came back to the model as an error result every time, so a Strands agent could loop without end. Raising from the tool does not help: Strands catches any exception a function tool raises and hands it to the model as another error.as_strands_tools()has not been released yet, so this replaces it rather than deprecating it.AirflowToolsis now a Strands plugin. ItsAfterToolCallEventhook re-raisesToolCallError, which Strands raises out of the run asEventLoopException, so a failure the model cannot fix fails the task and Airflow's retry takes over.max_retries, counted as Pydantic AI counts them: once per tool per model turn, so calls a framework runs concurrently in one turn count once.AirflowToolsintools.adkis an ADK toolset. A result reaches the model as{"result": ...}, a failure it can correct as{"error": ...}, and any other failure raisesToolCallErrorout of the run.airflow_tools()moves to the shared toolset base, andcollect_tools()turns the toolsets and tools an adapter is given into one list.ToolMessagewithstatus="error", and a tool that keeps failing raisesToolCallError.SandboxToolsetcan own its sandbox from synchronous code with awithblock, which a task running a native agent needs. A tool call outside the block is refused instead of provisioning a sandbox nothing would destroy. Attaching to another task's sandbox works from both forms.MCPToolset.airflow_tools()raises: an MCP session belongs to the Pydantic AI run that opens it, so a native agent should use its framework's own MCP client.Why one neutral interface under both adapters? Strands, ADK and the LangChain bridge now share one conversion, one error model and one retry budget, so an adapter for another framework is a thin mapping rather than a copy of those rules.
Why the Strands and ADK tests skip in CI. Strands pins
mcpbelow 2.2 and ADK pins OpenTelemetry at 1.42.1 or lower, both below the versions in Airflow's development environment, so neither framework can be installed there. Both integrations are marked experimental, and the docs list the versions they are tested with (Strands 1.56.0, ADK 2.9.1).An end-to-end Dag that runs every toolset through
AgentOperator, a Pydantic AI agent, Strands, ADK and LangChain passes with a real Claude model and a Modal sandbox.The end-to-end run, and the Strands routes from it:
{pr_number}.significant.rst, in airflow-core/newsfragments. You can add this file in a follow-up commit after the PR is created so you know the PR number.