Skip to content

Add Microsoft Agent Framework plugin samples - #418

Draft
DABH wants to merge 25 commits into
mainfrom
dabh/agent-framework-plugin
Draft

DABH wants to merge 25 commits into
mainfrom
dabh/agent-framework-plugin

Conversation

@DABH

@DABH DABH commented Nov 13, 2026 •

Copy link
Copy Markdown
Contributor

What was changed

This PR adds microsoft_agent_framework_plugin/, ten samples for the Temporal plugin for Microsoft Agent Framework (temporalio/ai-integrations#522): hello world, tools, MCP, human in the loop, middleware, multi-agent, structured output, streaming, continue-as-new and OpenTelemetry, each with a test that runs on the plugin's scripted chat client and no API key. The MCP sample is a standalone uv project like openai_agents/mcp_v2, because the Strands and Google GenAI groups pin mcp<2 and the plugin needs mcp>=2.2.

The plugin requires temporalio>=1.36, which dropped Python 3.10, so the group carries python_version >= '3.11' markers and the lock forks. Two side effects of 1.36 are in their own commits: # type: ignore[misc] on 17 existing Client.connect(**config, plugins=...) calls, and claude_agent_sdk_plugin/human_in_the_loop now records its decision in the Update handler, since 1.36 delivers an Update and a Signal in one activation.

Why?

The plugin and its docs page need runnable, tested samples to quote.

Checklist

  1. No linked issue.

  2. How was this tested: 38 tests pass locally across the new and the Claude samples (11 on the time-skipping server), lint is clean on 3.10 and 3.14. Draft until the package is on PyPI; the temporary [tool.uv.sources] git entries then become >=0.1.0.

DABH added 17 commits November 12, 2026 22:40
temporalio 1.36 processes a workflow activation's jobs as one batch
(workflow logic flag 2), so a signal or update handler no longer runs
before the other jobs delivered in the same activation. When the decide
Update arrived in the same activation as the lost-connection failure of
the read Activity, the wait in ask_human was cancelled before it consumed
the decision and the finally block reset it, so the turn redone after a
Worker restart asked again.

Recording the decision in the handler itself, keyed by the pending call,
keeps it for the redone turn on 1.35 and 1.36. Fixes
tests/claude_agent_sdk_plugin/human_in_the_loop_test.py::test_decision_survives_a_worker_restart
on temporalio 1.36.0 (failed 3 of 3 runs before, passes 3 of 3 after;
3 of 3 on 1.35.0 before and after). The docs snippets
python-claude-agent-sdk-human-in-the-loop-approval and -decision change
with it.
An AssertionError in an Update handler fails the Workflow Task, which the
Worker retries while the Update stays stuck; an ApplicationError fails
only this Update. call_key is now a static method inside the
python-claude-agent-sdk-human-in-the-loop-approval snippet, so the quoted
code shows it. No marker name changes.
Both lock files move temporalio-agent-framework from b5ed079c to
1c2006ae on dabh/agent-framework-python; no signature the samples use
changed.
Both locks move temporalio-agent-framework from 1c2006ae to 509bfab4 on
dabh/agent-framework-python; the only change in each lock is that commit
hash.
DABH added 8 commits November 13, 2026 00:49
The plugin is now temporalio-microsoft-agent-framework, since an
unqualified agent framework could be anyone's, and the samples follow it
in the directory, the dependency group, the task queues, the snippet
markers and the uv source pin, which now points at the renamed plugin
revision. The framework's own agent_framework imports and the
agent-framework-openai distribution are Microsoft's names and stay as
they are.
Both locks move temporalio-microsoft-agent-framework from d20bc0c8 to
d374e26c on dabh/agent-framework-python; the only change in each lock is
that commit hash.
Since d374e26c a client with streaming_topic runs every model call as
the streaming Activity, with or without stream=True, so the sample calls
agent.run(prompt) and the README no longer says a topic needs
stream=True. The test's expectations were already met: one
invoke_model_streaming Activity and every update at the subscriber.
Both locks move temporalio-microsoft-agent-framework from d374e26c to
8b472d21 on dabh/agent-framework-python. Each lock changes the git
revision line and adds opentelemetry-api to the plugin's dependency
list, which the plugin now declares; no other package moves.
A turn sent during another turn's model call gets its reply from the run
the server delivers it to, and an end_chat sent during a turn ends the
chat after that turn. The sample's turns are Updates, so nothing waits
in Workflow fields at the handoff; the README and the module docstring
say so, and the new test drives three turns and the end_chat across a
continue-as-new chain with a slow scripted client.
Both locks move temporalio-microsoft-agent-framework from 8b472d21 to
a453fa6c on dabh/agent-framework-python. The mcp project's lock also
moves temporalio-mcp from 0.3.0 to 0.4.0, which the plugin now requires;
no other package moves.
Both locks move temporalio-microsoft-agent-framework from a453fa6c to
54998df8 on dabh/agent-framework-python; the only change in each lock is
that commit hash. agent-framework-core stays at 1.26.0 here: this
repository has no cooldown, and the plugin's floor allows it.
ai-integrations#522 merged as e7303bbc, the same tree as 54998df8, and
the branch was deleted, so both [tool.uv.sources] entries now name the
commit with rev instead of the branch. Each lock changes its source line
and the dependency reference accordingly; no package moves.
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.

1 participant