Commit Graph

1504 Commits

  • .NET: [BREAKING] Workflows API Review Naming Changes (Part 1?) (#4090)
    * refactor: Normalize Run/RunStreaming with AIAgent
    
    * refactor: Clarify Session vs. Run -level concepts
    
    * Rename RunId to SessionId to better match Run/Session terminology in AIAgent
    * [BREAKING]: Will break existing checkpointed sessions in CosmosDb due to field rename
    
    * refactor: Rename and simplify interface around getting typed data out of ExternalRequest/Response
    
    * Also adds hints around using value types in PortableValue
    
    * refactor: Rename AddFanInEdge to AddFanInBarrierEdge
    
    This will prevent a breaking change later when we introduce a programmable FanIn edge, analogous to the FanOut edge's EdgeSelector.
    
    The goal, in the long run is to support a number of different FanIn scenarios, with naive FanIn (no barrier) by default, similar to FanOut.
    
    * refactor: AsAgent(this Workflow, ...) => AsAIAgent(...)
    
    * misc - part1: SwitchBuilder internal
    
    ---------
    
    Co-authored-by: Dmytro Struk <13853051+dmytrostruk@users.noreply.github.com>
  • .NET: Small fixes in README (#4099)
    * Small fixes in README
    
    * Disabled problematic test
    
    * Disabled problematic test
  • Python: Add more unit test coverage gates (#4104)
    * Add more unit test coverage gates
    
    * Fix missing `files` parameter in `print_coverage_table()` docstring (#4106)
    
    * Initial plan
    
    * Update print_coverage_table docstring to document files parameter
    
    Co-authored-by: TaoChenOSU <12570346+TaoChenOSU@users.noreply.github.com>
    
    ---------
    
    Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
    Co-authored-by: TaoChenOSU <12570346+TaoChenOSU@users.noreply.github.com>
    
    ---------
    
    Co-authored-by: Copilot <198982749+Copilot@users.noreply.github.com>
    Co-authored-by: TaoChenOSU <12570346+TaoChenOSU@users.noreply.github.com>
  • Python: fix reasoning model workflow handoff and history serialization (#4083)
    * fix: strip function_call and text_reasoning from cross-agent workflow handoff
    
    When a reasoning model (e.g. gpt-5-mini) runs as Agent 1 in a workflow, its
    response includes text_reasoning items (with server-scoped IDs like rs_XXXX)
    and function_call items. Forwarding these to Agent 2 in a fresh conversation
    caused API errors because the reasoning/call IDs are scoped to the original
    stored response context.
    
    Changes:
    - Strip 'function_call', 'text_reasoning', 'function_approval_request', and
      'function_approval_response' from handoff messages in _agent_executor.py
    - Keep 'function_result' so the actual tool output content is preserved for
      the next agent's context
    - Update unit tests to reflect that function_result messages survive handoff
      (messages grow from 2→3: user, tool(result), assistant(summary))
    - Fix incorrect test assertions in test_function_invocation_stop_clears_*
      that assumed the client layer updates session.service_session_id
    - Also fixed _extract_function_calls to search all messages with call_id
      deduplication, and the error-limit stop path to submit function_call_output
      items before halting (via tool_choice=none cleanup call)
    
    Relates to: https://github.com/microsoft/agent-framework/issues/4047
    
    Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
    
    * fix: reasoning model workflow handoff and history serialization
    
    Fixes multiple related issues when using reasoning models (gpt-5-mini,
    gpt-5.2) in multi-agent workflows that chain agents via from_response
    or replay full conversation history via AgentExecutorRequest.
    
    ## Reasoning items always emitted on output_item.added
    
    When a reasoning model produces encrypted or hidden reasoning (no
    visible text), the Responses API still fires a reasoning output item
    without any reasoning_text.delta events. Previously no text_reasoning
    Content was emitted in that case, making it invisible to downstream
    logic. Both the non-streaming (_parse_response_from_openai) and
    streaming (output_item.added) paths now always emit at least one
    text_reasoning Content — with empty text if no content is available —
    so co-occurrence detection and serialization guards work reliably.
    
    ## Reasoning items only serialized when paired with a function_call
    
    The Responses API only accepts reasoning items in input when they
    directly preceded a function_call in the original response. Sending a
    reasoning item that preceded a text response (no tool call) causes:
      "reasoning was provided without its required following item"
    _prepare_message_for_openai now checks has_function_call per message
    and skips text_reasoning serialization when there is no accompanying
    function_call.
    
    ## summary field is an array, not an object
    
    The reasoning item summary field sent to the Responses API must be an
    array of objects ([{"type": "summary_text", "text": ...}]), not a
    single object. Fixed _prepare_content_for_openai accordingly.
    
    ## service_session_id cleared when explicit history is provided
    
    When a workflow coordinator replays a full conversation (including
    function calls from a previous agent run) back to an executor via
    AgentExecutorRequest or from_response, the executor's session still
    held a service_session_id (previous_response_id) from the prior run.
    The API then received the same function-call items twice — once from
    previous_response_id (server-stored) and once from the explicit input —
    causing: "Duplicate item found with id fc_...".
    
    AgentExecutor.run (when should_respond=True) and from_response now
    reset self._session.service_session_id = None before running so that
    explicit input is the sole source of conversation context.
    
    Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
    
    * small improvements in text reasoning
    
    * refactor: add reset_service_session to AgentExecutorRequest for explicit history replay
    
    Replace the implicit 'always clear service_session_id when should_respond=True'
    with an explicit opt-in field on AgentExecutorRequest.
    
    The old approach used should_respond=True as a proxy for 'full history replay',
    but that conflates two distinct intents:
    - Orchestrations group chat sends should_respond=True with an empty/single-message
      list (not a full replay) — unnecessarily clearing service_session_id.
    - HITL / feedback coordinators send the full prior conversation and truly need
      a fresh service session ID to avoid duplicate-item API errors.
    
    Changes:
    - Add AgentExecutorRequest.reset_service_session: bool = False
    - AgentExecutor.run only clears service_session_id when this flag is True
    - AgentExecutor.from_response unchanged (always clears; always full conversation)
    - Set reset_service_session=True in all full-history-replay call sites:
      agents_with_HITL.py, azure_chat_agents_tool_calls_with_feedback.py,
      autogen-migration round-robin coordinator, tau2 runner
    - Update _FullHistoryReplayCoordinator test helper to pass the flag
    
    Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
    
    * comment update
    
    * fixes from feedback
    
    * fix test
    
    * reverted changes to agent executor
    
    * fix: remove reset_service_session from tau2 runner
    
    Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
    
    * two other reverts
    
    * fix sample
    
    ---------
    
    Co-authored-by: Giles Odigwe <79032838+giles17@users.noreply.github.com>
    Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
  • .NET: Remove FunctionCalls and Tool Messages from Handoff passed messages (#3811)
    * Fix handoff orchestration not passing user message to handoff target agent (#3161)
    
    Filter out internal handoff function call and tool result messages before
    passing conversation history to the target agent's LLM. These messages
    confused the model into ignoring the original user question.
    
    * Add handoff tool call filtering behavior and enhance workflow builder
    
    - Introduced HandoffToolCallFilteringBehavior enum to specify filtering behavior for tool call contents in handoff workflows.
    - Updated HandoffsWorkflowBuilder to support customizable handoff instructions and tool call filtering behavior.
    - Enhanced HandoffAgentExecutor to utilize new filtering options for improved message handling during agent handoffs.
    
    * Enhance handoff message filtering logic and add unit tests for filtering behaviors
    
    * Refactor HandoffMessagesFilter to remove unused handoff function names and enhance filtering logic for non-handoff function calls
    
    * Refactor HandoffMessagesFilter to streamline FilterCandidateState initialization and improve clarity
    
    * Refactor HandoffMessagesFilter to improve filtering logic and add integration tests for handoff workflows
    
    * fix: HandoffAgentExecutor tests
  • .NET: Support a message only AIContextProvider as an AIAgent Decorator (#4009)
    * Support a message only AIContextProvider as an AIAgent Decorator
    
    * Fix formatting
    
    * Address PR comments.
  • Python: [BREAKING] Redesign Python exception hierarchy (#4082)
    * [BREAKING] Redesign Python exception hierarchy
    
    Replace the flat ServiceException family with domain-scoped branches:
    - AgentException (with InvalidAuth, InvalidRequest, InvalidResponse, ContentFilter)
    - ChatClientException (same consistent suberrors)
    - IntegrationException (same + InitializationError)
    - WorkflowException (Runner, Convergence, Checkpoint, Validation, Action, Declarative)
    - ContentError (AdditionItemMismatch)
    - ToolException / ToolExecutionException (unchanged)
    - MiddlewareException / MiddlewareTermination (unchanged)
    
    Key changes:
    - All Service* exceptions removed (ServiceException, ServiceInitializationError, etc.)
    - AgentExecutionException split into AgentInvalidRequest/ResponseException
    - AgentInvocationError removed, split into AgentInvalidRequest/ResponseException
    - Workflow exceptions moved from _workflows/_exceptions.py into main exceptions.py
    - _workflows/__init__.py emptied; main __init__.py imports directly from submodules
    - Purview exceptions re-parented under IntegrationException hierarchy
    - Init validation errors use built-in ValueError/TypeError instead of custom exceptions
    - CODING_STANDARD.md updated with hierarchy design and rationale
    
    Fixes microsoft/agent-framework#3410
    
    Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
    
    * Clarify ToolException vs ToolExecutionException docstrings
    
    ToolException: base class for all tool-related exceptions (preconditions,
    connection/init failures).
    ToolExecutionException: runtime call failures (tool call failed, reconnect
    failed, MCP errors).
    
    Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
    
    * Fix remaining stale imports from agent_framework._workflows
    
    - azurefunctions: _context.py, _app.py, _serialization.py, test_func_utils.py
      used 'from agent_framework._workflows import X' which broke after
      emptying _workflows/__init__.py; changed to direct submodule imports
    - azure-ai-search: test still referenced ServiceInitializationError;
      updated to ValueError to match production code
    
    Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
    
    ---------
    
    Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
  • .NET: Add tweaks to .net agent skills (#4081)
    * Add tweaks to .net agent skills
    
    * Address PR feedback
  • .NET: Updated package versions for RC release (#4067)
    * Updated package versions for RC release
    
    * Resolved comment
    
    * Resolved comments
  • [BREAKING] .NET: Decouple Checkpointing from Run/StreamAsync APIs (#4037)
    * [BREAKING] refactor: Decouple Checkpointing and Execution APIs
    
    With this change, Checkpointing becomes an property of an IWorkflowExecutionEnvironment. This lets environments that are tightly-coupled to their CheckpointManager avoid needing to present APIs that would not work (e.g. taking in an InMemory CheckpointManager for Durable Tasks, for example)
    
    * refactor: Normalize IsCheckpointingEnabled naming
  • Unify Azure credential handling across all Python packages (#4088)
    Replace ad_token, ad_token_provider, and get_entra_auth_token with a
    unified credential parameter across all Azure-related packages.
    
    Core changes:
    - Add AzureCredentialTypes (TokenCredential | AsyncTokenCredential) and
      AzureTokenProvider (Callable[[], str | Awaitable[str]]) type aliases
    - Add resolve_credential_to_token_provider() using azure.identity's
      get_bearer_token_provider for automatic token caching/refresh
    - Update AzureOpenAIChatClient, AzureOpenAIResponsesClient, and
      AzureOpenAIAssistantsClient to accept credential: AzureCredentialTypes |
      AzureTokenProvider
    - Remove ad_token, ad_token_provider params and get_entra_auth_token helpers
    
    Package updates:
    - azure-ai: Accept AzureCredentialTypes on AzureAIClient,
      AzureAIAgentClient, AzureAIProjectAgentProvider, AzureAIAgentsProvider
    - azure-ai-search: Accept AzureCredentialTypes on
      AzureAISearchContextProvider
    - purview: Accept AzureCredentialTypes | AzureTokenProvider on
      PurviewClient, PurviewPolicyMiddleware, PurviewChatPolicyMiddleware
    
    Fixes #3449
    Fixes #3500
    
    Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
  • Python: Updated package versions for RC release (#4068)
    * Updated package versions for RC release
    
    * Update python/packages/redis/pyproject.toml
    
    Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
    
    * Small fix
    
    ---------
    
    Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
  • .NET: Add Foundry Agents Tool Sample - OpenAPI Tools (#3702)
    * .NET: Add OpenAPI Tools sample #3674
    
    * Apply format fixes
    
    * Add MEAI and Native SDK creation options for OpenAPI Tools sample
    
    Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
    
    * Address PR review: DefaultAzureCredential and CS8321 in NoWarn
    
    Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
    
    * Add project to slnx
    
    ---------
    
    Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
  • Simplify memory sample to use session state (#4085)
    - Rename UserNameProvider → UserMemoryProvider
    - Use session state (state dict) instead of instance variables
    - Use context.extend_instructions() instead of context.instructions.append()
    - Use DEFAULT_SOURCE_ID class attribute
    - Fix imports to use public agent_framework API
    - Add session state inspection at end of sample
    
    Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
  • Fix CheckpointInfo.Parent always null in InProcessRunner (#3796) (#3812)
    Track the last CheckpointInfo in InProcessRunner so that newly created
    checkpoints reference their parent. When resuming from a checkpoint,
    the resumed-from checkpoint becomes the parent of the next checkpoint.
    
    Adds tests verifying:
    - First checkpoint has null parent
    - Subsequent checkpoints chain parents correctly
    - Checkpoint after resume references the resumed-from checkpoint
  • .NET: [BREAKING] Implement Polymorphic Routing (#3792)
    * feat: Implement Polymorphic Routing
    
    * feat: Add support for Send/Yield annotations with basic Executor
    
    * Adds annotations to Declarative workflow executors
    
    * fix: Address PR Comments
    
    * Implicit filter in collection loops
    * Remove debug / usused / superfluous code
    * Fix ProtocolBuilder implicit output registrations
    * Fix logic error in ExecuteRouteGeneratorTests.ClassWithManualConfigureProtocol_DoesNotGenerate
    
    * fix: Solidify type checks and send/yield type registrations
    
    * fix: Suppress generation of TurnTokens out of AggregateTurnMessagesExecutor
    
    * Fixes an issue where ConcurrentEndExecutor is not expecting TurnTokens.
    
    * fix: Add ProtocolBuilder support for chained-delegation
    
    * Updates Declarative pacakge to rely on chained-delegation Send/Yield registration
    * Renames DeclarativeActionExectuor's new ExecuteAsync to ExecuteActionAsync to avoid colliding with Executor.ExecutoeAsync
    
    * fix: Address PR Comments
    
    * Fixes type mapping in FanInEdgeRunner
    * Fixes and expalins send/yield type registration in FunctionExecutor
    
    * fixup: build-break
    
    * fix: Add missing SendsMesage declaration to InvokeAzureAgentExecutor
  • Python: Add load_dotenv() to samples for .env file support (#4043)
    * Initial plan
    
    * Add load_dotenv() to 303 Python samples for environment variable loading
    
    Co-authored-by: TaoChenOSU <12570346+TaoChenOSU@users.noreply.github.com>
    
    * Update SAMPLE_GUIDELINES.md to document load_dotenv() requirement
    
    Co-authored-by: TaoChenOSU <12570346+TaoChenOSU@users.noreply.github.com>
    
    * Update samples README.md to document .env file usage
    
    Co-authored-by: TaoChenOSU <12570346+TaoChenOSU@users.noreply.github.com>
    
    * Run ruff format on all changed sample files
    
    Co-authored-by: TaoChenOSU <12570346+TaoChenOSU@users.noreply.github.com>
    
    * Clarify load_dotenv() usage in README - local dev vs production
    
    Co-authored-by: TaoChenOSU <12570346+TaoChenOSU@users.noreply.github.com>
    
    * Remove deprecated getting_started folder as requested
    
    Co-authored-by: TaoChenOSU <12570346+TaoChenOSU@users.noreply.github.com>
    
    * Document env_file_path parameter for per-client configuration
    
    Co-authored-by: TaoChenOSU <12570346+TaoChenOSU@users.noreply.github.com>
    
    * Merge main branch to resolve conflicts
    
    Co-authored-by: TaoChenOSU <12570346+TaoChenOSU@users.noreply.github.com>
    
    * Fix run_evaluation.py file that was empty in merge commit
    
    Co-authored-by: TaoChenOSU <12570346+TaoChenOSU@users.noreply.github.com>
    
    * Remove dotnet changes from merge - out of scope for this PR
    
    Co-authored-by: TaoChenOSU <12570346+TaoChenOSU@users.noreply.github.com>
    
    * Remove package and test changes from merge - only sample changes needed
    
    Co-authored-by: TaoChenOSU <12570346+TaoChenOSU@users.noreply.github.com>
    
    * Remove test_func_utils.py - only sample changes needed
    
    Co-authored-by: TaoChenOSU <12570346+TaoChenOSU@users.noreply.github.com>
    
    * Revert sample files not in original changeset - keep only load_dotenv additions
    
    Co-authored-by: TaoChenOSU <12570346+TaoChenOSU@users.noreply.github.com>
    
    * Move load_dotenv() outside snippet tag in 06_host_your_agent.py
    
    Co-authored-by: TaoChenOSU <12570346+TaoChenOSU@users.noreply.github.com>
    
    * Fix comment placement - move load_dotenv before code comments
    
    Co-authored-by: TaoChenOSU <12570346+TaoChenOSU@users.noreply.github.com>
    
    * Fix load_dotenv() placement across all samples - after docstring, before code comments
    
    Co-authored-by: TaoChenOSU <12570346+TaoChenOSU@users.noreply.github.com>
    
    * Merge latest main branch with load_dotenv changes
    
    Co-authored-by: TaoChenOSU <12570346+TaoChenOSU@users.noreply.github.com>
    
    * Remove non-sample changes from merge - keep only load_dotenv additions
    
    Co-authored-by: TaoChenOSU <12570346+TaoChenOSU@users.noreply.github.com>
    
    * Revert non-load_dotenv sample changes from merge
    
    Co-authored-by: TaoChenOSU <12570346+TaoChenOSU@users.noreply.github.com>
    
    * Fix run_evaluation.py - use main's improved version (file already had load_dotenv)
    
    Co-authored-by: TaoChenOSU <12570346+TaoChenOSU@users.noreply.github.com>
    
    * Manual update
    
    * Manual update 2
    
    * Fix Role usage and load_dotenv placement per PR review feedback
    
    Co-authored-by: eavanvalkenburg <13749212+eavanvalkenburg@users.noreply.github.com>
    
    * Fix Role usage - use string literals not enum attributes
    
    Co-authored-by: eavanvalkenburg <13749212+eavanvalkenburg@users.noreply.github.com>
    
    * Fix SAMPLE_GUIDELINES.md example - load_dotenv before docstring per guidance
    
    Co-authored-by: eavanvalkenburg <13749212+eavanvalkenburg@users.noreply.github.com>
    
    * Move load_dotenv() before docstrings in all samples per SAMPLE_GUIDELINES ordering
    
    Co-authored-by: eavanvalkenburg <13749212+eavanvalkenburg@users.noreply.github.com>
    
    * Address PR review: rename files, fix placement, add session usage, remove note
    
    Co-authored-by: eavanvalkenburg <13749212+eavanvalkenburg@users.noreply.github.com>
    
    * Update Redis README to reference renamed file redis_history_provider.py
    
    Co-authored-by: eavanvalkenburg <13749212+eavanvalkenburg@users.noreply.github.com>
    
    ---------
    
    Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
    Co-authored-by: TaoChenOSU <12570346+TaoChenOSU@users.noreply.github.com>
    Co-authored-by: Tao Chen <taochen@microsoft.com>
    Co-authored-by: eavanvalkenburg <13749212+eavanvalkenburg@users.noreply.github.com>
    Co-authored-by: Eduard van Valkenburg <eavanvalkenburg@users.noreply.github.com>
  • .NET: Add File Search Sample for Foundry Agents. (#3990)
    * .NET: Add File Search sample #3674
    
    * Add FileSearch sample to solution and parent README
    
    - Add FoundryAgents_Step18_FileSearch to agent-framework-dotnet.slnx
    - Add FileSearch entry to FoundryAgents samples table in README.md
    - Fix README inaccuracy: sample creates one agent, not two
    
    Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
    
    * Refactor FileSearch sample: local functions + DefaultAzureCredential
    
    - Refactor agent creation into switchable local functions
    - Use DefaultAzureCredential with WARNING comment (matching other samples)
    - Update README to reference DefaultAzureCredential
    
    Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
    
    * Fix orphaned temp file in FileSearch sample
    
    Use Path.Combine + Path.GetRandomFileName instead of Path.GetTempFileName
    to avoid leaving an orphaned temp file on disk.
    
    Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
    
    ---------
    
    Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
  • .NET: Fix FoundryAgents_Step15_ComputerUse sample for Azure Agents API (#3989)
    * Fix FoundryAgents_Step15_ComputerUse sample for Azure Agents API
    
    The Azure Agents API rejects previous_response_id alongside computer_call_output
    items, unlike the vanilla OpenAI Responses API. This fix:
    
    - Send all prior response output items (reasoning, computer_call, etc.) as input
      items in follow-up calls so the API has full conversation context
    - Create a fresh session per call to avoid ConversationId/previous_response_id
    - Use currentCallId instead of initialCallId for computer_call_output
    - Clear ContinuationToken after polling to prevent stale tokens
    - Remove unused initialCallId tracking variable
    
    Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
    
    * Address comments
    
    ---------
    
    Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
  • Bump tar from 7.5.3 to 7.5.9 in /python/packages/devui/frontend (#4036)
    Bumps [tar](https://github.com/isaacs/node-tar) from 7.5.3 to 7.5.9.
    - [Release notes](https://github.com/isaacs/node-tar/releases)
    - [Changelog](https://github.com/isaacs/node-tar/blob/main/CHANGELOG.md)
    - [Commits](https://github.com/isaacs/node-tar/compare/v7.5.3...v7.5.9)
    
    ---
    updated-dependencies:
    - dependency-name: tar
      dependency-version: 7.5.9
      dependency-type: indirect
    ...
    
    Signed-off-by: dependabot[bot] <support@github.com>
    Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
    Co-authored-by: Mark Wallace <127216156+markwallace-microsoft@users.noreply.github.com>
  • Bump prek from 0.3.2 to 0.3.3 in /python (#3964)
    Bumps [prek](https://github.com/j178/prek) from 0.3.2 to 0.3.3.
    - [Release notes](https://github.com/j178/prek/releases)
    - [Changelog](https://github.com/j178/prek/blob/master/CHANGELOG.md)
    - [Commits](https://github.com/j178/prek/compare/v0.3.2...v0.3.3)
    
    ---
    updated-dependencies:
    - dependency-name: prek
      dependency-version: 0.3.3
      dependency-type: direct:development
      update-type: version-update:semver-patch
    ...
    
    Signed-off-by: dependabot[bot] <support@github.com>
    Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
  • Bump ruff from 0.15.0 to 0.15.1 in /python (#3963)
    Bumps [ruff](https://github.com/astral-sh/ruff) from 0.15.0 to 0.15.1.
    - [Release notes](https://github.com/astral-sh/ruff/releases)
    - [Changelog](https://github.com/astral-sh/ruff/blob/main/CHANGELOG.md)
    - [Commits](https://github.com/astral-sh/ruff/compare/0.15.0...0.15.1)
    
    ---
    updated-dependencies:
    - dependency-name: ruff
      dependency-version: 0.15.1
      dependency-type: direct:development
      update-type: version-update:semver-patch
    ...
    
    Signed-off-by: dependabot[bot] <support@github.com>
    Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
  • Python: Quick Redis sample fix (#4066)
    * REDIS URL fix
    
    * copilot fix
  • Python: Fix Redis samples for session migration and configurable REDIS_URL (#4060)
    * fix: update Redis samples for session migration and configurable REDIS_URL
    
    - Replace hardcoded redis://localhost:6379 with configurable REDIS_URL env var
    - Fix SessionContext usage: use input_messages kwarg instead of removed extend_messages
    - Remove obsolete scope_to_per_operation_thread_id parameter
    - Remove stale commented-out overwrite_redis_index/drop_redis_index params
    
    Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
    
    * Remove docker commands from comments to avoid security scan flags
    
    Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
    
    ---------
    
    Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
  • Python: Fix hosted MCP tool approval flow for all session/streaming combinations (#4054)
    * fix openai hosted mcp samples
    
    * addressed copilot comments
    
    * Update python/samples/02-agents/providers/azure_openai/azure_responses_client_with_hosted_mcp.py
    
    Co-authored-by: Dmytro Struk <13853051+dmytrostruk@users.noreply.github.com>
    
    ---------
    
    Co-authored-by: Dmytro Struk <13853051+dmytrostruk@users.noreply.github.com>
  • .NET: Support InvokeFunctionTool for declarative workflows (#4014)
    * Initial Implementation of InvokeFunctionTool
    
    * Added unit test for InvokeFunctionTool executor.
    
    * Implemented unit and integration tests for InvokeFunctionTool.
    
    * Add sample for InvokeFunctionTool in declarative workflows.
    
    * Remove unused sample and updated comments.
    
    * Updating to official OM release with InvokeFunctionTool
    
    * Fix formatting issues.
    
    * Updated PowerFx version
    
    * Update test fixture
    
    * Cleanup - Removed unused method in InvokeFunctionToolExecutor
    
    * Update test based on PR feedback.
    
    * Update based on PR comments
  • Python: Fix workflow samples for bugbash: part 1 (#4055)
    * Fix workflow samples for bugbash: part 1
    
    * Fix mypy
    
    * Fix tests
  • Python: Fixed declarative samples (#4051)
    * Updated declarative kind mapping
    
    * Fixed required property handling
    
    * Updated inline yaml sample
    
    * Fixed remaining declarative samples
    
    * Added lazy initialization for PowerFx engine
    
    * Small fix
  • Python: Fix sample bugs in file search and web search samples (#4049)
    - Fix file search samples: return vector_store.id string instead of
      Content object to avoid JSON serialization error
    - Fix web search sample: use correct web_search_options parameter for
      ChatClient instead of ResponsesClient's user_location parameter
    - Fix assistants client: pass tool_resources from options to run_options
      so vector store IDs reach thread creation
    - Add error handling for cleanup in Azure file search sample
    
    Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
  • Python: Fixed SK migration samples (#4046)
    * Fixed sk migration provider samples
    
    * Fixes to SK migration samples
  • Python: Fix Eval samples (#4033)
    * fix red team sample
    
    * Updated self-reflection
    
    * fix for workflow eval sample
    
    * fix test
  • .NET: BREAKING: Unify AgentResponse[Update] events as WorkflowOutputEvents (#3441)
    * Rename WorkflowOutputEvent.SourceId to ExecutorId for Python consistency
    
    - Rename SourceId property to ExecutorId in WorkflowOutputEvent
    - Add [Obsolete] SourceId property for backward compatibility
    - Update all test usages to use ExecutorId
    
    Resolves part of #2938
    
    * Unify AgentResponse events with WorkflowOutputEvent (#2938)
    
    - Change AgentResponseEvent and AgentResponseUpdateEvent to inherit from
      WorkflowOutputEvent instead of ExecutorEvent
    - Update AIAgentHostExecutor and HandoffAgentExecutor to use YieldOutputAsync()
      instead of AddEventAsync() for agent outputs
    - Add special-casing in InProcessRunnerContext.YieldOutputAsync() to create
      specific event types for AgentResponse and AgentResponseUpdate, bypassing
      OutputFilter for backwards compatibility
    - Update TestRunContext and TestWorkflowContext with same special-casing
    - Add regression tests in AgentEventsTests
    
    * refactor: Seal AgentResponse events
  • Python: Fixed Redis context provider and samples (#4030)
    * Removed session_id filtering in Mem0 implementation
    
    * Fixed redis samples
    
    * Resolved comments
  • Python: Fixed AutoGen migration and tool samples (#4027)
    * Fixed ollama_chat_client sample
    
    * Fixed ollama_chat_multimodal sample
    
    * Fixed function_tool_with_approval_and_sessions sample
    
    * Updated function_tool_with_session_injection sample
    
    * Small clean-up
    
    * Update 01_round_robin_group_chat.py
    
    * Update 02_selector_group_chat.py
    
    * Update 03_swarm.py
    
    * Update 03_assistant_agent_thread_and_stream.py
    
    * Update 04_agent_as_tool.py
    
    * Resolved comments
  • Fix MCP samples: update MCP SDK to 0.8.0-preview.1 and fix README references (#3959)
    - Update ModelContextProtocol NuGet package from 0.4.0-preview.3 to 0.8.0-preview.1
    - Update System.Net.ServerSentEvents from 10.0.1 to 10.0.3
    - Fix OAuth config to use DynamicClientRegistration in Agent_MCP_Server_Auth
    - Fix incorrect sample name references in README files
    
    Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
  • .NET: Add Foundry Evaluation samples (Safety + Quality) (#3697)
    * Initial plan
    
    * Add Foundry evaluation samples for Red Teaming and Self-Reflection
    
    Co-authored-by: rogerbarreto <19890735+rogerbarreto@users.noreply.github.com>
    
    * Refactor evaluation samples with real implementations in local functions
    
    Co-authored-by: rogerbarreto <19890735+rogerbarreto@users.noreply.github.com>
    
    * Uncomment function signatures and bodies, keep only invocations commented
    
    Co-authored-by: rogerbarreto <19890735+rogerbarreto@users.noreply.github.com>
    
    * Update Foundry evaluation samples with observability support
    
    * Restructure evaluation samples to follow FoundryAgents naming convention
    
    - Rename Evaluation/Evaluation_StepXX to FoundryAgents_Evaluations_StepXX
    - Add evaluation projects to slnx
    - Fix var usage, apply dotnet format, use DefaultAzureCredential
    - Add try/finally for agent cleanup
    - Fix evaluator deployment name separation in Step02
    - Update README references
    
    Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
    
    * Rewrite Step01 to use Azure.AI.Projects RedTeam API and address review comments
    
    - Replace safety evaluator sample with actual Red Teaming using AIProjectClient.RedTeams
    - Use AttackStrategy (Easy, Moderate, Jailbreak) and RiskCategory from Azure.AI.Projects
    - Remove Microsoft.Extensions.AI.Evaluation.Safety dependency from Step01
    - Add DefaultAzureCredential warning comments to Step02
    - Remove unused bestResponse variable in Step02
    - Add session isolation comments in self-reflection loop
    - Fix stale directory references in READMEs
    - Fix misleading evaluation overview link in main README
    
    Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
    
    * Add note about agent-targeted red teaming limitations in README
    
    The .NET RedTeam API currently only supports model deployment targets
    via AzureOpenAIModelConfiguration. Agent-targeted red teaming with
    AzureAIAgentTarget is documented in concept docs but not yet available
    in the SDK's RedTeam constructor. Results appear in classic portal view.
    
    Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
    
    * Add classic Foundry disclaimer to red teaming sample README
    
    Clarify that this sample uses the classic Azure AI Foundry red teaming
    API (/redTeams/runs). The new Foundry portal uses a separate evaluation-
    based API not yet available in the .NET SDK. AzureAIAgentTarget exists
    in the SDK but is consumed by the Evaluation Taxonomy API, not RedTeam.
    
    Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
    
    * Address PR review comments on Step02 SelfReflection
    
    - Pass full prompt (with context) to evaluator messages instead of just
      the question, so evaluator input matches what the agent received
    - Include previous response text in self-reflection refinement prompt
      so the LLM can meaningfully improve its answer across iterations
    - Inline CreateKnowledgeAgent helper (single use, single statement)
    - Add comment clarifying why RunCombinedQualityAndSafetyEvaluation
      intentionally passes only the question (no context)
    
    Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
    
    ---------
    
    Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
    Co-authored-by: rogerbarreto <19890735+rogerbarreto@users.noreply.github.com>
    Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
  • .NET: Inline private RunCoreAsync into the protected one (#3928)
    * inline private RunCoreAsync into the protected one
    
    * minor improvement
  • .NET: Disable intermittently failing AzureAIAgentsPersistent integration tests (#3997)
    * Disable intermittently failing AzureAIAgentsPersistent integration tests
    
    Skip three StructuredOutputRunTests tests that fail intermittently:
    - RunWithGenericTypeReturnsExpectedResultAsync
    - RunWithPrimitiveTypeReturnsExpectedResultAsync
    - RunWithResponseFormatReturnsExpectedResultAsync
    
    Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
    
    * Update dotnet/tests/AzureAIAgentsPersistent.IntegrationTests/AzureAIAgentsPersistentStructuredOutputRunTests.cs
    
    Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
    
    ---------
    
    Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
    Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
  • Python: improve .env handling and observability samples (#4032)
    * Python: improve .env precedence and observability samples
    
    - Switch load_settings to explicit precedence: overrides -> explicit .env -> environment -> defaults\n- Raise when env_file_path is provided but missing\n- Update settings docs and tests for new behavior\n- Refresh observability samples and README guidance for env loading options\n\nCloses #3864\n\nCo-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
    
    * fixed some imports
    
    * Fix load_settings CI regressions
    
    Allow explicit env_file_path values that exist but are not regular files (for example /dev/null) by checking path existence before dotenv parsing, and restore a dict accumulator with typed return cast to satisfy mypy.
    
    Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
    
    * Avoid implicit dotenv in observability
    
    Only load dotenv in observability helpers when env_file_path is explicitly provided, and remove test os.devnull workarounds that are no longer necessary.
    
    Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
    
    ---------
    
    Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
  • Python: Fixed Anthropic and GitHub Copilot samples (#4025)
    * Fixed Anthropic advanced example
    
    * Small improvement
    
    * Simplified skills sample
    
    * Fixed custom agent sample
    
    * Added service_session_id parameter
    
    * Added tests
    
    * Resolved comments
  • Python: Fix Azure AI sample errors (#4021)
    * Python: Fix Azure AI sample errors
    
    - azure_ai_with_application_endpoint: Add missing name to Agent constructor
    - azure_ai_with_file_search: Fix resource path (parents[2] -> parents[3])
    - azure_ai_with_openapi: Fix resource path (parents[2] -> parents[3])
    - azure_ai_with_session: Use get_agent/get_session to reuse existing agent
      version and preserve conversation context across agent instances
    
    * Python: Fix resource paths in azure_ai_agent samples
    
    - azure_ai_with_file_search: Fix path to employees.pdf (parent.parent -> parents[3]/shared)
    - azure_ai_with_openapi_tools: Fix path to weather.json/countries.json (parents[2] -> parents[3])
    
    * fix V1 SDK hosted tools (FileSearchTool, etc.) silently dropped during agent creation
    
    * fix: V2 file search sample uses correct SDK (AIProjectClient instead of AgentsClient)
    
    The azure_ai/azure_ai_with_file_search.py sample incorrectly used the V1
    AgentsClient for file/vector store operations. Replaced with V2 pattern:
    AIProjectClient + get_openai_client() for file upload and vector store
    management, matching the official Azure AI Projects SDK samples.
    
    * fix: use context manager for file open in V2 file search sample
  • Python: Fixed middleware and multimodal input samples (#4022)
    * Fix streaming branch in weather override middleware sample
    
    The streaming branch of weather_override_middleware only prefixed the
    original weather data via a transform hook instead of replacing the
    content with the 'perfect weather' override like the non-streaming
    branch does. Replace with a new ResponseStream that yields the override
    content as ChatResponseUpdate chunks.
    
    Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
    
    * Fixed exception handling middleware sample
    
    * Fixed runtime context delegation middleware example
    
    * Fixed multimodal input examples
    
    * Small update
    
    ---------
    
    Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
  • Python: Improve Azure AI Search package test coverage (#4019)
    * Improve Azure AI Search package test coverage
    
    * Fix pipeline error
  • General Durable Agents documentation (#3972)
    * General Durable Agents documentation
    
    * Add missing Python package references
    
    * Remove invalid GitHub repo URL
  • Python: Durable Support for Workflows (#3630)
    * Add workflow support for Azure Functions
    
    * fix compatability with latest framework changes and add integration tests
    
    * refactor code
    
    * remove white space
    
    Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
    
    * align help text with actual port used
    
    Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
    
    * replace instance id with a place holder
    
    Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
    
    * remove unused import
    
    Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
    
    * remove redundant typing import and fix SIM115
    
    * fix latest breaking changes
    
    * fix mypy issues
    
    * clean up imports
    
    * define source marker strings as constants
    
    * fix json module name
    
    * refactor _extract_message_content_from_dict
    
    * refactor serialization
    
    * add helper method for error response construction and remove _extract_message_content_from_dict since it is not needed
    
    * use strict tpe checking for edges
    
    * change how duplicate agent registrations are handled
    
    * cancel approval_task on HITL timeout
    
    * update docstring
    
    * fix: align azurefunctions package with core API changes after rebase
    
    - State.import_state/export_state are now sync (removed await)
    - Add State.commit() before export_state() in activity execution
    - Rename executor parameter shared_state -> state
    - Rename ctx.set_shared_state/get_shared_state -> set_state/get_state (sync)
    - WorkflowBuilder now takes start_executor as constructor kwarg
    - Update WorkflowOutputEvent -> WorkflowEvent with type='output'
    - Update RequestInfoEvent -> WorkflowEvent[Any]
    - Update SharedState -> State in test imports
    - Update duplicate agent name tests to match new warning behavior
    - Update sample README API references
    
    * fix sample check errors
    
    * fix mypy issues
    
    * fix trailing white spaces
    
    * fix test imports
    
    * feat: add durable workflow samples and adapt to main branch changes
    
    - Add workflow samples 09-12 to 04-hosting/azure_functions/
    - Adapt to ChatMessage -> Message rename from main
    - Adapt to pickle-based checkpoint encoding from main
    - Simplify _serialization.py to delegate to core encode/decode
    - Fix Message -> WorkflowMessage disambiguation in _context.py
    - Remove non-existent _checkpoint_summary import
    
    * fix: update create_checkpoint signature to match superclass
    
    * fix: correct relative link in HITL sample README
    
    * fix: resolve import breakage after rebase (State, DurableAgentThread, get_logger)
    
    ---------
    
    Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
    Co-authored-by: Dmytro Struk <13853051+dmytrostruk@users.noreply.github.com>
  • Python: Add missing system instruction attr to invoke_agent span (#4012)
    * Add missing sysmte instruction attr to invoke_agent span
    
    * Temp remove azure search gate
    
    * fix pipeline error