Skip to content

Move the AI integration samples to the GA packages - #429

Open
campoy wants to merge 11 commits into
mainfrom
ga-wave/ai-integrations-ga
Open

campoy wants to merge 11 commits into
mainfrom
ga-wave/ai-integrations-ga

Conversation

@campoy

@campoy campoy commented Nov 23, 2026 •

Copy link
Copy Markdown

What was changed

Moves the AI integration samples to the GA packages released on November 17 and 18:

Package Was Now
temporalio-openai-agents 1.0.0 2.0.0
temporalio-google-adk 0.0.1 1.0.0
temporalio-google-genai 0.1.0 1.0.0
temporalio-langgraph 0.1.0 1.0.0
temporalio-langsmith 0.1.1 1.0.0
temporalio-strands-agents 0.1.0 1.0.0 (also in bedrock_agentcore/strands_agent)
temporalio-deepagents 0.0.1 0.1.0

The bump alone breaks some samples, so this also fixes them:

  • OpenAI Agents sandbox: registers the Unix-local sandbox with OnHostSandboxClientProvider and a unique name per Worker process. On 2.0.0, SandboxClientProvider raises ValueError at startup for local backends. A 30-second schedule-to-start timeout bounds the wait for a lost Worker; a Worker that receives an operation for a missing sandbox raises SandboxLost.
  • Model providers: disables tracing with OPENAI_AGENTS_DISABLE_TRACING=1 in all four Workers, including the provider installed by the plugin. The LiteLLM Worker passes LiteLLM through the Workflow sandbox. Also drops "tools must be async". On 2.0.0, function tools run inline in the Workflow, sync or async. Model calls default to a 60-second timeout, so the custom-provider comment says to raise it for slow models instead of saying you must set one.
  • Google ADK: adds the plugin to the Client only. Passing it to the Worker too registers its Activities twice, and Worker(...) raises More than one activity named invoke_model.
  • Strands MCP: the factory returns mcp.Client, and the group installs temporalio-strands-agents[mcp] and mcp>=2. The AgentCore sample uses a new deployment Build ID for the incompatible plugin change.
  • Deep Agents: activity_as_tool takes activity_options, and tool_as_activity runs at module level in a tools.py imported under imports_passed_through(), including the external-storage sample. Called inside run, a fresh Worker fails the tool Activity. The continue-as-new sample adds TodoListMiddleware, because without it the run never continues as new.

The resolver moved some upstream packages too, and a few of those needed changes:

  • MCP SDK 2 (needed by the Strands mcp extra) removed mcp.server.fastmcp, so the five echo, tools and prompt servers now use MCPServer from mcp.server.mcpserver.
  • openai 3 (needed by temporalio-openai-agents 2.0.0) uses httpx2, so the openrouter group moves to openai>=3,<4 and its test mocks httpx2.
  • Langfuse explicitly installs httpx, which its OpenTelemetry instrumentor imports.
  • LiteLLM logging needs sandbox passthrough wherever its process-wide logging filter runs, including the shared test Clients and Worker entry-point tests.
  • Redis tests reset the connection pool after closing the fixture client, so its finalizer cannot import during another test's Worker startup.
  • google-adk 2.14 records token usage with counters, so the ADK metrics test counts those too.
  • external-storage can't share an environment with openai-agents or litellm anymore. openai 3 needs a litellm that needs boto3 1.43 or later, and aioboto3 15.5.0 pins aiobotocore==2.25.1, which needs a boto3 older than 1.40.62. So pyproject.toml declares a uv conflicts entry, poe test and poe lint-types skip that group, a new poe test-external-storage step runs its test in CI, and a separate mypy pass checks that environment. uv sync --group external-storage, as its README says, still works.

Why?

docs.temporal.io copies its integration snippets from these samples, and every integration page sends readers here. Today they run code from before the breaking changes, and a few snippets raise at startup on the new versions.

Checklist

  1. Closes: no issue.

  2. How was this tested:

    • poe test: 250 passed, 2 skipped. poe test-external-storage: 2 passed. poe lint: ruff passes, and mypy finds no issues in 961 files, plus 14 in the external-storage environment.
    • bedrock_agentcore/strands_agent: poe lint and poe test pass (1 test), and its Worker starts.
    • Against temporal server start-dev, each of these Workers started and ran for 12 seconds without raising: the sandbox Worker, the Strands MCP Worker, all 6 ADK Workers and the 3 Deep Agents Workers. On main, the ADK basic Worker and the sandbox Worker raise the two errors above.
    • Continue-as-new, with a scripted model that leaves a pending todo and continue_as_new_after=1: without the middleware, the first run ends COMPLETED; with it, CONTINUED_AS_NEW.
    • Final Docker checks: Python 3.13 has 250 passed and 2 skipped; time-skipping mode has 195 passed and 57 skipped. Python 3.11.9 has 249 passed and 3 skipped. The final Python 3.13 full-suite log has no RestrictedWorkflowAccessError entries.
    • Both Langfuse instrumentation modes start in a clean environment containing only that group. Fresh GA tracing providers remain disabled after all four model-provider entry points, with a dummy OpenAI key set.
    • A no-model-call sandbox check verifies ownership with two Workers on one host and a schedule-to-start timeout after losing the owner.
    • Not run: anything that needs real model keys.
  3. Any docs updates needed? Yes. temporalio/documentation#5813 updates the adjacent prose and refreshes the ADK, local sandbox, Strands MCP, and Deep Agents snippets. It stays draft until this PR merges. The seven sample README prerequisites now say Temporal Python SDK 1.36.0 or later.

Not changed here: openai_agents/mcp_v2 (still on temporalio-openai-agents 1.0.0) and arize_tracing (on 1.1.0) have their own locks. The comments saying other groups still pin MCP v1 are now out of date.

Bump temporalio-openai-agents to 2.0.0, temporalio-google-adk,
temporalio-google-genai, temporalio-langgraph, temporalio-langsmith and
temporalio-strands-agents to 1.0.0, and temporalio-deepagents to 0.1.0.
The strands-agents group now installs the mcp extra and MCP SDK 2.

temporalio-openai-agents 2.0.0 needs openai 3. Every litellm release
that accepts openai 3 needs boto3 1.43 or later, and aioboto3 15.5 needs
boto3 older than 1.40.62. So the external-storage group can't share an
environment with the litellm and openai-agents groups anymore. Declare
that conflict, leave external-storage out of `poe test` and `poe lint`,
and run its test in its own `poe test-external-storage` step in CI.

openai 3 uses httpx2, so the OpenRouter group now needs openai 3 and its
activity test mocks with httpx2. Newer google-adk also records token
counters, which the metrics test now counts too.
MCP SDK 2 renames FastMCP to MCPServer and drops mcp.server.fastmcp.
The shared environment now has MCP SDK 2, which the Strands MCP tools need.
temporalio-openai-agents 2.0.0's SandboxClientProvider refuses the
Docker and Unix-local backends and raises ValueError at startup.
OnHostSandboxClientProvider sends every operation on a sandbox to the
Worker that created it. A restart in the middle of a step loses a local
sandbox, so the README and docstring no longer say it resumes.
Sync function tools work in Workflows in 2.0.0: they run inline, so
they must be fast and deterministic. Model Activities also get a
60-second start-to-close timeout by default, so a custom provider no
longer has to set one.
In temporalio-strands-agents 1.0.0, mcp_clients factories return an
mcp.Client, and a Strands MCPClient fails the Activity without retries.
Tools are listed in an Activity before each model call, not once at
Worker startup, so the docs in the sample say that now.
temporalio-deepagents 0.1.0's activity_as_tool takes activity_options
instead of start_to_close_timeout, so the react agent sample raised
TypeError. Also call tool_as_activity in a tools module imported under
imports_passed_through(): called inside run, the tool is registered only
once a run gets there, and a fresh Worker fails the tool Activity with
DeepAgentsUnknownTool.
run_deep_agent continues as new only while the turn has pending todos,
and create_deep_agent doesn't add the middleware that records them.
Without it, the sample returned after every turn. The snapshot carries
messages and state files, not a result cache, so the docs say that.
A Worker runs its Client's plugins, so passing the plugin to both
registered its Activities twice and Worker(...) raised
"ValueError: More than one activity named invoke_model".
@campoy
campoy requested review from a team as code owners November 23, 2026 18:20
@campoy
campoy requested a review from DABH November 23, 2026 20:19

@DABH DABH left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Thanks for doing this! The bumps and the fixes for the breaking changes look right to me, and the claims I checked against the GA packages hold up. I left questions inline, mostly on runtime and docs paths that CI doesn't exercise. Outside the diff, seven READMEs still say these packages need Temporal 1.34.0, but the GA releases need 1.36.0.

Comment thread pyproject.toml Resolved
Comment thread pyproject.toml Resolved
Comment thread openai_agents/sandbox/run_worker.py Resolved
Comment thread openai_agents/sandbox/README.md Resolved
Comment thread deepagents_plugin/react_agent/tools.py Resolved
Comment thread pyproject.toml Resolved
Comment thread pyproject.toml Resolved
Comment thread google_adk_agents/basic/run_worker.py Resolved

@DABH DABH left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Few more comments on this one -thanks...

Comment thread tests/conftest.py

@pytest_asyncio.fixture(scope="session")
async def env(request) -> AsyncGenerator[WorkflowEnvironment, None]:
# LiteLLM's asyncio logging filter runs on workflow threads even in tests

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Should litellm_activity/worker.py pass litellm through too? Its Worker imports litellm, and a probe workflow with the same imports fails its task with RestrictedWorkflowAccessError once it logs on asyncio. Since this plugin passes litellm through for every test, tests/litellm_activity won't catch that.

Comment thread pyproject.toml
"strands-agents>=1.39.0",
"strands-agents-tools>=0.5.2",
"mcp>=1.0.0",
"mcp>=2",

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

With the root lock now on mcp 2.3.0, is the comment on the microsoft-agent-framework group still right? It says other groups pin MCP v1, and both microsoft_agent_framework_plugin READMEs give the same reason for the separate mcp project.

--deployment-name <TEMPORAL_DEPLOYMENT_NAME>
```

Use a new Build ID for changes that cannot replay existing histories. Keep the previous Worker Deployment Version

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

How would someone keep 1.0.0 available with this setup? The sample has one runtime with one temporal endpoint, and step 3 says to re-run create-runtime.sh to roll out changes. Could this say what to deploy for the new Build ID?

Comment on lines +16 to +21
def book_trip(city: str) -> str:
"""Book a trip to a city (requires human approval)."""
return f"Booked a trip to {city}."


trip_tool = tool_as_activity(book_trip, start_to_close_timeout=timedelta(seconds=30))

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Could this get a SNIPSTART block like react_agent/tools.py? With the docs follow-up, the HITL page imports trip_tool but never shows book_trip or its wrapper, and interrupt_on names book_trip.

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.

2 participants