* Fix source generator bug that silently drops base class handler registrations for protocol-only partial executors
* Fixed xml comments and variable naming.
* Fix workflow samples broken due to routing change
* Add ADR-0020: Foundry Evals integration design
Captures the design for integrating Azure AI Foundry Evaluations with
agent-framework. Key decisions:
- EvalItem with conversation (list[Message]) as single source of truth
- query/response derived from configurable conversation split strategies
- Tools as list[FunctionTool] (including auto-extracted MCP tools)
- FoundryEvals provider with auto-detection of evaluator capabilities
- LocalEvaluator with @function_evaluator decorator for local checks
- Consistent Python/C# APIs: evaluate_agent, evaluate_workflow
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* Mark ADR 0020 Foundry Evals as accepted
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
---------
Co-authored-by: alliscode <bentho@microsoft.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* Python: avoid duplicate agent response telemetry
* Python: conditionally suppress duplicate agent telemetry
* Simplify telemetry ownership tracking
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* Aggregate token usage from inner chat spans on invoke_agent span
The invoke_agent span now carries the aggregated input/output token
counts from all inner chat completion spans that occur during an agent
run. Previously, when inner ChatTelemetryLayer spans captured usage,
the outer AgentTelemetryLayer skipped setting usage entirely to avoid
duplication. Now a new INNER_ACCUMULATED_USAGE context variable tracks
cumulative usage across all inner completions, and the agent span
always reports the total.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
---------
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Eduard van Valkenburg
·
2026-03-20 10:09:46 +00:00
* Deprecate Azure AI v1 (Persistent Agents API) helper methods
Add DeprecationWarning to v1 classes and functions that have been
superseded by the v2 (Projects/Responses) API:
- AzureAIAgentsProvider -> use AzureAIProjectAgentProvider
- AzureAIAgentClient -> use AzureAIClient
- AzureAIAgentOptions -> use AzureAIProjectAgentOptions
- to_azure_ai_agent_tools() -> use to_azure_ai_tools()
- from_azure_ai_agent_tools() -> use from_azure_ai_tools()
- AzureAIAgentClient static tool factory methods -> use AzureAIClient equivalents
All v1 components still function but emit warnings to guide migration.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* Add deprecation warnings to AzureAIAgentsProvider methods
Mark create_agent(), get_agent(), and as_agent() as deprecated
individually, pointing to AzureAIProjectAgentProvider equivalents.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
---------
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* Emit tool call events in GitHubCopilotAgent streaming
_stream_updates now yields FunctionCallContent for TOOL_EXECUTION_START
and FunctionResultContent for TOOL_EXECUTION_COMPLETE events from the
Copilot SDK session. This enables DevUI and other consumers to display
tool calls during streaming agent execution. Previously only ASSISTANT_MESSAGE_DELTA, SESSION_IDLE, and SESSION_ERROR
were handled — tool execution events were silently dropped.
Signed-off-by: James Sturtevant <jsturtevant@gmail.com>
* Add some tests
Signed-off-by: James Sturtevant <jsturtevant@gmail.com>
* Respond to feedback
Signed-off-by: James Sturtevant <jsturtevant@gmail.com>
* Fix TOOL_EXECUTION_COMPLETE to use correct SDK types
- Read result text from session_events.Result.content (not ToolResult.text_result_for_llm)
- Read failure state from event.data.success/error (not result_obj.result_type/error)
- Handle ErrorClass.message and plain string errors
- Update tests to use session_events.Result and ErrorClass
- Add tests for string errors, success-with-error, and COMPLETE missing fields
Signed-off-by: James Sturtevant <jsturtevant@gmail.com>
---------
Signed-off-by: James Sturtevant <jsturtevant@gmail.com>
* [BREAKING] Refactor middleware layering and raw clients
Reorder chat client layers so function invocation wraps chat middleware, and chat middleware stays outside telemetry while still running for each inner model call. Add middleware pipeline caching, refresh docs and samples, and split Anthropic into raw and public clients to match the standard layering model.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* Tighten typing ignores in ancillary modules
Add targeted typing ignores in workflow visualization and lab modules so pyright stays clean alongside the middleware refactor work.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* Fix categorize_middleware to unpack tuple/Sequence and use relative MRO assertions
- Broaden isinstance check in categorize_middleware from list to Sequence
so tuples and other Sequence types are properly unpacked instead of
being appended as a single item.
- Replace fragile hardcoded MRO index assertions in anthropic test with
relative ordering via mro.index().
- Add regression tests for categorize_middleware with tuple, list, and
None inputs.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* Fix middleware string decomposition, add middleware param to FunctionInvocationLayer, and add tests (#4710)
- Guard categorize_middleware Sequence check against str/bytes to prevent
character-by-character decomposition of accidentally passed strings
- Add explicit middleware parameter to FunctionInvocationLayer.get_response
and merge it into client_kwargs before categorization, fixing the
inconsistency where only OpenAIChatClient supported this parameter
- Add assertions that RawAnthropicClient does not inherit convenience layers
- Add chat middleware cache test with non-empty base middleware
- Add tests for single unwrapped middleware item and string input
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* Apply pre-commit auto-fixes
* Apply pre-commit auto-fixes
* Address review feedback for #4710: review comment fixes
---------
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <copilot@github.com>
Eduard van Valkenburg
·
2026-03-20 00:43:37 +00:00
* Emit TOOL_CALL_RESULT events on approval resume (#4589)
When a tool call is approved via the interrupt/resume flow,
_resolve_approval_responses executes the tool and injects the result
into the messages array, but no TOOL_CALL_RESULT SSE event was yielded
to the client.
Changes:
- _resolve_approval_responses now returns the list of resolved
function_result Content objects instead of None
- run_agent_stream yields ToolCallResultEvent for each resolved
approval result after RunStartedEvent is emitted
- Add ToolCallResultEvent to ag_ui.core imports in _agent_run.py
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* Apply pre-commit auto-fixes
* fix(ag-ui): address PR review feedback for #4589
1. _resolve_approval_responses now returns only approved results (not
rejections) so TOOL_CALL_RESULT events are emitted only for executed
tools. Rejection results are still written into message history.
2. Emit resolved TOOL_CALL_RESULT events in the no-updates fallback
RUN_STARTED path so approval results are never lost.
3. Rewrite tests to use real FunctionTool with func and
approval_mode='always_require' via StubAgent default_options,
verifying actual tool execution output in TOOL_CALL_RESULT content.
Added test for rejection not emitting TOOL_CALL_RESULT.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* Fix#4589: clean up approval resolution and add missing tests
- Extract duplicated TOOL_CALL_RESULT emission block into
_make_approval_tool_result_events helper to prevent drift
- Remove dead rejection_results construction in _resolve_approval_responses;
_replace_approval_contents_with_results already handles rejections inline
- Pass only approved_results (not all_results) to clarify the contract
- Add mixed approve/reject test validating the core splitting logic
- Add zero-updates test covering the no-updates fallback emission path
- Add direct unit test for _resolve_approval_responses return value
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* Apply pre-commit auto-fixes
* Fix import sorting lint error in test_approval_result_event.py
Add blank line between first-party and third-party import groups
to satisfy ruff I001 rule.
Fixes#4589
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
---------
Co-authored-by: Copilot <copilot@github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* Python: Emit AG-UI events for MCP tool calls, results, and text reasoning
Fixes#4213 — `_emit_content()` in the AG-UI layer only handled `text`,
`function_call`, `function_result`, `function_approval_request`, `usage`,
and `oauth_consent_request` content types. Foundry MCP content types
(`mcp_server_tool_call`, `mcp_server_tool_result`) and `text_reasoning`
fell through unhandled, producing no SSE events for AG-UI consumers.
Added three new handler functions wired into `_emit_content()`:
- `_emit_mcp_tool_call`: emits TOOL_CALL_START + TOOL_CALL_ARGS and
tracks in FlowState for MESSAGES_SNAPSHOT inclusion
- `_emit_mcp_tool_result`: emits TOOL_CALL_END + TOOL_CALL_RESULT with
full FlowState cleanup mirroring `_emit_tool_result`
- `_emit_text_reasoning`: emits the protocol-defined reasoning event
sequence (ReasoningStart → MessageStart → MessageContent → MessageEnd
→ ReasoningEnd) with ReasoningEncryptedValueEvent for protected_data
* Add HTTP round-trip tests for MCP tool and reasoning SSE events
Exercises the full POST → SSE bytes → parse → validate pipeline for
mcp_server_tool_call, mcp_server_tool_result, text_reasoning, and
ReasoningEncryptedValueEvent content through FastAPI TestClient.
* Fix _emit_mcp_tool_result missing predictive_handler support (#4213)
- Add predictive_handler parameter to _emit_mcp_tool_result and mirror
the apply_pending_updates + StateSnapshotEvent block from _emit_tool_result
- Forward predictive_handler from _emit_content to _emit_mcp_tool_result
- Add assertion for stored arguments in MCP tool call test
- Add test for predictive handler state snapshot after MCP tool result
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* Apply pre-commit auto-fixes
* Refactor MCP tool emit functions and add missing tests (#4213)
- Extract _emit_tool_result_common shared helper to eliminate duplication
between _emit_tool_result and _emit_mcp_tool_result
- Remove server_name prefix from tool_call_name in _emit_mcp_tool_call;
display_name now equals tool_name directly
- Add test for tool_name fallback to 'mcp_tool' when tool_name is None
- Add test for output=None fallback to empty string in _emit_mcp_tool_result
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* Address review feedback for #4213: review comment fixes
---------
Co-authored-by: Copilot <copilot@github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* Add script to ping on stale issues/PRs
* Add script to ping on stale issues/PRs
* Fix stale issue/PR ping script review comments
- Rename TEAM_NAME env var to TEAM_SLUG for clarity
- Add actionable error messages for 403/404 team lookup failures
- Add contents:read permission for actions/checkout
- Use github.event.inputs context with fallback for scheduled runs
- Pin PyGithub to 2.6.0 for reproducible builds
- Fetch comments once in should_ping() to reduce API calls
- Make ping() retry loop idempotent (track comment/label state)
- Validate DAYS_THRESHOLD with helpful error for non-numeric input
- Fix timezone bug: use astimezone() instead of replace(tzinfo=)
- Add comprehensive unit tests (29 tests)
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
---------
Co-authored-by: Copilot <copilot@github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* Support detail field in OpenAI image_url payload (#4616)
Include the optional 'detail' field from Content.additional_properties
when building image_url payloads for the OpenAI Chat API, matching the
existing pattern used for 'filename' in document file payloads.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* Apply pre-commit auto-fixes
* Remove reproduction report
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* Simplify detail extraction from additional_properties (#4616)
- Remove unnecessary hasattr check; additional_properties is always
initialized as a dict on Content instances.
- Use 'is not None' instead of truthy check to be more precise.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* Apply pre-commit auto-fixes
* Remove detail allowlist in chat client to align with responses client
Replace the strict allowlist check ('low', 'high', 'auto') with an
isinstance(detail, str) check so that any valid string detail value is
passed through to OpenAI. This aligns the chat client behavior with the
responses client, which passes detail through unconditionally.
Also add test coverage for:
- Future/unknown string detail values being passed through
- Data URI images (covering the 'data' branch of the match)
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
---------
Co-authored-by: Copilot <copilot@github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* Fix zero-argument MCP tool schema missing 'properties' key (#4540)
MCP servers for zero-argument tools (e.g. matlab-mcp-core-server's
detect_matlab_toolboxes) declare inputSchema as {"type": "object"}
without a "properties" key. OpenAI's API requires "properties" to
be present on object schemas, causing a 400 invalid_request_error.
Normalize inputSchema at MCP ingestion in load_tools() to inject an
empty "properties": {} when it is missing from object-type schemas.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* Address review feedback for #4540: improve test robustness and add defensive guard
- Look up loaded functions by name instead of index to avoid brittle
ordering assumptions
- Add negative-path test cases: non-object schema (type: string) and
empty schema ({}) to verify guard clause skips them correctly
- Assert original inputSchema dicts are not mutated by load_tools()
- Add defensive guard for tool.inputSchema being None
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* Address review feedback for #4540: Python: [Bug]: Local stdio MCP works for calculator but fails for official matlab-mcp-core-server on LM Studio /v1/responses
---------
Co-authored-by: Copilot <copilot@github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* Fix A2AAgent to invoke context providers before and after run
A2AAgent.run() bypassed the context provider lifecycle (before_run/after_run)
that BaseAgent defines as a contract for all agents. This caused A2AAgent to
violate the semantic definition of BaseAgent, resulting in inconsistency with
other agent implementations.
The fix follows the same pattern used by WorkflowAgent:
- Create SessionContext and run before_run on all context providers before
processing the A2A stream
- Collect response updates and run after_run on all context providers after
the stream is fully consumed
- Auto-create a session when context providers are configured but no session
is explicitly passed
Fixes#4754
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* Apply pre-commit auto-fixes
* Remove reproduction report from repository
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* Address PR review feedback for #4754
- Validate messages when no continuation_token: raise ValueError if
normalized_messages is empty, preventing IndexError on messages[-1]
- Import BaseContextProvider/SessionContext from public agent_framework
package instead of internal agent_framework._sessions module
- Add test for ValueError on run(None) without continuation_token
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* Improve test coverage for empty-messages guard in A2AAgent.run (#4754)
- Parameterize test to cover both messages=None and messages=[] inputs
- Add test verifying run(None, continuation_token=...) does not raise
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
---------
Co-authored-by: Copilot <copilot@github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Eduard van Valkenburg
·
2026-03-19 10:45:42 +00:00
* Fix invoke_agent span to aggregate token usage across LLM calls (#4062)
The FunctionInvocationLayer._get_response() loop was overwriting the
response on each iteration, so usage_details only reflected the last
chat completion call. Now tracks aggregated_usage across all iterations
using add_usage_details() and sets it on the returned response.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* Apply pre-commit auto-fixes
* Remove reproduction report artifact
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* Apply pre-commit auto-fixes
* Apply pre-commit auto-fixes
---------
Co-authored-by: Copilot <copilot@github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Eduard van Valkenburg
·
2026-03-19 06:41:33 +00:00
* Fix source generator bug that silently drops base class handler registrations for protocol-only partial executors
* Fixed xml comments and variable naming.
* Fix FileAgentSkillsProvider accepting SkillsInstructionPrompt without {0} placeholder (#4638)
BuildSkillsInstructionPrompt validated only format-string syntax via
string.Format(template, ""), which silently accepted templates without a
{0} placeholder. The generated skills list was then dropped from the final
instructions.
Tighten validation to format with a sentinel string and verify it appears
in the output, rejecting templates that do not reference argument 0 with
an ArgumentException.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* Fix netstandard2.0 compat and simplify prompt template validation (#4638)
- Replace string.Contains(string, StringComparison) with IndexOf for
netstandard2.0/net472 compatibility
- Remove sentinel round-trip check; validate {0} directly on the raw
template string using IndexOf
- Add positive test verifying custom SkillsInstructionPrompt with {0}
is accepted and applied to output
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
---------
Co-authored-by: Copilot <copilot@github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* updated automation tasks and commands, with alias for the time being
* Restore aggregate test exclusions
Preserve the legacy all-tests scope for test --all by excluding lab and devui from the default aggregate sweep, while still allowing explicit package selection. Also ignore hidden/generated test directories such as .mypy_cache during aggregate discovery.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* updated versions in pre-commit
---------
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Eduard van Valkenburg
·
2026-03-18 18:39:11 +00:00
* Python: Re-read env vars in configure_otel_providers and enable_instrumentation (#4119)
Fix ENABLE_SENSITIVE_DATA and VS_CODE_EXTENSION_PORT env vars being ignored
when load_dotenv() runs after module import. The module-level
OBSERVABILITY_SETTINGS singleton cached env state at import time, and
configure_otel_providers() / enable_instrumentation() never re-read from
os.environ when parameters were None.
Both functions now construct a fresh ObservabilitySettings() to pick up
current env vars when explicit parameters are not provided, matching the
existing behavior of the env_file_path branch.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* Address PR review feedback for #4119: avoid throwaway ObservabilitySettings
- Add _read_bool_env/_read_int_env helpers to read env vars without
constructing a full ObservabilitySettings (which calls create_resource())
- Replace ObservabilitySettings() in enable_instrumentation() and
configure_otel_providers() else-branch with direct env reads
- Add enable_console_exporters parameter to configure_otel_providers()
for override parity with enable_sensitive_data and vs_code_extension_port
- Propagate _resource and _executed_setup in the non-env_file_path branch
- Make existing tests hermetic (clear VS_CODE_EXTENSION_PORT and
ENABLE_CONSOLE_EXPORTERS env vars)
- Add tests: enable_console_exporters env refresh, explicit param overrides
for both enable_instrumentation() and configure_otel_providers()
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* Address remaining review feedback for #4119
- Refresh enable_console_exporters in enable_instrumentation() for
consistency with configure_otel_providers(), so env var changes
after import are picked up by both public API functions
- Make test_configure_otel_providers_reads_env_vs_code_port hermetic
by clearing ENABLE_CONSOLE_EXPORTERS from the environment
- Add test_enable_instrumentation_reads_env_console_exporters to
cover the new refresh behavior
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* Remove unconditional enable_console_exporters overwrite from enable_instrumentation() (#4119)
enable_instrumentation() is documented as not configuring exporters, so
managing enable_console_exporters there was a leaky abstraction. The
unconditional _read_bool_env call silently reset the value to False when
ENABLE_CONSOLE_EXPORTERS was absent from env, clobbering any value
previously set by configure_otel_providers(enable_console_exporters=True).
- Remove the unconditional overwrite line from enable_instrumentation()
- Replace test_enable_instrumentation_reads_env_console_exporters with
test_enable_instrumentation_does_not_touch_console_exporters
- Add regression test: enable_instrumentation() does not clobber a
previously configured enable_console_exporters value
- Add test: explicit enable_sensitive_data param still leaves
enable_console_exporters untouched
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
---------
Co-authored-by: Copilot <copilot@github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Eduard van Valkenburg
·
2026-03-18 15:58:22 +00:00
* Add two hosted agent samples using the foundry agent
* Refactor formatting and improve readability in main.py
* Add agent-framework dependency to requirements and update copyright notice in main.py files
* Refactor agent imports and update credential handling in hosted agent samples
* Update agent framework dependency in requirements for hosted agents
* chore: update Python version to 3.14 and improve Dockerfile for hosted agents
* feat: add hosted agent samples for Azure AI with local tools and multi-agent workflows
* fix: update Azure AI client import and refactor agent initialization in hotel agent sample
* feat: add hosted agent samples for Seattle hotel search and writer-reviewer workflow
* fix: correct agent name in YAML configuration for local tools agent
* Fix Content serialization in DurableAgentStateUnknownContent (#4719)
DurableAgentStateUnknownContent.from_unknown_content() stored raw Content
objects without converting them to dicts, causing json.dumps to fail in
Azure Durable Functions' entity state serialization. This affected content
types not explicitly handled (e.g., mcp_server_tool_call/result).
The fix converts Content objects to dicts via to_dict() when storing in
DurableAgentStateUnknownContent, and restores them via Content.from_dict()
in to_ai_content().
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* Add to_json and from_json methods to Content class (#4719)
Add to_json() and from_json() methods to the Content class to match the
serialization interface provided by SerializationMixin on other model classes.
Also fix pre-existing pyright type errors in durabletask's
DurableAgentStateUnknownContent.to_ai_content().
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* Address PR review: add type guard, remove to_json, add fallback, and tests
- Remove Content.to_json() per reviewer request (comment 3)
- Add type guard in Content.from_json() for non-dict JSON (comments 1, 4)
- Wrap json.JSONDecodeError as ValueError for consistent exception contract
- Add try/except fallback in to_ai_content() for invalid Content dicts (comment 5)
- Add test_content_to_dict_exclude_none and test_content_to_dict_exclude_fields (comment 2)
- Add test_unknown_content_to_ai_content_fallback_on_invalid_type_dict (comment 5)
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* Apply pre-commit auto-fixes
* Address review feedback for #4719: review comment fixes
* Remove Content.from_json, move logic to consuming code (#4719)
Remove the from_json convenience method from Content class per review
feedback. This is the same trivial json.loads + from_dict wrapper as
to_json which was already removed. Consumers should call json.loads
and Content.from_dict directly.
Update tests to use Content.from_dict(json.loads(...)) pattern and
remove from_json-specific error handling tests (those errors are
already covered by json.loads and Content.from_dict).
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
---------
Co-authored-by: Copilot <copilot@github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Eduard van Valkenburg
·
2026-03-18 08:08:44 +00:00
* Fix race condition issue in FanInEdge while processing messages.
* refactored to limit the code segment under lock.
* Remove extra materialization of the result.
* Added comment to clarify future changes if process message is made async.
* Fix flow.interrupts overwrite when multiple tools need approval (#4590)
Change flow.interrupts assignment to append so that all interrupt entries
accumulate when multiple tools require approval in a single turn.
Both _run_common.py and _agent_run.py used assignment (=) which caused
each new interrupt to overwrite the previous one. Switching to append()
ensures RUN_FINISHED.interrupt contains all pending approvals.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* Add test for streaming path with multiple confirm_changes interrupts (#4590)
Add integration test exercising run_agent_stream with multiple predictive
tool calls requiring confirmation. Verifies that flow.interrupts.append()
correctly accumulates all interrupt entries and they appear in the
RUN_FINISHED event.
Also confirms FlowState already declares interrupts field with
default_factory=list, addressing the AttributeError concern from review.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* Apply pre-commit auto-fixes
---------
Co-authored-by: Copilot <copilot@github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* .NET: [Feature Branch] Add basic durable workflow support (#3648)
* Add basic durable workflow support.
* PR feedback fixes
* Add conditional edge sample.
* PR feedback fixes.
* Minor cleanup.
* Minor cleanup
* Minor formatting improvements.
* Improve comments/documentation on the execution flow.
* .NET: [Feature Branch] Add Azure Functions hosting support for durable workflows (#3935)
* Adding azure functions workflow support.
* - PR feedback fixes.
- Add example to demonstrate complex Object as payload.
* rename instanceId to runId.
* Use custom ITaskOrchestrator to run orchestrator function.
* .NET: [Feature Branch] Adding support for events & shared state in durable workflows (#4020)
* Adding support for events & shared state in durable workflows.
* PR feedback fixes
* PR feedback fixes.
* Add YieldOutputAsync calls to 05_WorkflowEvents sample executors
The integration test asserts that WorkflowOutputEvent is found in the
stream, but the sample executors only used AddEventAsync for custom
events and never called YieldOutputAsync. Since WorkflowOutputEvent is
only emitted via explicit YieldOutputAsync calls, the assertion would
fail. Added YieldOutputAsync to each executor to match the test
expectation and demonstrate the API in the sample.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* Fix deserialization to use shared serializer options.
* PR feedback updates.
* Sample cleanup
* PR feedback fixes
* Addressing PR review feedback for DurableStreamingWorkflowRun
- Use -1 instead of 0 for taskId in TaskFailedException when task ID is not relevant.
- Add [NotNullWhen(true)] to TryParseWorkflowResult out parameter following .NET TryXXX conventions.
---------
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* .NET: [Feature Branch] Add nested sub-workflow support for durable workflows (#4190)
* .NET: [Feature Branch] Add nested sub-workflow support for durable workflows
* fix readme path
* Switch Orchestration output from string to DurableWorkflowResult.
* PR feedback fixes
* Minor cleanup based on PR feedback.
* .NET: [Feature Branch] Add Human In the Loop support for durable workflows (#4358)
* Add Azure Functions HITL workflow sample
Add 06_WorkflowHITL Azure Functions sample demonstrating Human-in-the-Loop
workflow support with HTTP endpoints for status checking and approval responses.
The sample includes:
- ExpenseReimbursement workflow with RequestPort for manager approval
- Custom HTTP endpoint to check workflow status and pending approvals
- Custom HTTP endpoint to send approval responses via RaiseEventAsync
- demo.http file with step-by-step interaction examples
* PR feedback fixes
* Minor comment cleanup
* Minor comment clReverted the `!context.IsReplaying` guards on `PendingEvents.Add`/`RemoveAll` and `SetCustomStatus` in `ExecuteRequestPortAsync`. The guards broke fan-out scenarios where parallel RequestPorts need to be discoverable after replay. `SetCustomStatus` is idempotent metadata that doesn't affect replay determinism.eanup
* fix for PR feedback
* PR feedback updates
* Improvements to samples
* Improvements to README
* Update samples to use parallel request ports.
* Unit tests
* Introduce local variables to improve readability of Workflows.Workflows access patter
* Use GitHub-style callouts and add PowerShell command variants in HITL sample README
* Add changelog entries for durable workflow support (#4436)
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* Bump Microsoft.DurableTask.Worker to 1.19.1 to fix version downgrade
Microsoft.Azure.Functions.Worker.Extensions.DurableTask 1.13.1 requires
Microsoft.DurableTask.Worker >= 1.19.1 via its transitive dependency on
Microsoft.DurableTask.Worker.Grpc 1.19.1.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* Fix broken markdown links in durable workflow sample READMEs
- Create Workflow/README.md with environment setup docs
- Fix ../README.md -> ../../README.md in ConsoleApps 01, 02, 03, 08
- Fix SubWorkflows relative path (3 levels -> 4 levels up)
- Fix dead Durable Task Scheduler URL
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* Fix build errors from main merge: Throw conflict, ExecuteAsync rename, GetNewSessionAsync rename
- Remove InjectSharedThrow from DurableTask csproj (uses Workflows' internal Throw via InternalsVisibleTo)
- Update ExecuteAsync -> ExecuteCoreAsync with WorkflowTelemetryContext.Disabled
- Update GetNewSessionAsync -> CreateSessionAsync
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* Move durable workflow samples to 04-hosting/DurableWorkflows
Aligns with main branch sample reorganization where durable samples
live under 04-hosting/ (alongside DurableAgents/).
- Move samples/Durable/Workflow/ -> samples/04-hosting/DurableWorkflows/
- Add Directory.Build.props matching DurableAgents pattern
- Update slnx project paths
- Update integration test sample paths
- Update README cd paths and cross-references
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* Fix build errors: remove duplicate base class members, update renamed APIs
- Remove duplicate OutputLog, WriteInputAsync, CreateTestTimeoutCts, etc. from
ConsoleAppSamplesValidation (already in SamplesValidationBase)
- Update AddFanInEdge -> AddFanInBarrierEdge in workflow samples
- Update GetNewSessionAsync -> CreateSessionAsync in workflow samples
- Update SourceId -> ExecutorId (obsolete) in workflow samples
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* Fix dotnet format issues: add UTF-8 BOM and remove unused using
- Add UTF-8 BOM to 20 .cs files across DurableTask, AzureFunctions,
unit tests, and workflow samples
- Remove unnecessary using directive in 07_SubWorkflows/Executors.cs
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* Fix typo PaymentProcesser -> PaymentProcessor and garbled arrows in README
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* Fix GetExecutorName to handle agent names with underscores
Split on last underscore instead of first, and validate that the
suffix is a 32-char hex string (sanitized GUID) before stripping it.
This prevents truncation of agent names like 'my_agent' when the
executor ID is 'my_agent_<guid>'.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* Align DurableTask.Client.AzureManaged to 1.19.1
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* Bump DurableTask and Azure Functions extension package versions
- DurableTask.* packages: 1.19.1 -> 1.22.0
- Functions.Worker.Extensions.DurableTask: 1.13.1 -> 1.16.0
- Functions.Worker.Extensions.DurableTask.AzureManaged: 1.0.1 -> 1.5.0 (telemetry bug fix)
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* Bump DurableTask SDK packages to 1.22.0
- DurableTask.Client: 1.19.1 -> 1.22.0
- DurableTask.Client.AzureManaged: 1.19.1 -> 1.22.0
- DurableTask.Worker: 1.19.1 -> 1.22.0
- DurableTask.Worker.AzureManaged: 1.19.1 -> 1.22.0
- Azure Functions extensions kept at original versions (1.13.1/1.0.1) due to
host-side DurableTask.Core 3.7.0 incompatibility with newer extensions
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* Update Microsoft.Azure.Functions.Worker.Extensions.DurableTask to "1.16.0"
* Add the local.settings.json files to the sample which were previously ignored. This aligns with our other samples.
* Increase timeout for tests as CI has them failing transiently.
* increaset timeout value for azure functions integration tests.
* Add YieldsOutput(string) to workflow shared state sample executors
ValidateOrder and EnrichOrder call YieldOutputAsync with string messages,
but only their TOutput (OrderDetails) was in the allowed yield types.
This caused TargetInvocationException in the WorkflowSharedState sample
validation integration test.
* Downgrade the durable packages to 1.18.0
* Downgrading Worker.Extensions.DurableTask to 1.12.1
---------
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>