Skip to content

[pull] main from temporalio:main - #2

Open
pull[bot] wants to merge 105 commits into
yashvanzara:mainfrom
temporalio:main
Open

[pull] main from temporalio:main#2
pull[bot] wants to merge 105 commits into
yashvanzara:mainfrom
temporalio:main

Conversation

@pull

@pull pull Bot commented Apr 2, 2025

Copy link
Copy Markdown

See Commits and Changes for more details.


Created by pull[bot] (v2.0.0-alpha.1)

Can you help keep this open source service alive? 💖 Please sponsor : )

@pull pull Bot added the ⤵️ pull label Apr 2, 2025
nagl-temporal and others added 28 commits April 16, 2025 08:11
* Add a sample resource locking workflow

* Fix a code snippet in README.md

* Clean up imports, exercise continue_as_new behavior

* Rename the workflows for clarity, improve README

* Remove spurious logging comment

* poe format

* poe lint

* Borrow the random signal name trick from other samples

* Simplify allocation algorithm

* Add 'async with' syntactic sugar

* Update readme

* poe lint/fmt

* Add a test

* method rename

* renames

* type hints for all returns

* handle substantive PR feedback

* clean up imports

* PR feedback (no move yet)

* Move the resource pool client

* Handle assignment signal failures

* format/lint

* PR feedback (move resource_pool_workflow, misc factoring)
* Bump gevent
…188)

* Added langchain tracing interceptor. Changed sample to use a child workflow and multiple activities.
Converted activities in hello samples from async to sync
* Update infrequent polling sample to use BENIGN application error

* formatting/linting
Add samples using OpenAI Agents SDK

---------

Co-authored-by: Maxim Fateev <[email protected]>
Co-authored-by: Dan Davison <[email protected]>
Co-authored-by: Maxim Fateev <[email protected]>
Co-authored-by: Grant <[email protected]>
Co-authored-by: Chad Retz <[email protected]>
* Bump python sdk version to 1.13

* Include uv.lock change

---------

Co-authored-by: Dan Davison <[email protected]>
added a sample showing how change workflow task failure log levels to error
* Stage changes for next update to openai integration

* Update temporalio to latest

* Formatting

* remove passthrough

* Run isort
* AI: make all samples run from root dir

* Add poe to dev group
Fixes #37

* drop 3.9 support
* Skip trio test for Python < 3.12
* translated Go sample of sliding window to be writting in python

* refactor, change folder name, fix imports and update readme to match style

* Cleaned things up and got everything functioning

* Run linter

* sort imports

* fixed undeclared types

* Change Readme to instruct running from the root directory

* force commit to try to fix required actions

---------

Co-authored-by: tconley1428 <[email protected]>
* improve tracing for openai agents

* follow openai agents examples more closely
* update for plugins

* formatting

* reference main branch

* cleanup

* switch to plugins on the runners

* Update dependency to 1.15.0 release

---------

Co-authored-by: Tim Conley <[email protected]>
* update for plugins

* formatting

* reference main branch

* cleanup

* switch to plugins on the runners

* move around samples

* update README files

* formatting update

* formatting

* timeout adjustments

* Reset uv.lock

---------

Co-authored-by: Tim Conley <[email protected]>
* update for plugins

* formatting

* reference main branch

* cleanup

* switch to plugins on the runners

* move around samples

* update README files

* formatting update

* formatting

* timeout adjustments

* porting basic examples from OpenAI Agents Examples

* Revert uv.lock change

---------

Co-authored-by: Tim Conley <[email protected]>
* update for plugins

* formatting

* reference main branch

* cleanup

* switch to plugins on the runners

* move around samples

* update README files

* formatting update

* formatting

* timeout adjustments

* porting agent patterns from OpenAI agents examples

* Revert uv.lock

---------

Co-authored-by: Tim Conley <[email protected]>
THardy98 and others added 30 commits May 13, 2026 12:51
* Redis external storage driver

* Fix lints

* Fix CI tests

* Fix yarl error in CI

* Revert accidental README.md edit, and add external_storage_redis.

* Move redis test workflow to tests/

* Update test_redis_worker.py

* Constrain langsmith to allow CI to pass
workflow.timedelta was an incidental re-export from temporalio's
old workflow.py module. The refactor to a workflow package in
temporalio/sdk-python#1488 dropped it, so use datetime.timedelta
directly (matches the rest of the repo).

Co-authored-by: Claude Opus 4.7 (1M context) <[email protected]>
* Add Strands plugin samples

Demonstrates the Temporal Strands plugin: hello world, tools (in-workflow,
custom activity, strands_tools), HITL, hooks, MCP, structured output,
streaming, interrupt, and continue-as-new.

Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>

* Convert continue_as_new chat to workflow update

`user_says` → `turn`, now a `@workflow.update` returning the assistant's
reply directly so callers no longer need a separate `messages` query to
discover what the agent said. The run loop drains in-flight handlers via
`workflow.all_handlers_finished` before continue-as-new.

Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>

* Fix interrupt sample: make delete_thing idempotent

The activity was toggling its `_APPROVED` state (add on raise, discard on
success), so after the human approved once, a follow-up tool call from the
model would interrupt again with no further approval coming — hanging the
test. Drop the discard so once approved, the name stays approved.

Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>

* Fix ruff import order in strands mock model

ruff's `I001` rule groups `temporalio` with other third-party imports
rather than its own block, which broke `poe lint` on CI.

Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>

* Rename Strands sample extra

* Use Windows-compatible Strands tool sample

* Bump sdk-python pin to pick up Strands MCP client fix

Picks up c84320c6 on the strands branch, which rewrites the MCP
populate_cache and call_tool activity to use ClientSession directly
instead of MCPClient.start/stop. The old code created a background
event loop on one thread and closed it from another, which deadlocked
mcp_test on Python 3.10 once trio_asyncio's policy was installed at
import time by tests/trio_async/workflow_test.py.

Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>

* Rename Strands interrupt sample to activity_interrupt

Disambiguates from the hook-based human_in_the_loop sample by naming this
one after where the interrupt is raised (a Temporal activity). Also fixes
the parent README's broken `tool_interrupt` link.

Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>

* Fix uv sync group name in Strands READMEs

The dependency group is named strands-agents, not strands.

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>

* Test the continue-as-new path in the Strands chat sample

Replace test_continue_as_new_chat, which never tripped the continue-as-new
branch, with test_continue_as_new_carries_history. A low
limit.historyCount.suggestContinueAsNew threshold makes the server suggest
continue-as-new after one turn, so the test verifies the original run ends in
CONTINUED_AS_NEW and the fresh run resumes with the carried-over messages
before taking another turn and ending the chat.

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>

* add snipsync lines

* Remove unnecessary langsmith constraint

temporalio 1.28.0's langsmith extra already pins langsmith>=0.7.34,<0.9,
so the manual constraint-dependencies entry is redundant.

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>

* Fix formatting in strands_plugin workflows

ruff format requires two blank lines before the trailing @@@SNIPEND
markers added in 12f9d5d.

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>

---------

Co-authored-by: Claude Opus 4.7 (1M context) <[email protected]>
Co-authored-by: Lenny Chen <[email protected]>
Co-authored-by: Lenny Chen <[email protected]>
* Add SANO sample

* Redis external storage driver (#287)

* Redis external storage driver

* Fix lints

* Fix CI tests

* Fix yarl error in CI

* Revert accidental README.md edit, and add external_storage_redis.

* Move redis test workflow to tests/

* Update test_redis_worker.py

* Constrain langsmith to allow CI to pass

* Update to main of python sdk

* Update to python sdk 1.28.0

* Fix test. Use sano dev server and add required dynamic config

* Skip test on timeskipping server

* update readme w/ dynamic config values

* Update readme with link

* use new temporal operation instead of workflow run operation

* Bump to v1.7.2-standalone-nexus-operations cli version. Add callouts about release phase. Add dev server links.

* Add assert_eventually test helper. Update count assertion to be more specific

* Run formatter

* Add getting a handle and result of an existing operation

---------

Co-authored-by: Edward Amsden <[email protected]>
* AI-277: Add Google ADK integration samples

Add a google_adk_agents/ sample suite demonstrating the
temporalio.contrib.google_adk_agents plugin, mirroring the openai_agents
layout with one runnable subdirectory per scenario.

Five scenarios cover the plugin's public surface: basic (GoogleAdkPlugin +
TemporalModel), tools (activity_tool), agent_patterns (multi-agent
sub_agents), mcp (TemporalMcpToolSet/Provider), and streaming (TemporalModel
streaming_topic + WorkflowStream). Adds a google-adk dependency group pinned
to temporalio[google-adk] >= 1.28.0, which streaming requires.

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>

* PR comments + fix root readme

* wordings

* tests

* Update .github/CODEOWNERS

Co-authored-by: Brian Strauch <[email protected]>

---------

Co-authored-by: Claude Opus 4.8 (1M context) <[email protected]>
Co-authored-by: Brian Strauch <[email protected]>
…321)

Add SNIPSTART markers around the Worker/Client setup and Workflow starter so the documentation integration page can pull them via snipsync, and trim the sample comments to short, why-only notes.

Co-authored-by: Claude Opus 4.8 (1M context) <[email protected]>
* Prompt for human feedback in LangGraph HITL sample

The graph_api human-in-the-loop sample previously auto-approved the draft
and used a hardcoded placeholder response, so running it didn't actually
involve a human. Now the draft is generated by an LLM, the runner prompts
interactively at the terminal for approval or revision feedback, and the
review node revises the draft with the LLM based on that feedback.

Tests mock the chat model so they stay deterministic and offline.

* Only require AI SDK team review for langgraph_plugin

* Revert: restore SDK team review for langgraph_plugin CODEOWNERS
Update SANO dev server
* Add LangGraph workflow streams sample

Demonstrate the LangGraph plugin's Workflow Streams support: a node emits
live tokens via get_stream_writer() (routed by the plugin's streaming_topic),
and the workflow publishes coarse astream progress to its own topic. A single
client subscribes to all topics and demultiplexes on item.topic.

Bumps the langgraph group to temporalio>=1.28.0 (where workflow streams ship)
and drops the now-obsolete langsmith<0.7.34 constraint, which was specific to
the 1.27.2 langsmith patch.

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>

* Add langgraph_plugin code owners

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>

* Trigger CI

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>

* Add README for graph_api/streaming sample

Every other graph_api/ sample has a standalone README with run
instructions and a "what this demonstrates" blurb; streaming was the
only one without.

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>

* Dedupe streaming tokens on a sequence id

Streaming is at-least-once per activity attempt: a retried node re-runs
and re-publishes its writes, so subscribers can see duplicate tokens.
Tag each token chunk with a monotonic seq and dedupe on it in the client
and test, demonstrating the documented idempotent-consumer pattern
instead of implicitly assuming exactly-once delivery.

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>

* Fix mypy error in streaming test dedupe

set.add returns None, so the comprehension trick tripped mypy's
func-returns-value. Rewrite as an explicit loop.

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>

---------

Co-authored-by: Claude Opus 4.8 (1M context) <[email protected]>
Improve SANO Sample
* Add Google ADK chatbot sample

A multi-turn conversational chatbot under google_adk_agents: one persisted
ADK session across turns, each turn driven by a workflow Update handler that
returns the assistant's reply, plus a no-op update validator.

* add comment to update validator

* rename agen to event_stream
* Add langfuse_tracing sample: Temporal traces in Langfuse via OpenTelemetry

Demonstrates the recommended way to get Temporal workflow traces into
Langfuse: OpenTelemetryPlugin(add_temporal_spans=True) with a replay-safe
tracer provider, plus a standard OTLP/HTTP exporter pointed at Langfuse's
native OpenTelemetry endpoint. No Langfuse-specific SDK or plugin needed.

- ticket_triage/: LLM triage workflow (two LLM activities, a plain
  activity, and a human-approval update) with --replay-stress and
  worker-restart demos; one correctly nested Langfuse trace per run with
  GENERATION observations carrying model, token usage, and content.
- verify_trace.py: asserts the whole observation tree, types, usage, and
  no-duplicates through the Langfuse public API.
- langfuse/docker-compose.yml: pinned self-hosted Langfuse with headless
  org/project/API-key provisioning.
- naive_guide_style/: deliberately broken anti-pattern (spans created in
  workflow code, sandbox disabled) showing duplicated, fragmented traces
  under replay.
- RECOMMENDATION.md: customer-shareable write-up of the approach.
- tests/langfuse_tracing/: CI-safe tests with mocked LLM activities, an
  in-memory exporter, the workflow cache disabled, and a Replayer pass
  asserting replay emits zero new spans.

* Slim the langfuse_tracing sample to the core pattern

Drop the recommendation write-up and the comparison variant, and remove
references to them from the READMEs and verify_trace.py.

* Address review feedback in the langfuse_tracing sample

- Bound LLM activity retries (RetryPolicy(maximum_attempts=3)) so a
  misconfigured endpoint or API key fails fast instead of retrying
  forever, and note that each retry attempt adds its own RunActivity
  span; verify_trace's duplicate-row message now mentions activity
  retries alongside replay as a possible cause of extra spans.
- Ignore .env files repo-wide so the runbook-created env file holding a
  real API key cannot be committed by accident.
- Make the Langfuse project ID in the starter's printed trace link
  configurable via LANGFUSE_PROJECT_ID (defaults to the project the
  bundled docker-compose provisions).
- Parse worker flags with argparse so typos and --help behave as
  expected instead of silently starting a normal-mode worker.
- Replace bare os.environ lookups for Langfuse credentials with an
  actionable error message in telemetry.py and verify_trace.py.

* Add langfuse_tracing to the AI SDK team's CODEOWNERS entries

* Remove duplicate langgraph_plugin CODEOWNERS entry

The AI SDK block below already contains the identical pattern and
owners, and CODEOWNERS resolves by last matching pattern, so the
earlier entry was fully shadowed.

* Address review feedback: docs precision and MinIO presigned-URL endpoint

- Correct the trace/session causality in starter.py and the README: the
  Langfuse trace is keyed by the starter's root span (new every run); a
  fresh workflow ID is what gives each run its own Langfuse session.
- verify_trace.py docstring: --replay-stress is a worker flag, not a test;
  reference it accurately.
- README replay experiments: say "same tree shape" rather than "identical
  tree", include the verify_trace invocation in both command blocks, and
  make the worker-restart timing precise (kill the worker after the triage
  activities finish, while the workflow durably awaits approval).
- docker-compose: publish MinIO's S3 endpoint on 127.0.0.1:9090 so the
  LANGFUSE_S3_MEDIA_UPLOAD_ENDPOINT / BATCH_EXPORT_EXTERNAL_ENDPOINT
  defaults (localhost:9090) resolve for presigned URLs; correct the header
  comment (upstream publishes MinIO on all interfaces, and the worker also
  stays unpublished here) and describe LANGFUSE_INIT_* provisioning as
  skipped-when-existing rather than "idempotent".
- .env.example: add LANGFUSE_DEMO_USER, which the starter reads.
* Fix stale references in AI sample READMEs

- strands_plugin: drop the note about the `strands` extra not being
  released yet, along with its install-from-branch fallback
- strands_plugin/tools: `activity_as_tool` lives in
  `temporalio.contrib.strands.workflow`, not `workflow`
- strands_plugin/continue_as_new: the workflow waits on
  `is_continue_as_new_suggested()` in a `wait_condition`, not per turn
- langgraph_plugin/graph_api/streaming: point `WorkflowStream` at the SDK
  docs instead of the docs.temporal.io root

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>

* Drop duplicate langgraph_plugin CODEOWNERS entry

The rule at the top of the file duplicated the one in the AI SDK section
further down, which also covers /tests/langgraph_plugin/.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>

* Point dev server links at the CLI reference anchor

Three READMEs linked docs.temporal.io/cli#start-dev-server, whose anchor does
not match a heading on that page ("Start a development server"), so it landed
at the top. /cli/server#start-dev matches the reference page's `start-dev`
heading exactly, and is what the Google ADK samples already used.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>

* Show the dev server command next to the CLI link

Both anchored forms of the dev server link are replaced with the unanchored
docs.temporal.io/cli, and each prerequisite now shows the command it is asking
for, following external_storage/README.md.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>

* Drop the anchor from the external_storage CLI link

Matches the other READMEs, which link the CLI docs page without an anchor.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>

* Align AI samples on env-configurable address, path runs, modern typing

- Google ADK scripts read TEMPORAL_ADDRESS with a localhost:7233 default, as
  the Strands and LangGraph samples already do.
- Google ADK docs invoke scripts by path (`uv run <dir>/run_worker.py`) rather
  than `uv run python -m <module>`, matching the other suites.
- Strands samples use `str | None` instead of `Optional[str]`.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>

---------

Co-authored-by: Claude Opus 5 (1M context) <[email protected]>
* Add Google GenAI plugin samples

Add a google_genai_plugin/ sample suite for temporalio.contrib.google_genai,
mirroring the strands_plugin/ layout (one feature per sub-directory, each with
workflow.py / run_worker.py / run_workflow.py / README.md).

Samples cover every major plugin feature:
- hello_world: generate_content
- tools: automatic function calling (activity_as_tool + plain workflow-method tool)
- streaming: generate_content_stream + streaming_topic/WorkflowStream
- chat: multi-turn client.chats
- structured_output: response_schema + Pydantic
- mcp: TemporalMcpClientSession with a local echo MCP server
- files: client.files.upload (live API)
- interactions: client.interactions stateful API (live API)
- agents: client.agents CRUD (live API)
- vertex_ai: vertexai=True configuration (GCP credentials)

Tests under tests/google_genai_plugin/ use the plugin's GeminiTestServer to run
the model-layer samples offline; the mcp test additionally registers a real
echo MCP server. files/interactions/agents/vertex_ai are runnable-only (require
live credentials) and documented as such.

Register the suite in pyproject.toml (google-genai dependency group + wheel
package), the root README, and CODEOWNERS.

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>

* Add SNIPSTART/SNIPEND annotations to google_genai samples

Wrap the workflow.py, run_worker.py, and run_workflow.py bodies of each
sample in @@@SNIPSTART/@@@SNIPEND markers (python-google-genai-<sample>-<part>)
so the code can be embedded in docs, matching the strands_plugin convention.

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>

* Use Pydantic data converter in streaming run_workflow

The stream publishes Pydantic GenerateContentResponse chunks, so the
consumer needs the Pydantic data converter to decode them.

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>

* Update temporalio to 1.31

Bump every temporalio requirement to >=1.31.0. The 1.31 google-adk extra
requires google-adk 2.x, so widen that pin too, and relax the interactions
sample's typing since create/get now return a union with the streaming
response type.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>

* Rename google_genai_plugin to google_genai

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>

* Remove stale unreleased-extra notes from READMEs

The google-genai and strands-agents extras of temporalio shipped in 1.31,
which pyproject.toml already requires, so `uv sync --group ...` is enough.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>

---------

Co-authored-by: Claude Opus 4.8 (1M context) <[email protected]>
* Add openai_agents streaming sample

Demonstrates buffered token streaming for OpenAI Agents-backed
workflows via temporalio.contrib.workflow_streams (experimental,
contrib/pubsub branch of sdk-python). The OpenAI Agents plugin's
ModelActivityParameters carries a streaming_event_topic; the model
activity publishes raw stream events to that topic with a
configurable flush interval (default 100ms), and the workflow
emits a sentinel on a "done" topic when Runner.run_streamed
finishes. Subscribers iterate (events, done) and break on the
sentinel — race_with_workflow handles the case where the workflow
fails before publishing the sentinel.

Two scenarios:
- stream_text: text-delta events from a simple haiku agent
- stream_items: agent-update / handoff / tool-call events across
  a multi-agent workflow with a joke-rating activity

* samples: openai_agents streaming review polish

run_stream_items_workflow: print the workflow's final result after
the streamed events render — matches run_stream_text_workflow and
makes streamed-vs-final parity visible.

* Update streaming sample for the released workflow_streams API

The sample was written against the contrib/pubsub branch of sdk-python.
Workflow Streams and OpenAI Agents streaming both shipped in 1.30.0, with
some renames and one behavioral difference, so bring the sample in line:

- ModelActivityParameters.streaming_event_topic is now streaming_topic,
  and streaming_event_batch_interval is streaming_batch_interval.
- subscribe() without result_type decodes payloads rather than handing
  back a raw Payload. Pass result_type=RawValue and decode per topic,
  matching the workflow_streams samples.
- subscribe() exits cleanly once the workflow reaches a terminal state,
  so the race_with_workflow helper is unnecessary: break on the
  terminator, then await handle.result(), which raises if the workflow
  failed. Verified against a terminated workflow.
- Workflows hold the run open briefly after publishing the terminator so
  a subscriber's next poll can drain the tail of the stream, which lives
  in workflow memory.

Fix the stream_items scenario. The streaming activity publishes native
OpenAI events, not the agents-SDK StreamEvent wrappers, so the
agent-update / tool-call / message-output events the subscriber was
matching on never appear on that topic. The agents SDK builds those
inside the workflow, so the workflow now publishes them itself as a
serializable ItemEvent on its own topic (the SDK's own event types carry
the originating Agent, which holds tool callables). stream_events()
resolves a turn at a time, so the play-by-play still arrives
progressively. For the same reason, the stream_text subscriber now
matches ResponseTextDeltaEvent directly instead of unwrapping a
raw_response_event.

Also move both workflow module docstrings above the imports, where they
are actually docstrings, and drop the stale contrib/pubsub install notes
from the READMEs.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>

* Add tests for the openai_agents streaming sample

Covers both scenarios against a scripted streaming model, so no
OPENAI_API_KEY is needed: the plugin accepts a model_provider directly,
so unlike the other AI sample tests this one needs no monkeypatching.

- stream_text: the text arrives as several native OpenAI delta events
  that reassemble into exactly what the workflow returns.
- stream_items: the workflow-published events arrive in order —
  agent_updated, tool_call, tool_output, message_output.

Both subscribe the same way the runner scripts do (one iterator over the
event and terminator topics, RawValue payloads decoded per topic) and
assert the terminator is seen, which is what lets the subscriber stop
without racing the workflow's completion.

These are the first tests under tests/openai_agents. The directory should
also be listed in CODEOWNERS alongside the other AI sample test
directories, but this branch predates that block, so adding it here would
conflict with main.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>

* Add tests/openai_agents to CODEOWNERS

Matches the other AI sample test directories. Deferred until after the
merge from main, which is where that block came from.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>

---------

Co-authored-by: Brian Strauch <[email protected]>
Co-authored-by: Claude Opus 5 (1M context) <[email protected]>
Hatchling's `packages` setting takes literal paths and does not accept
patterns, so the wheel target listed every sample by hand. That list drifted:
an entry naming a directory that does not exist is ignored without a warning,
so `nexus` (added in #174, where the directory was actually `hello_nexus`)
never matched anything, and 14 sample directories added since the uv migration
were never shipped — including `google_adk_agents` and `openai_agents`. The
sdist shipped no samples at all.

Switch to setuptools, whose `packages.find` discovers them declaratively, so
adding a sample requires no build config change. Namespace discovery is needed
because some samples have subdirectories without an `__init__.py`.

Verified: the wheel and sdist each contain exactly the 652 tracked sample .py
files (the wheel previously had 405 from 33 hand-listed entries; the sdist had
none), with no venv, cache, or lambda_worker content; a wheel install and an
editable install both import samples the old list omitted; the AI sample tests
pass against the reinstalled editable project.

Co-authored-by: Claude Opus 5 (1M context) <[email protected]>
Co-authored-by: copilot-swe-agent[bot] <[email protected]>
The docs page for the Google GenAI plugin pulled four of these snippets
with `selectedLines` ranges that started partway into the file, so
snipsync rendered each one with a leading `# ...` elision marker. The
marker also sits at column 0, which zeroes out the common indent prefix
and suppresses snipsync's dedenting, so the worker excerpts rendered
indented as well.

Move the SNIPSTART/SNIPEND markers to wrap exactly the code the page
shows, so the page can drop `selectedLines` entirely:

- tools/run_worker.py: the Worker construction with its activity
- vertex_ai/run_worker.py: the vertexai=True client and plugin
- mcp/run_worker.py: echo_session through the plugin registration
- streaming/run_workflow.py: consume() through the Client.connect that
  installs the Pydantic data converter

The streaming range was also wrong, not just offset: it began at a
dangling `if` inside consume() and omitted the stream.subscribe() call
that the surrounding prose describes.

Co-authored-by: Claude Opus 5 (1M context) <[email protected]>
* Add LiteLLM activity sample

* Address LiteLLM sample review feedback

* Give the AI SDK team ownership of the litellm_activity sample

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>

---------

Co-authored-by: Brian Strauch <[email protected]>
Co-authored-by: Claude Opus 5 (1M context) <[email protected]>
* Add Deep Agents plugin samples

* Address review feedback on HITL state, conftest guard, and streaming test

- human_in_the_loop: clear the pending-approval prompt on resume so the
  query honors its documented contract, and add an update validator that
  rejects decisions other than approve/reject before they enter history
- tests conftest: replace find_spec with a guarded import so collection
  is skipped when the plugin package exists but its runtime deps do not
- streaming test: replace the fixed sleep-then-cancel drain with a
  condition-based subscriber awaited via wait_for, matching the other
  streaming tests

* Address review feedback: CODEOWNERS, docs, stream draining, stronger tests

- CODEOWNERS: add /deepagents_plugin/ and /tests/deepagents_plugin/ for the
  AI SDK team, matching the sibling AI suites
- Suite README: state the Python >= 3.11 floor in Prerequisites (on 3.10 the
  dependency group silently resolves to nothing)
- streaming/run_workflow.py: drain the subscriber until the full durable
  result has been printed (bounded by a timeout) instead of cancelling it
  immediately and dropping tail chunks
- subagents_test: script the coordinator -> task tool -> researcher ->
  synthesis path so the delegation headline is actually exercised, and assert
  three invoke_model activities in history
- hello_world_test: assert the model call was scheduled as a
  deepagents.invoke_model activity (shared count_scheduled_activities helper)
- pyproject: cap langchain-anthropic at <2 like its group siblings

* Align samples with the plugin's recommended patterns

- Drop the workflow.unsafe.imports_passed_through() guards from all eight
  workflows: the plugin passes the deepagents/LangChain import tree through
  the sandbox itself, and its README highlights bare imports as the intended
  developer experience. hello_world carries a comment explaining why no
  guard is needed. Verified by the full test suite (real sandboxed worker)
  plus an ad-hoc sandbox run of the untested langsmith_tracing workflow.
- continue_as_new: use run_deep_agent's default server-suggested mode (the
  documented recommended mode) instead of a hardcoded event threshold; the
  probe test retains continue_as_new_after=1 as explicit-override coverage.
- react_agent: build the agent with create_temporal_deep_agent and per-agent
  activity_options — the recommended way to scope model-call timeouts —
  replacing the bare TemporalModel construction.
- Extend the history seam assertions to every testable scenario: react_agent
  (get_weather + invoke_tool), filesystem_backend (backend_op >= 2),
  streaming (invoke_model_streaming, no invoke_model), human_in_the_loop
  (invoke_tool after resume).
- HITL README: note that a production loop would re-check __interrupt__
  after each resume.

* Account for the merged-but-unreleased plugin (temporalio/sdk-python#1644)

The plugin is on sdk-python main and ships as the temporalio[deepagents]
extra in the next release (>= 1.31.0); it is not on PyPI yet. Point the
interim install at sdk-python main (the per-plugin overlay path retired
at merge), name the real post-release group entry in the pyproject note,
and drop the plugin-ordering claim from langsmith_tracing — registration
order does not matter. Suite verified against merged main: 8 passed.

* Complete the main merge: adopt setuptools packaging, drop hatch remnants

The previous merge commit was pushed with unresolved conflict markers
in pyproject.toml. Resolve to main's setuptools auto-discovery (which
finds deepagents_plugin without registration) and regenerate the lock.

* Drop the dependency-group comment; the suite README covers the install story

* Apply self-review findings: version floors, guard visibility, test rigor

The review's headline: temporalio 1.31.0 already shipped on PyPI
(2026-07-29) WITHOUT the deepagents extra, so every ">= 1.31.0" claim
in the install story was wrong and the documented group swap would
have resolved to an extra-less release. Floors now say "> 1.31.0 /
the first release that ships the extra", and the group's temporalio
pin rises to >= 1.31.0 to match the repo base pin.

Also: the conftest collection guard now announces itself via
pytest_report_header instead of silently collecting nothing, and its
docstring drops the retired temporalio-contrib-deepagents dist story;
the continue-as-new probe pins the first run's close event to
CONTINUED_AS_NEW (a loop-in-one-run regression previously passed);
the HITL suite covers the validator's invalid-decision rejection and
the reject path (guarded tool never runs as an activity); scenario
READMEs name the Python floor and defer to the suite setup instead of
repeating it; the streaming README describes what the workflow
actually drives (TemporalModel.astream).
* Update Nexus messaging samples to use Temporal operation handlers

* fixing comment
…guide (#351)

* Add a sandbox sample and snipsync markers for the docs guide

The Python OpenAI Agents SDK integration guide on docs.temporal.io
currently sends readers to the SDK contrib README. Give it code to pull
from here instead.

Adds openai_agents/sandbox, covering SandboxAgent through the plugin. It
uses UnixLocalSandboxClient, so it runs with only OPENAI_API_KEY and no
sandbox account — at the cost of giving the agent a shell on the worker
host, which the README calls out. Note the class lives in
agents.sandbox.sandboxes.unix_local, not the
agents.extensions.sandbox.unix_local path the contrib README shows.

Adds snipsync markers to the samples that guide walks through, scoped to
exactly the code it shows so no block needs selectedLines. Markers around
indented code sit at that code's indent level, keeping snipsync's dedent
working (see #346).

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>

* Apply suggestion from @brianstrauch

* Apply suggestion from @brianstrauch

---------

Co-authored-by: Claude Opus 5 (1M context) <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.