Commit Graph

1952 Commits

  • Python: Bump Python package versions for 1.2.0 release (#5468)
    * Bump Python package versions for 1.2.0 release
    
    Released tier bumps 1.1.1 -> 1.2.0 (core, openai, foundry, root) to
    reflect additive public APIs landed since 1.1.0: functional workflow API
    (#4238) and FunctionTool SKIP_PARSING sentinel (#5424). All beta packages
    stamped 1.0.0b260424, alpha packages 1.0.0a260424. All 26 non-core
    agent-framework-core floors raised to >=1.2.0,<2. CHANGELOG consolidates
    the never-tagged 1.1.1 entries with the post-merge additions into [1.2.0].
    
    * Update CHANGELOG footer links for 1.2.0
    
    Advance [Unreleased] comparison base from python-1.1.0 to python-1.2.0
    and add a [1.2.0] reference link comparing python-1.1.0...python-1.2.0
    so the heading links resolve correctly.
    
    * Fix CHANGELOG: restore [1.1.1] section and add proper [1.2.0]
    
    Previous commit incorrectly renamed the [1.1.1] header to [1.2.0], which
    wiped the historical 1.1.1 entries and wrongly attributed them to 1.2.0.
    This restores [1.1.1] to its origin/main content and adds a new [1.2.0]
    section above containing only the commits in python-1.1.1..HEAD:
    
    - #4238 functional workflow API
    - #5142 GitHub Copilot OpenTelemetry
    - #2403 A2A bridge support
    - #5070 oauth_consent_request events in Foundry clients
    - #5447 FoundryAgent hosted agent sessions
    - #5459 hosting server dependency upgrade + types
    - #5389 AG-UI reasoning/multimodal parsing fix
    - #5440 stop [TOOLBOXES] warning spam
    - #5455 user agent prefix fix
    
    Also corrects the [1.2.0] compare base to python-1.1.1 (not 1.1.0) and
    adds the missing [1.1.1] reference link.
  • Python: Surface oauth_consent_request events from Responses API in Foundry clients (#5070)
    * Fix Foundry clients not surfacing oauth_consent_request events (#5054)
    
    Override _parse_chunk_from_openai in both RawFoundryChatClient and
    RawFoundryAgentChatClient to intercept response.output_item.added
    events with item.type == 'oauth_consent_request'. The consent link
    is validated (HTTPS required) and converted to
    Content.from_oauth_consent_request, which the AG-UI layer already
    knows how to emit as a CUSTOM event.
    
    Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
    
    * Address PR review feedback for #5054 OAuth consent parsing
    
    - Extract shared helper (try_parse_oauth_consent_event) to avoid
      duplicated logic between RawFoundryChatClient and
      RawFoundryAgentChatClient
    - Use urllib.parse.urlparse() for HTTPS validation instead of
      case-sensitive startswith check
    - Sanitize log messages to avoid leaking consent_link tokens;
      log only item id
    - Add model=self.model to ChatResponseUpdate to match parent behavior
    - Add assertions on role, raw_representation, and model in happy-path
      tests
    - Add test for empty-string consent_link
    - Add test verifying non-oauth events delegate to super()
    
    Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
    
    * Handle response.oauth_consent_requested top-level event (#5054)
    
    Add support for the top-level response.oauth_consent_requested stream
    event in addition to the response.output_item.added variant. The
    service may emit either form; handle both so the consent link is
    reliably surfaced.
    
    Extract _validate_consent_link helper within _oauth_helpers.py to
    reduce nesting.
    
    Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
    
    * Address review feedback for #5054: Python: [Bug]: `FoundryAgent` (Responses API) Does Not Surface `oauth_consent_request` as a CUSTOM AG-UI Event
    
    * Address review feedback: defensive getattr and dedicated helper tests (#5054)
    
    - Use getattr(event, 'type', None) in try_parse_oauth_consent_event
      for defensive access against malformed events without a type attribute
    - Add test_oauth_helpers.py with unit tests for _validate_consent_link
      and try_parse_oauth_consent_event covering edge cases:
      - HTTPS URL with empty netloc (https:///path)
      - Warning log messages for rejected consent links
      - Event objects missing 'type' attribute
    
    Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
    
    * Address review feedback for #5054: Python: [Bug]: `FoundryAgent` (Responses API) Does Not Surface `oauth_consent_request` as a CUSTOM AG-UI Event
    
    * Fix mypy: match _parse_chunk_from_openai signature with superclass
    
    Add seen_reasoning_delta_item_ids parameter to _parse_chunk_from_openai
    overrides in both RawFoundryChatClient and RawFoundryAgentChatClient to
    match the updated superclass signature on main. Update super() calls and
    test assertions accordingly.
    
    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>
    Co-authored-by: Evan Mattson <evan.mattson@microsoft.com>
  • Python: (core): Add functional workflow API (#4238)
    * Add functional workflow api
    
    * cleanup
    
    * More cleanup
    
    * address copilot feedback
    
    * Address PR feedbacK
    
    * updates
    
    * PR feedback
    
    * Address review comments on functional workflow samples
    
    - Swap 05/06 get-started samples: agent workflow first (motivates
      why workflows exist), simple text workflow second
    - Rename text_pipeline → text_workflow, poem_pipeline → poem_workflow
    - Add @step to agent workflow sample (05) to demonstrate caching
    - Switch agent samples to AzureOpenAIResponsesClient with Foundry
    - Remove .as_agent() from agent_integration.py to focus on the key
      difference between inline agent calls vs @step-cached calls
    - Add commented-out Agent.run example in hitl_review.py
    - Add clarifying comment in _functional.py that event streaming is
      buffered (not true per-token streaming)
    - Add naive_group_chat.py functional sample: round-robin group chat
      as a plain Python loop
    - Update READMEs to reflect new file names and group chat sample
    
    Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
    
    * Fix pyright type errors
    
    * Address PR review comments on functional workflow API
    
    1. Allow request_info inside @step: Auto-inject RunContext into step
       functions that declare a RunContext parameter (by type or name 'ctx'),
       and expose get_run_context() for programmatic access.
    
    2. Handle None responses: Log a warning when a response value is None,
       and document the behavior in request_info docstring.
    
    3. Add executor_bypassed event type: Replace executor_invoked +
       executor_completed with a single executor_bypassed event when a step
       replays from cache, making cached vs live execution explicit.
    
    Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
    
    * Add regression tests for PR review comments on functional workflow API
    
    The three review comments (request_info in @step, None response handling,
    executor_bypassed event type) were already addressed in 7da7db4e. This
    commit adds cross-cutting regression tests that exercise the interactions
    between these features:
    
    - HITL in step with caching: preceding step bypassed on resume
    - Full checkpoint lifecycle with HITL step (interrupt -> resume -> restore)
    - None response inside step-level request_info logs warning
    - WorkflowInterrupted from step does not emit executor_failed
    
    Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
    
    * Address PR #4238 review comments on functional workflow API
    
    Comment 1 (request_info in @step): Already supported. Added comment in
    StepWrapper.__call__ explaining why WorkflowInterrupted (BaseException)
    safely bypasses the except Exception handler.
    
    Comment 2 (None response): Added docstring to _get_response clarifying
    the (found, value) return tuple semantics and None handling.
    
    Comment 3 (bypass event type): executor_bypassed is already a dedicated
    event type in WorkflowEventType. Updated comment at the bypass site to
    make the deliberate event type choice explicit.
    
    Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
    
    * Add experimental API warnings to functional workflow module
    
    Mark all public classes and decorators (workflow, step, RunContext,
    FunctionalWorkflow, StepWrapper, FunctionalWorkflowAgent) as
    experimental and subject to change or removal.
    
    * Address PR #4238 review comments from @eavanvalkenburg
    
    - RunContext docstring leads with purpose (opt-in handle for HITL,
      custom events, state) so readers importing it from the public surface
      understand its role before the mechanics (#2993513452).
    - Rename `06_first_functional_workflow.py` to
      `06_functional_workflow_basics.py`; the previous filename was
      confusing since it followed `05_functional_workflow_with_agents.py`
      (#2993531979).
    - Simplify `05_functional_workflow_with_agents.py` to call agents
      directly without a @step wrapper; the step-vs-no-step contrast lives
      in `03-workflows/functional/agent_integration.py`, keeping the
      get-started sample minimal (#2993525532).
    - Switch functional samples to `FoundryChatClient` for consistency with
      the rest of 01-get-started and 03-workflows (follow-up on #2876988570).
    - Use walrus in `hitl_review.py` final-state assertion (#2993572182).
    - Add expected-output block to `basic_streaming_pipeline.py` (#2993557609).
    - Clarify in `parallel_pipeline.py` that `@step` composes with
      `asyncio.gather` (#2993597282).
    - `naive_group_chat.py` threads `list[Message]` between turns instead
      of stringifying the transcript, preserving role/authorship (#2993583231).
    
    Drive-by: pre-commit hook sorts an unrelated import block in
    `samples/04-hosting/foundry-hosted-agents/responses/02_local_tools/main.py`.
    
    * Fix 10 functional-workflow API bugs from /ultrareview pass
    
    - bug_001: `ctx.request_info()` without an explicit `request_id` now derives
      a deterministic `auto::<index>` id from the call-counter, so HITL resume
      works correctly on the documented default path.  A uuid was regenerated on
      every replay, making resume impossible.
    
    - bug_002: `StepWrapper.__call__` no longer deepcopies arguments on the
      cache-hit replay branch.  The copy is only performed on the live-execution
      path (for the event log) and falls back to the original mapping if deepcopy
      fails, so steps whose args aren't deepcopyable (locks, sockets, sessions)
      can still resume from checkpoint.
    
    - bug_007: `_set_responses` now prunes each resolved `request_id` from
      `_pending_requests`, and the cache-hit branch in `request_info` does the
      same.  Previously, answered requests were re-serialized into every
      subsequent checkpoint and the final checkpoint falsely claimed pending
      requests even after the workflow completed.
    
    - bug_008: `_compute_signature_hash` now mixes the function's `co_code` and
      `co_names` into the checkpoint signature, so changes to the workflow body
      invalidate older checkpoints even when steps are accessed via module /
      class attributes (which `_discover_step_names` can't see statically).
      `RunContext._record_observed_step` records observed step names for
      diagnostics.
    
    - bug_010: `FunctionalWorkflow.run()` docstring corrected — says "at least
      one of message/responses/checkpoint_id" and explicitly notes `responses`
      may be combined with `checkpoint_id` (the validator already allowed this).
    
    - bug_013: `FunctionalWorkflowAgent` now surfaces `request_info` events as
      `FunctionApprovalRequestContent` items (mirroring graph `WorkflowAgent`),
      threads `responses=` and `checkpoint_id=` through to the underlying
      workflow, and exposes `pending_requests`.  Previously `.as_agent()`
      returned empty `AgentResponse` for HITL workflows — effectively unusable.
    
    - bug_014: `FunctionalWorkflow` now clears `_last_message`,
      `_last_step_cache`, and `_last_pending_request_ids` on clean completion.
      `run()` validates that `responses=` keys intersect the currently-pending
      request set (or raises with a clear error) instead of silently replaying
      against stale singleton state from a prior run.
    
    - bug_015: `FunctionalWorkflow.as_agent` signature now matches graph
      `Workflow.as_agent`: accepts `name`, `description`, `context_providers`,
      and `**kwargs`.  `FunctionalWorkflowAgent` stores the overrides.
    
    - bug_017: `RunContext.set_state` raises `ValueError` for underscore-
      prefixed keys (the framework's `_step_cache` / `_original_message` keys
      would silently clobber user state on checkpoint save and user
      underscore-prefixed state was dropped on restore).  Docstring documents
      the reserved prefix.
    
    - merged_bug_003: Workflow function arity is validated at decoration time.
      Multiple non-ctx parameters raise `ValueError` immediately (previously
      every arg past the first was silently dropped at call time).  Passing a
      non-None `message` to a ctx-only workflow raises `ValueError` instead of
      silently discarding the message.
    
    Test coverage: +18 regression tests covering every fix.  Full workflow
    suite now 766 passed, 1 skipped, 2 xfailed; full core suite 2338 passed.
    
    * Deslop functional.py fix commit
    
    - Remove dead instrumentation added in the prior commit that was never
      consumed: `RunContext._observed_step_names`,
      `RunContext._record_observed_step`, `FunctionalWorkflow._runtime_step_names`,
      and `FunctionalWorkflowAgent._extra_kwargs`.  The signature hash relies on
      `co_code` alone, which covers the attribute-access case without the
      collection-scaffolding.
    - Trim over-explanatory comments that restated what the code does or what
      it no longer does.  Keep only the comments that answer "why" for the
      non-obvious bits (deterministic id contract, defensive deepcopy, stale
      replay guard).
    - Compress the `_compute_signature_hash` and FunctionalWorkflow `__init__`
      block docstrings without losing the user-facing reasoning.
    
    Net -49 lines.  Regression lock preserved (766 passed, 1 skipped, 2 xfailed).
    
    * Fix functional workflow review feedback
    
    ---------
    
    Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
    Co-authored-by: Copilot <copilot@github.com>
  • Python: update FoundryAgent for hosted agent sessions (#5447)
    * fixes to FoundryAgent to connect to new hosted agents
    
    Co-authored-by: Copilot <copilot@github.com>
    
    * fix mypy
    
    Co-authored-by: Copilot <copilot@github.com>
    
    * Python: remove Foundry service session helpers
    
    Remove the public hosted-agent service session CRUD helpers from FoundryAgent and drop the related feature-stage inventory entry.
    
    Update the hosted-agent sample to create and delete service sessions directly through the preview AIProjectClient APIs, and tighten a few test harnesses surfaced by full workspace validation.
    
    Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
    
    * fix from merge
    
    * fix hosted env detection
    
    Co-authored-by: Copilot <copilot@github.com>
    
    * reverted sample update
    
    * fix tests and code
    
    Co-authored-by: Copilot <copilot@github.com>
    
    * remove aenter
    
    * skipping some tests
    
    Co-authored-by: Copilot <copilot@github.com>
    
    ---------
    
    Co-authored-by: Copilot <copilot@github.com>
    Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
  • Python: Add OpenTelemetry integration for GitHubCopilotAgent (#5142)
    * Python: Add OpenTelemetry integration for GitHubCopilotAgent
    
    - Split GitHubCopilotAgent into RawGitHubCopilotAgent (core, no OTel) and
      GitHubCopilotAgent(AgentTelemetryLayer, RawGitHubCopilotAgent) with tracing
    - Add default_options property to expose model for span attributes
    - Export RawGitHubCopilotAgent from all public namespaces
    - Add github_copilot_with_observability.py sample and update README
    
    * Python: Fix OTEL_SERVICE_NAME default in GitHub Copilot README
    
    Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
    
    * Python: Add unit tests for RawGitHubCopilotAgent.default_options property
    
    * Python: Address review feedback on GitHubCopilotAgent OTel integration
    
    - Add middleware param to GitHubCopilotAgent.run() overloads so per-call
      middleware is explicitly forwarded through AgentTelemetryLayer
    - Remove github_copilot_with_observability.py sample per feedback; replace
      with inline snippet + link to observability samples in README
    
    * Python: Address review feedback on log_level and session kwargs typing
    
    - Add middleware param to RawGitHubCopilotAgent.run() overloads for interface
      compatibility with AgentTelemetryLayer
    - Fix import in README observability snippet to use agent_framework.github
    
    * Python: Add AgentMiddlewareLayer to GitHubCopilotAgent MRO
    
    Follow FoundryAgent pattern: AgentMiddlewareLayer runs outside the telemetry
    span so middleware execution time is not captured in traces. Overloads removed
    as AgentMiddlewareLayer.run() handles dispatch via MRO.
    
    * Python: Add explicit __init__ to GitHubCopilotAgent for auto-complete and docstrings
    
    * Python: Address review feedback on middleware warning and test assertions
    
    - Add assert "timeout" not in opts to test_default_options_includes_model_for_telemetry
      to document the intentional asymmetry where timeout is extracted into _settings
      and not returned in default_options.
    - Replace silent del middleware with a logged warning when per-run middleware is
      passed to RawGitHubCopilotAgent, making it clear that the GitHub Copilot SDK
      handles tool execution internally and chat/function middleware cannot be injected.
    
    * Python: Use Self for __aenter__ return type in RawGitHubCopilotAgent
    
    Address review feedback: use typing.Self (3.11+) / typing_extensions.Self
    (3.10) for __aenter__ so subclasses like GitHubCopilotAgent get the correct
    return type from async context manager usage.
    
    ---------
    
    Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
  • Python: feat: Add Agent Framework to A2A bridge support (#2403)
    * feat: Add Agent Framework to A2A bridge support
    
    - Implement A2A event adapter for converting agent messages to A2A protocol
    - Add A2A execution context for managing agent execution state
    - Implement A2A executor for running agents in A2A environment
    - Add comprehensive unit tests for event adapter, execution context, and executor
    - Update agent framework core A2A module exports and type stubs
    - Integrate thread management utilities for async execution
    - Add getting started sample for A2A agent framework integration
    - Update dependencies in uv.lock
    
    This integration enables agent framework agents to communicate and execute within the A2A (Agent to Agent) infrastructure.
    
    * fix: Update references from agent_thread_storage to _agent_thread_storage in A2A executor tests
    
    * Refactor A2A agent framework and improve code structure
    
    - Reordered imports in various files for consistency and clarity.
    - Updated `__all__` definitions to maintain a consistent order across modules.
    - Simplified method signatures by removing unnecessary line breaks.
    - Enhanced readability by adjusting formatting in several sections.
    - Removed redundant comments and example scenarios in the execution context.
    - Improved handling of agent messages in the event adapter.
    - Added type hints for better clarity and type checking.
    - Cleaned up test cases for better organization and readability.
    
    * fix: Lint fix new line added
    
    * test: Add unit tests for AgentThreadStorage and InMemoryAgentThreadStorage
    
    * refactor: Update type hints to use new syntax for Union and List
    
    * fix: Validate RequestContext for context_id and message before execution
    
    * Refactor tests and remove A2aExecutionContext references
    
    - Deleted the test file for A2aExecutionContext as it is no longer needed.
    - Updated A2aExecutor tests to remove dependencies on A2aExecutionContext and adjusted method calls accordingly.
    - Modified event adapter tests to use ChatMessage instead of AgentRunResponseUpdate.
    - Removed A2aExecutionContext from imports in agent_framework.a2a module and updated type hints accordingly.
    
    * Refactor A2AExecutor tests and remove event adapter
    
    - Updated test cases to use A2AExecutor instead of A2aExecutor for consistency.
    - Removed mock_event_adapter fixture and related tests as A2aEventAdapter is deprecated.
    - Consolidated event handling tests into TestA2AExecutorEventAdapter.
    - Adjusted imports in various files to reflect the removal of deprecated components.
    - Ensured all references to A2aExecutor are updated to A2AExecutor across the codebase.
    
    * refactor: Remove AgentThreadStorage and InMemoryAgentThreadStorage classes from threads and tests
    
    * feat: A2AExecutor to have its own override able save and get threads methods for persistent storage.
    
    * fix: linter bugs
    
    * removed unnecessary changes form core package
    
    * new line added
    
    * Refactor A2AExecutor tests and update imports
    
    - Consolidated mock agent fixtures in test_a2a_executor.py to simplify agent mocking.
    - Removed redundant tests related to thread storage and agent types, focusing on A2AExecutor's core functionality.
    - Updated test assertions to reflect changes in message handling with new Message and Content classes.
    - Enhanced integration tests to ensure compatibility with the new agent framework structure.
    - Added A2AExecutor to the module exports in __init__.py and __init__.pyi for better accessibility.
    
    * Update A2A documentation: enhance usage examples for A2AAgent and A2AExecutor
    
    * Updated uv lock
    
    * Fix metadata assertion in TestA2AExecutorHandleEvents and reorder load_dotenv call in agent_framework_to_a2a.py
    
    * Update agent card configuration: add default input and output modes, and fix agent creation method
    
    * Fix assertion for metadata in TestA2AExecutorHandleEvents
    
    * Fix formatting issues in TestA2AExecutorExecute and TestA2AExecutorIntegration
    
    * Enhance A2AExecutor documentation with examples and clarify agent execution process
    
    * Revert uv lock to main
    
    * Refactor A2AExecutor: Improve formatting and streamline constructor parameters
    
    * Apply suggestions from code review
    
    Co-authored-by: Eduard van Valkenburg <eavanvalkenburg@users.noreply.github.com>
    
    * Refactor A2AExecutor to use SupportsAgentRun and enhance logging; update agent framework sample for flight and hotel booking capabilities
    
    * Enhance A2AExecutor with streaming support and custom run arguments; update tests for initialization and execution scenarios
    
    * Enhance A2AExecutor event handling with streamed artifact tracking; update tests for new behavior
    
    * Refactor A2AExecutor to enforce type hints for stream and run_kwargs attributes
    
    * Refactor A2AExecutor and tests: replace AsyncMock with MagicMock for response stream handling; clean up imports in agent_framework_to_a2a.py
    
    * refactor: streamline imports and improve code readability across multiple files
    
    * feat: enhance A2AExecutor cancel method with context validation and fixed review comments
    
    * feat: implement get_uri_data utility function for extracting base64 data from data URIs and update references
    
    * fix: update import path for get_uri_data utility function in A2AExecutor and A2AAgent
    
    * fix: correct error message handling in A2AExecutor and update test assertions
    
    ---------
    
    Co-authored-by: Eduard van Valkenburg <eavanvalkenburg@users.noreply.github.com>
  • Python: Upgrade hosting server dependency and add more type support (#5459)
    * Upgrade hosting server dependency and add more type support
    
    * Comments
  • Python: Fix AG-UI reasoning role and multimodal media parsing to follow specification (#5389)
    * Fix AG-UI reasoning role and multimodal media value field parsing
    
    Fix two spec compliance issues in the AG-UI integration:
    
    1. ReasoningMessageStartEvent now uses role='reasoning' instead of
       role='assistant', matching the AG-UI specification for reasoning
       messages.
    
    2. _parse_multimodal_media_part now reads the 'value' field from source
       dicts (with fallback to 'data' for backward compatibility), matching
       the current AG-UI InputContentSource specification.
    
    Bump ag-ui-protocol dependency from ==0.1.13 to >=0.1.16,<0.2 to pick
    up the SDK fix that accepts role='reasoning' in ReasoningMessageStartEvent.
    
    Fix pre-existing pyright reportMissingImports errors for orjson in sample
    files, and fix import ordering in foundry-hosted-agents sample.
    
    Fixes #5340
    
    Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
    
    * Python: Fix AG-UI reasoning role and multimodal media parsing to follow specification
    
    Fixes #5340
    
    * Remove unintended .maf-runtime-ready marker file
    
    Address PR review feedback: the .maf-runtime-ready file is not referenced anywhere in the repo and was left over from automation.
    
    Fixes #5340
    
    * Python: Fix duplicate AG-UI multimodal 'value' parsing in snapshot path
    
    The snapshot normalization path used a second copy of the multimodal source
    parsing logic that still read the deprecated 'data' field. When clients sent
    base64 media with source={"type": "base64", "value": ...}, the snapshot event
    emitted by the server dropped the payload, causing AG-UI-compatible clients
    to crash on ingest.
    
    Extract the shared source-field extraction into _extract_multimodal_source_fields
    so both _parse_multimodal_media_part and the snapshot _legacy_binary_part stay
    in sync with the AG-UI spec. Add snapshot-path regression tests covering
    value-only, value-preferred-over-data, and the legacy data-field fallback.
    
    Addresses review feedback on #5389 from @Rickyneer.
    
    ---------
    
    Co-authored-by: Copilot <copilot@github.com>
    Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
  • Python: Fix user agent prefix (#5455)
    * Fix hosting user agent missing
    
    * Fix other providers
    
    * Add more tests
    
    * comments
    
    * Fix tests
  • Python: (foundry): stop emitting [TOOLBOXES] warning for every FoundryChatClient call (#5440)
    * Python: Foundry: make response tool sanitizer internal, drop TOOLBOXES warning
    
    sanitize_foundry_response_tool runs on every tool passed to the Foundry
    Responses API, so its @experimental(TOOLBOXES) decorator was emitting a
    [TOOLBOXES] ExperimentalWarning for any FoundryChatClient call, even when
    no toolbox was involved. The function isn't in __all__ and has no external
    callers. Rename to _sanitize_foundry_response_tool and drop the decorator;
    the actual toolbox-facing public helpers remain gated.
    
    * Python: Foundry: silence pyright on intentional cross-module private import
  • .NET: dotnet: Add server-side Foundry Toolbox support and fix SDK beta.4 br… (#5450)
    * dotnet: Add server-side Foundry Toolbox support and fix SDK beta.4 breaking changes
    
    Add FoundryToolbox and AIProjectClient extensions to Microsoft.Agents.AI.Foundry.Hosting
    for server-side toolbox tool integration matching Python's FoundryChatClient.get_toolbox()
    pattern. Tools are fetched from the Foundry project SDK and passed as server-side tools
    in the Responses API request.
    
    New files:
    - FoundryToolbox.cs: Core implementation using AgentAdministrationClient SDK
    - AIProjectClientToolboxExtensions.cs: Extension methods on AIProjectClient
    - Agent_Step25_ToolboxServerSideTools sample with create helper and combine flow
    - 19 unit tests covering param validation, conversion, sanitization, and extensions
    
    SDK breaking changes (Azure.AI.AgentServer.Responses beta.3 -> beta.4):
    - FunctionToolCallOutputResource renamed to OutputItemFunctionToolCallOutput
    - AzureAIAgentServerResponsesModelFactory made internal, replaced with direct constructors
    - ResponseUsage constructor now requires non-null token details parameters
    
    Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
    
    * fix: reuse endpoint variable in CreateSampleToolboxAsync
    
    Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
    
    * fix: pass endpoint through static local functions to avoid capture
    
    Static local functions cannot capture top-level variables. Thread the
    endpoint parameter through Main, CombineToolboxes, and CreateSampleToolboxAsync.
    
    Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
    
    * refactor: remove unused projectClient param from CreateSampleToolboxAsync
    
    Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
    
    * Update dotnet/samples/02-agents/AgentsWithFoundry/Agent_Step25_ToolboxServerSideTools/README.md
    
    Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
    
    * Update dotnet/samples/02-agents/AgentsWithFoundry/Agent_Step25_ToolboxServerSideTools/Program.cs
    
    Co-authored-by: westey <164392973+westey-m@users.noreply.github.com>
    
    * Update dotnet/samples/02-agents/AgentsWithFoundry/Agent_Step25_ToolboxServerSideTools/Program.cs
    
    Co-authored-by: westey <164392973+westey-m@users.noreply.github.com>
    
    * Removing GetToolbocVersion.
    
    * Removing tests for GetToolboxVersion
    
    * fix: map cached/reasoning token counts in ConvertUsage instead of hardcoding zeros
    
    Extract InputTokenDetails.CachedTokenCount and OutputTokenDetails.ReasoningTokenCount
    from UsageDetails.AdditionalCounts, matching the pattern in AgentResponseExtensions.
    Also accumulate detail counts when merging with existing usage.
    
    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>
    Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
    Co-authored-by: westey <164392973+westey-m@users.noreply.github.com>
  • .NET: Add streaming support to A2A agent handler (#5427)
    * update a2a agent to the latest a2a sdk (#5257)
    
    * Move A2A samples from 04-hosting to 02-agents (#5267)
    
    Move the A2A sample projects (A2AAgent_AsFunctionTools and
    A2AAgent_PollingForTaskCompletion) from samples/04-hosting/A2A/ to
    samples/02-agents/A2A/ to better align with the sample directory
    structure. Update solution file and samples README accordingly.
    
    Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
    
    * .NET: Fix stream reconnection for A2AAgent (#5275)
    
    * Add SSE stream reconnection support to A2AAgent
    
    Implement automatic reconnection for SSE streams that disconnect mid-task,
    using the Last-Event-ID header to resume from where the stream left off.
    
    Changes:
    - Add InvokeStreamingWithReconnectAsync method to A2AAgent with configurable
      max retries and delay between attempts
    - Add new log messages for reconnection events
    - Add A2AAgent_StreamReconnection sample demonstrating the feature
    - Update existing polling sample to use simplified SendMessageAsync API
    - Add unit tests for stream reconnection logic
    
    Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
    
    * address comments
    
    * Address PR review feedback
    
    - Dispose SSE enumerator before GetTaskAsync fallback to release HTTP connection
    - Wrap StreamWriter in using blocks with leaveOpen:true and explicit UTF-8 encoding
    - Print update.Text instead of update object in stream reconnection sample
    
    Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
    
    ---------
    
    Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
    
    * .NET: Use IA2AClientFactory to create A2AClient (#5277)
    
    * Refactor A2A extensions to use IA2AClientFactory and add ProtocolSelection sample
    
    - Update A2AAgentCardExtensions to accept IA2AClientFactory instead of A2AClientOptions
    - Update A2ACardResolverExtensions to accept IA2AClientFactory
    - Update A2AClientExtensions to accept IA2AClientFactory
    - Update A2AAgent to use IA2AClientFactory for client creation
    - Add A2AAgent_ProtocolSelection sample demonstrating protocol selection
    - Add comprehensive unit tests for all changes
    - Update README files with new sample reference
    
    Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
    
    * Reorder params: options before loggerFactory in A2A extensions
    
    Move A2AClientOptions parameter before ILoggerFactory in AsAIAgent
    and GetAIAgentAsync extension methods to follow the repo convention
    of keeping LoggerFactory and CancellationToken as the last parameters.
    
    Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
    
    ---------
    
    Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
    
    * .NET: Migrate A2A hosting to A2A SDK v1 (#5363)
    
    * .NET: Migrate A2A hosting to A2A SDK v1
    
    Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
    
    * remove unused agent card
    
    ---------
    
    Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
    
    * .NET: Split A2A endpoint mapping into protocol-specific methods (#5413)
    
    * .NET: Refactor A2A hosting registration into A2AServerServiceCollectionExtensions
    
    - Rename A2AHostingOptions to A2AServerRegistrationOptions
    - Move server registration logic from A2AEndpointRouteBuilderExtensions
      and AIAgentExtensions into new A2AServerServiceCollectionExtensions
    - Remove A2AProtocolBinding and AIAgentExtensions (consolidated)
    - Update samples and tests to use the new registration API
    
    Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
    
    * address copilot comments
    
    ---------
    
    Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
    
    * Remove unnecessary using directive in AgentWebChat.AgentHost
    
    Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
    
    * restore AsyncEnumerable package version
    
    * address copilot initial feedback
    
    * address automated code review and formatting issues
    
    * fix formatting issues
    
    * Add streaming support to A2A agent handler
    
    Add HandleNewMessageStreamingAsync to A2AAgentHandler that routes
    StreamingResponse requests through RunStreamingAsync, enqueuing an A2A
    Message for each AgentResponseUpdate.
    
    Add MessageConverter.ToParts(AgentResponseUpdate) extension to convert
    streaming update contents to A2A Parts with unsupported-content filtering.
    
    Add CreateMessageFromUpdate to map AgentResponseUpdate to A2A Message.
    
    Add 16 new tests covering the streaming path and converter.
    
    Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
    
    * Add streaming edge-case tests for A2AAgentHandler
    
    Add two tests covering gaps in the streaming path:
    
    - ExecuteAsync_Streaming_WhenNoUpdates_EnqueuesNoMessagesAndSavesSessionAsync:
      Verifies that when RunStreamingAsync yields an empty async enumerable,
      no messages are enqueued and only SaveSessionAsync runs.
    
    - ExecuteAsync_Streaming_CancellationTokenIsPropagatedToRunStreamingAsyncAsync:
      Verifies that the CancellationToken from ExecuteAsync is propagated
      through to the inner agent's RunCoreStreamingAsync call.
    
    Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
    
    * address copilot comments
    
    ---------
    
    Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
  • .NET: Fix off-thread RunStatus race where GetStatusAsync can return Running after ResumeAsync halts (#5412)
    * Fix off-thread RunStatus race where GetStatusAsync can return Running after ResumeAsync halts
    
    * Apply suggestion from @Copilot
    
    Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
    
    * Simplify test comment.
    
    ---------
    
    Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
  • .NET: Add dynamic tool expansion sample (#5425)
    * Add dynamic tool expansion sample
    
    * Address PR comments
    
    * Remove tool names from tool call response to avoid confusing LLM
  • .NET: Update Aspire package to be preview (#5444)
    * Update Aspire package to be preview
    
    * Also update readme file
    
    * Include README.md in pack
  • Propagate integration-test model credentials to issue-triage repro (#5443)
    Scopes the triage job to the integration GitHub Environment, adds
    the azure/login OIDC step, and exposes the same OpenAI / Azure
    OpenAI / Foundry / Anthropic env vars the integration test
    workflow uses. This lets the triage agent write repro code that
    constructs model clients from the environment without any secrets
    entering the agent prompt or generated-code literals.
    
    Azure OpenAI and Foundry continue to authenticate via AAD
    (DefaultAzureCredential), so there is no API key to leak for
    those providers.
  • Automated issue triage workflow (#5419)
    * Automated issue triage workflow
    
    * Bump dependencies
    
    * Fix issue-triage workflow: security, reliability, and testability
    
    Address six review comments on the issue-triage workflow:
    
    1. Change trigger from issues:opened to issues:labeled so the
       secret-backed triage flow is only triggered by a maintainer-
       controlled signal.
    
    2. Include inputs.issue_number in the concurrency group so
       workflow_dispatch runs for the same issue are properly
       de-duplicated.
    
    3. Improve team membership error handling to fail closed: verify
       the team exists before checking membership, and only treat a
       404 as 'not a member' (all other errors fail the job).
    
    4. Use optional chaining (issue.user?.login) for the API-fetched
       issue to handle deleted GitHub accounts without crashing.
    
    5. Extract the inline github-script into a testable module at
       .github/scripts/check_team_membership.js with 10 tests in
       .github/tests/test_check_team_membership.js covering all
       code paths (payload/API author resolution, deleted accounts,
       team lookup failure, 404 vs non-404 membership errors).
    
    6. Make the spam gate actually stop the job by exiting non-zero
       instead of just logging, so future steps cannot accidentally
       run for spam issues.
    
    Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
    
    * Make issue-triage workflow manually triggered only for initial testing
    
    Remove the 'issues' event trigger, keeping only 'workflow_dispatch' so the
    workflow can be tested manually before enabling automatic triggers.
    
    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: (chore): update changelog (#5438)
    * update changelog
    
    * Update python/CHANGELOG.md
    
    Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
    
    * Update python/CHANGELOG.md
    
    Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
    
    ---------
    
    Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
  • Python: Hyperlight: thread-confine sandbox, skip parsing on host callbacks, schema/tool cleanup (#5424)
    * improved parsing of tool call results and tweaks
    
    * Address PR review: skip_parsing flag, broader registry close, comment fix
    
    - FunctionTool.invoke now takes a boolean skip_parsing flag instead of the
      SKIP_PARSING sentinel; the sentinel is still accepted as result_parser at
      construction time to opt out of parsing for every call. The two paths are
      equivalent.
    - _SandboxRegistry.close now invokes any sandbox close/shutdown hook on the
      entry's own worker thread (PyO3 unsendable), then shuts the worker down,
      then cleans up the per-entry temporary directories.
    - Clarified the _SandboxWorker.shutdown comment to describe the actual
      ThreadPoolExecutor.shutdown(wait=False, cancel_futures=False) semantics.
    - Hyperlight host callback uses skip_parsing=True (the new flag).
    
    Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
    
    * Drop redundant 'is not SKIP_PARSING' guard that mypy 1.x flags
    
    After callable(configured_parser) the sentinel is already excluded; the extra
    identity check tripped mypy's non-overlapping identity warning.
    
    Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
    
    * fixed sandbox working on copy of tool
    
    ---------
    
    Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
  • .NET: [Breaking] Migrate A2A agent and hosting to A2A SDK v1 (#5423)
    * update a2a agent to the latest a2a sdk (#5257)
    
    * Move A2A samples from 04-hosting to 02-agents (#5267)
    
    Move the A2A sample projects (A2AAgent_AsFunctionTools and
    A2AAgent_PollingForTaskCompletion) from samples/04-hosting/A2A/ to
    samples/02-agents/A2A/ to better align with the sample directory
    structure. Update solution file and samples README accordingly.
    
    Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
    
    * .NET: Fix stream reconnection for A2AAgent (#5275)
    
    * Add SSE stream reconnection support to A2AAgent
    
    Implement automatic reconnection for SSE streams that disconnect mid-task,
    using the Last-Event-ID header to resume from where the stream left off.
    
    Changes:
    - Add InvokeStreamingWithReconnectAsync method to A2AAgent with configurable
      max retries and delay between attempts
    - Add new log messages for reconnection events
    - Add A2AAgent_StreamReconnection sample demonstrating the feature
    - Update existing polling sample to use simplified SendMessageAsync API
    - Add unit tests for stream reconnection logic
    
    Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
    
    * address comments
    
    * Address PR review feedback
    
    - Dispose SSE enumerator before GetTaskAsync fallback to release HTTP connection
    - Wrap StreamWriter in using blocks with leaveOpen:true and explicit UTF-8 encoding
    - Print update.Text instead of update object in stream reconnection sample
    
    Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
    
    ---------
    
    Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
    
    * .NET: Use IA2AClientFactory to create A2AClient (#5277)
    
    * Refactor A2A extensions to use IA2AClientFactory and add ProtocolSelection sample
    
    - Update A2AAgentCardExtensions to accept IA2AClientFactory instead of A2AClientOptions
    - Update A2ACardResolverExtensions to accept IA2AClientFactory
    - Update A2AClientExtensions to accept IA2AClientFactory
    - Update A2AAgent to use IA2AClientFactory for client creation
    - Add A2AAgent_ProtocolSelection sample demonstrating protocol selection
    - Add comprehensive unit tests for all changes
    - Update README files with new sample reference
    
    Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
    
    * Reorder params: options before loggerFactory in A2A extensions
    
    Move A2AClientOptions parameter before ILoggerFactory in AsAIAgent
    and GetAIAgentAsync extension methods to follow the repo convention
    of keeping LoggerFactory and CancellationToken as the last parameters.
    
    Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
    
    ---------
    
    Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
    
    * .NET: Migrate A2A hosting to A2A SDK v1 (#5363)
    
    * .NET: Migrate A2A hosting to A2A SDK v1
    
    Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
    
    * remove unused agent card
    
    ---------
    
    Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
    
    * .NET: Split A2A endpoint mapping into protocol-specific methods (#5413)
    
    * .NET: Refactor A2A hosting registration into A2AServerServiceCollectionExtensions
    
    - Rename A2AHostingOptions to A2AServerRegistrationOptions
    - Move server registration logic from A2AEndpointRouteBuilderExtensions
      and AIAgentExtensions into new A2AServerServiceCollectionExtensions
    - Remove A2AProtocolBinding and AIAgentExtensions (consolidated)
    - Update samples and tests to use the new registration API
    
    Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
    
    * address copilot comments
    
    ---------
    
    Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
    
    * Remove unnecessary using directive in AgentWebChat.AgentHost
    
    Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
    
    * restore AsyncEnumerable package version
    
    * address copilot initial feedback
    
    * address automated code review and formatting issues
    
    * fix formatting issues
    
    * Add DI wiring verification tests for AddA2AServer
    
    Add three tests to A2AServerServiceCollectionExtensionsTests that verify
    custom keyed services are actually wired through to the A2AServer, not
    just that the server resolves non-null:
    
    - Custom IAgentHandler: verifies the keyed handler is invoked when
      processing a SendMessageRequest instead of the default A2AAgentHandler.
    - Custom AgentSessionStore (no handler): verifies the keyed session
      store's GetSessionAsync is called during request processing when no
      custom handler is registered.
    - Default stores end-to-end: verifies the InMemoryAgentSessionStore and
      InMemoryTaskStore defaults successfully process a request. Uses a new
      CreateAgentMockForRequests helper that includes SerializeSessionCoreAsync
      setup needed by InMemoryAgentSessionStore.
    
    All tests call A2AServer.SendMessageAsync directly (no HTTP layer needed)
    and use CancellationToken timeouts to guard against hangs.
    
    Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
    
    ---------
    
    Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
  • Python: Bump Python package versions for a release. (#5432)
    * Bump Python version for a release.
    
    * Revert lockstep bumps on unchanged connectors
    
    Per PR review: only connectors that changed (or whose published metadata
    changed) should get new versions. Keeps released tier at 1.1.1, a2a/ag-ui
    at 1.0.0b260422, foundry-hosting at 1.0.0a260422; reverts the 19 unchanged
    betas and 2 unchanged alphas to 1.0.0b260421/1.0.0a260421. Reverts all 26
    non-core agent-framework-core floors to >=1.1.0,<2 since no connector
    actually depends on a 1.1.1 API or bug fix.
    
    * Restore lockstep prerelease bumps and raise core floors to >=1.1.1
    
    Reverses the lean-revert: all beta packages stamped 1.0.0b260423 and alpha
    packages stamped 1.0.0a260423 (Asia date, matching release cut time). All
    26 non-core packages raise agent-framework-core lower bound from >=1.1.0,<2
    to >=1.1.1,<2 to signal the validated cohort for this release. CHANGELOG
    date updated to 2026-04-23.
  • Python: Flaky test report (#5342)
    * Add flaky test trend reporting to CI workflows
    
    Parse JUnit XML (pytest.xml) from each integration test job and
    aggregate results into a markdown trend report showing per-test
    pass/fail/skip status across the last 5 runs.
    
    Changes:
    - Add python/scripts/flaky_report/ package (JUnit XML parser + trend
      report generator following the sample_validation pattern)
    - Add upload-artifact steps to all 6 integration test jobs in both
      python-merge-tests.yml and python-integration-tests.yml
    - Add python-flaky-test-report aggregation job with history caching
    - Add --junitxml=pytest.xml to integration-tests.yml jobs (already
      present in merge-tests.yml)
    - Fix Cosmos job --junitxml path (use absolute path since uv run
      --directory changes cwd)
    
    Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
    
    * Fix flaky report: handle missing test results gracefully
    
    - Guard against missing reports directory in load_current_run()
    - Only run report job when at least one integration test job completed
      (skip when all jobs are skipped, e.g. on pull_request events)
    
    Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
    
    * Address PR review: fix provider names and if-expression precedence
    
    - Use explicit provider name mapping in _derive_provider() so OpenAI
      renders correctly instead of 'Openai'
    - Fix operator precedence in workflow if-expressions by wrapping
      success/failure checks in parentheses
    
    Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
    
    * Add File column and xfail detection to flaky test report
    
    - Add File column showing module name (e.g., test_openai_chat_client)
      to disambiguate tests with the same function name across files
    - Detect pytest xfail tests in JUnit XML (type=pytest.xfail) and
      show them with a distinct warning emoji instead of skip emoji
    - Update legend to include xfail explanation
    
    Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
    
    * Add Foundry embedding env vars to merge-tests workflow
    
    Sync the Foundry integration job in python-merge-tests.yml with
    python-integration-tests.yml by adding FOUNDRY_MODELS_ENDPOINT,
    FOUNDRY_MODELS_API_KEY, FOUNDRY_EMBEDDING_MODEL, and
    FOUNDRY_IMAGE_EMBEDDING_MODEL. Once the repo variables/secrets
    are configured, the embedding integration test will run in CI.
    
    Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
    
    * Fix File column showing class name instead of module name
    
    When a test is inside a class, pytest writes the classname as e.g.
    'pkg.test_file.TestClass'. The previous rsplit logic extracted
    'TestClass' instead of 'test_file'. Now detect uppercase-starting
    segments as class names and use the preceding segment instead.
    
    Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
    
    * Address PR review: UTC timestamps, XML error handling, summary fix, docstring
    
    - Use datetime.now(timezone.utc) for accurate UTC timestamps
    - Catch ET.ParseError per-file so corrupt XML doesn't crash the report
    - Remove separate 'error' key from summary (errors folded into 'failed')
    - Fix _short_name docstring to show actual dotted classname::name format
    
    Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
    
    ---------
    
    Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
  • Python: Pass client thread_id as session_id when constructing AgentSession in AG-UI (#5384)
    * Pass thread_id as session_id when constructing AgentSession in AG-UI
    
    run_agent_stream() was constructing AgentSession without passing the
    client's thread_id as session_id, causing every request to receive a
    random UUID. This broke session continuity for HistoryProvider
    implementations that rely on session_id matching the client's thread_id.
    
    Pass session_id=thread_id in both the service-session and non-service
    code paths so the session identity is consistent with the AG-UI client.
    
    Fixes #5357
    
    Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
    
    * Add test for service_session with no thread_id edge case (#5357)
    
    When use_service_session=True but no thread_id/threadId is in the payload,
    verify session_id is a generated UUID and service_session_id is None.
    
    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: Propagate thread_id and forwarded_props through AG-UI to A2A context_id (#5383)
    * Propagate session.service_session_id as A2A context_id
    
    When A2AAgent is used behind the AG-UI protocol, the client thread_id is
    stored in session.service_session_id but was never forwarded as the A2A
    context_id. This broke session continuity across the AG-UI → A2A boundary.
    
    Add an optional context_id keyword argument to _prepare_message_for_a2a()
    and pass session.service_session_id from run(). The explicit
    message.additional_properties["context_id"] still takes precedence.
    
    Fixes #5345
    
    Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
    
    * Add integration tests for session context_id wiring in run() (#5345)
    
    - Enhance MockA2AClient.send_message to capture last_message for assertions
    - Add test_run_passes_session_service_session_id_as_context_id: verifies
      run() passes session.service_session_id through to A2A message context_id
    - Add test_run_message_context_id_takes_precedence_over_session: verifies
      explicit message context_id wins over session fallback
    - Update _prepare_message_for_a2a docstring to document context_id param
      and its precedence rules
    
    Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
    
    * Address review feedback for #5345: Python: [Bug]: Inconvenient passing of context_id / thread_id in A2A/AG-UI implementations
    
    ---------
    
    Co-authored-by: Copilot <copilot@github.com>
    Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
  • Python: fix(foundry): reconcile toolbox hosted-tool payloads with Responses API (#5414)
    * fix(foundry): reconcile toolbox hosted-tool payloads with Responses API
    
    * docs(foundry): update create_sample_toolbox docstring to reflect all tools created
  • Python: Fix OpenAI Responses streaming to propagate created_at from final response.completed event (#5382)
    * Fix streaming response losing created_at from response.completed event (#5347)
    
    The streaming path in _parse_chunk_from_openai did not extract created_at
    from the response.completed event, unlike the non-streaming path in
    _parse_responses_response. This caused durabletask persistence warnings
    when created_at was None.
    
    Extract created_at in the response.completed case and pass it to the
    returned ChatResponseUpdate.
    
    Also fix pre-existing pyright errors for optional orjson import in sample
    files.
    
    Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
    
    * Fix orjson import suppression to use pyright instead of mypy (#5347)
    
    Replace `# type: ignore[import-not-found]` with
    `# pyright: ignore[reportMissingImports]` on optional orjson imports
    in conversation sample files, matching the repo's Pyright strict
    configuration.
    
    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>
  • Add pr review GH workflow (#5418)
    * Add workflow PR review
    
    * Allow reviews on draft PRs
    
    * Update .github/workflows/devflow-pr-review.yml
    
    Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
    
    * Update .github/workflows/devflow-pr-review.yml
    
    Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
    
    * Bump actions/checkout to v6 and uv to 0.11.x
    
    ---------
    
    Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
  • Python: fix: exclude null file_id from input_image payload to prevent 400 sch… (#5125)
    * fix: exclude null file_id from input_image payload to prevent 400 schema error (#5120)
    
    * test: add case for additional_properties present without file_id key
    
    ---------
    
    Co-authored-by: Sergey Borisov <sergey.borisov@dataimpact.io>
  • .NET [WIP] Foundry Hosted Agents Support (#5312)
    * Add Azure AI Foundry Responses hosting adapter
    
    Implement Microsoft.Agents.AI.Hosting.AzureAIResponses to host agent-framework
    AIAgents and workflows within Azure Foundry as hosted agents via the
    Azure.AI.AgentServer.Responses SDK.
    
    - AgentFrameworkResponseHandler: bridges ResponseHandler to AIAgent execution
    - InputConverter: converts Responses API inputs/history to MEAI ChatMessage
    - OutputConverter: converts agent response updates to SSE event stream
    - ServiceCollectionExtensions: DI registration helpers
    - 336 unit tests across net8.0/net9.0/net10.0 (112 per TFM)
    - ResponseStreamValidator: SSE protocol validation tool for samples
    - FoundryResponsesHosting sample app
    
    Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
    
    * Bump System.ClientModel to 1.10.0 for Azure.Core 1.52.0 compat
    
    Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
    
    * Clean up tests and sample formatting
    
    Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
    
    * Update Azure.AI.AgentServer packages to 1.0.0-alpha.20260401.5
    
    Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
    
    * Add hosted package version suffix (0.9.0-hosted) to distinguish from mainline
    
    Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
    
    * Move Foundry Responses hosting into Microsoft.Agents.AI.Foundry package
    
    Move source and test files from the standalone Hosting.AzureAIResponses project
    into the Foundry package under a Hosting/ subfolder. This consolidates the
    Foundry-specific hosting adapter into the main Foundry package.
    
    - Source: Microsoft.Agents.AI.Foundry.Hosting namespace
    - Tests: merged into Foundry.UnitTests/Hosting/
    - Conditionally compiled for .NETCoreApp TFMs only (net8.0+)
    - Deleted standalone Hosting.AzureAIResponses project and test project
    - Updated sample and solution references
    
    Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
    
    * Bump package version to 0.9.0-hosted.260402.2
    
    Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
    
    * Bump OpenTelemetry packages to fix NU1109 downgrade errors
    
    - OpenTelemetry/Api/Exporter.Console/Exporter.InMemory: 1.13.1 -> 1.15.0
    - OpenTelemetry.Exporter.OpenTelemetryProtocol: already 1.15.0
    - OpenTelemetry.Extensions.Hosting: already 1.14.0
    - OpenTelemetry.Instrumentation.AspNetCore/Http: already 1.14.0
    - OpenTelemetry.Instrumentation.Runtime: 1.13.0 -> 1.14.0
    - Azure.Monitor.OpenTelemetry.Exporter: 1.4.0 -> 1.5.0
    
    Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
    
    * Fix CA1873: guard LogWarning with IsEnabled check
    
    Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
    
    * Fix model override bug and add client REPL sample
    
    - InputConverter: stop propagating request.Model to ChatOptions.ModelId
      Hosted agents use their own model; client-provided model values like
      'hosted-agent' were being passed through and causing server errors.
    - Add FoundryResponsesRepl sample: interactive CLI client that connects
      to a Foundry Responses endpoint using ResponsesClient.AsAIAgent()
    - Bump package version to 0.9.0-hosted.260403.1
    
    Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
    
    * Catch agent errors and emit response.failed with real error message
    
    Previously, unhandled exceptions from agent execution would bubble up
    to the SDK orchestrator, which emits a generic 'An internal server
    error occurred.' message — hiding the actual cause (e.g., 401 auth
    failures, model not found, etc.).
    
    Now AgentFrameworkResponseHandler catches non-cancellation exceptions
    and emits a proper response.failed event containing the real error
    message, making it visible to clients and in logs.
    
    OperationCanceledException still propagates for proper cancellation
    handling by the SDK.
    
    Also bumps package version to 0.9.0-hosted.260403.2.
    
    Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
    
    * Renaming and merging hosting extensions. (#5091)
    
    * Rename AddAgentFrameworkHandler to AddFoundryResponses and add MapFoundryResponses
    
    - Rename extension methods: AddAgentFrameworkHandler -> AddFoundryResponses, MapAgentFrameworkHandler -> MapFoundryResponses
    - AddFoundryResponses now calls AddResponsesServer() internally
    - Add MapFoundryResponses() extension on IEndpointRouteBuilder
    - Update sample and tests to use new API names
    - Remove redundant AddResponsesServer() and /ready endpoint from sample
    
    Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
    
    * Fixing numbering in sample.
    
    ---------
    
    Co-authored-by: alliscode <bentho@microsoft.com>
    Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
    
    * Address breaking changes in 260408
    
    * Bump hosted internal package version
    
    * Add UserAgent middleware tests for Foundry hosting
    
    * Hosting Samples update
    
    * Hosting Samples update
    
    * Hosting Samples update
    
    * Hosting Samples update
    
    * ChatClientAgent working
    
    * Adding SessionStorage and SessionManagement, improving samples to align Consumption vs Hosting
    
    * Using updates
    
    * Update chat client agent for contributor and devs
    
    * Foundry Agent Hosting
    
    * Address text rag sample working
    
    * Version bump
    
    * Adding LocalTools + Workflow samples
    
    * Removing extra using samples
    
    * Add Hosted-McpTools sample with dual MCP pattern
    
    Demonstrates two MCP integration layers in a single hosted agent:
    - Client-side MCP: McpClient connects to Microsoft Learn, agent handles
      tool invocations locally (docs_search, code_sample_search, docs_fetch)
    - Server-side MCP: HostedMcpServerTool delegates tool discovery and
      invocation to the LLM provider (Responses API), no local connection
    
    Includes DevTemporaryTokenCredential for Docker local debugging,
    Dockerfile.contributor for ProjectReference builds, and the openai/v1
    route mapping for AIProjectClient compatibility in Development mode.
    
    * .NET: Bump Azure.AI.AgentServer packages to 1.0.0-beta.1/beta.21 and fix br… (#5287)
    
    * Bump Azure.AI.AgentServer packages to 1.0.0-beta.1/beta.21 and fix breaking API changes
    
    - Azure.AI.AgentServer.Core: 1.0.0-beta.11 -> 1.0.0-beta.21
    - Azure.AI.AgentServer.Invocations: 1.0.0-alpha.20260408.4 -> 1.0.0-beta.1
    - Azure.AI.AgentServer.Responses: 1.0.0-alpha.20260408.4 -> 1.0.0-beta.1
    - Azure.Identity: 1.20.0 -> 1.21.0 (transitive requirement)
    - Azure.Core: 1.52.0 -> 1.53.0 (transitive requirement)
    - Remove azure-sdk-for-net dev feed (packages now on nuget.org)
    - Fix OutputConverter for new builder API (auto-tracked children, split EmitTextDone/EmitDone)
    
    Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
    
    * Fixing small issues.
    
    ---------
    
    Co-authored-by: alliscode <bentho@microsoft.com>
    Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
    
    * Add Azure AI Foundry Responses hosting adapter
    
    Implement Microsoft.Agents.AI.Hosting.AzureAIResponses to host agent-framework
    AIAgents and workflows within Azure Foundry as hosted agents via the
    Azure.AI.AgentServer.Responses SDK.
    
    - AgentFrameworkResponseHandler: bridges ResponseHandler to AIAgent execution
    - InputConverter: converts Responses API inputs/history to MEAI ChatMessage
    - OutputConverter: converts agent response updates to SSE event stream
    - ServiceCollectionExtensions: DI registration helpers
    - 336 unit tests across net8.0/net9.0/net10.0 (112 per TFM)
    - ResponseStreamValidator: SSE protocol validation tool for samples
    - FoundryResponsesHosting sample app
    
    Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
    
    * Bump System.ClientModel to 1.10.0 for Azure.Core 1.52.0 compat
    
    Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
    
    * Clean up tests and sample formatting
    
    Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
    
    * Update Azure.AI.AgentServer packages to 1.0.0-alpha.20260401.5
    
    Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
    
    * Add hosted package version suffix (0.9.0-hosted) to distinguish from mainline
    
    Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
    
    * Move Foundry Responses hosting into Microsoft.Agents.AI.Foundry package
    
    Move source and test files from the standalone Hosting.AzureAIResponses project
    into the Foundry package under a Hosting/ subfolder. This consolidates the
    Foundry-specific hosting adapter into the main Foundry package.
    
    - Source: Microsoft.Agents.AI.Foundry.Hosting namespace
    - Tests: merged into Foundry.UnitTests/Hosting/
    - Conditionally compiled for .NETCoreApp TFMs only (net8.0+)
    - Deleted standalone Hosting.AzureAIResponses project and test project
    - Updated sample and solution references
    
    Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
    
    * Bump package version to 0.9.0-hosted.260402.2
    
    Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
    
    * Bump OpenTelemetry packages to fix NU1109 downgrade errors
    
    - OpenTelemetry/Api/Exporter.Console/Exporter.InMemory: 1.13.1 -> 1.15.0
    - OpenTelemetry.Exporter.OpenTelemetryProtocol: already 1.15.0
    - OpenTelemetry.Extensions.Hosting: already 1.14.0
    - OpenTelemetry.Instrumentation.AspNetCore/Http: already 1.14.0
    - OpenTelemetry.Instrumentation.Runtime: 1.13.0 -> 1.14.0
    - Azure.Monitor.OpenTelemetry.Exporter: 1.4.0 -> 1.5.0
    
    Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
    
    * Fix CA1873: guard LogWarning with IsEnabled check
    
    Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
    
    * Fix model override bug and add client REPL sample
    
    - InputConverter: stop propagating request.Model to ChatOptions.ModelId
      Hosted agents use their own model; client-provided model values like
      'hosted-agent' were being passed through and causing server errors.
    - Add FoundryResponsesRepl sample: interactive CLI client that connects
      to a Foundry Responses endpoint using ResponsesClient.AsAIAgent()
    - Bump package version to 0.9.0-hosted.260403.1
    
    Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
    
    * Catch agent errors and emit response.failed with real error message
    
    Previously, unhandled exceptions from agent execution would bubble up
    to the SDK orchestrator, which emits a generic 'An internal server
    error occurred.' message — hiding the actual cause (e.g., 401 auth
    failures, model not found, etc.).
    
    Now AgentFrameworkResponseHandler catches non-cancellation exceptions
    and emits a proper response.failed event containing the real error
    message, making it visible to clients and in logs.
    
    OperationCanceledException still propagates for proper cancellation
    handling by the SDK.
    
    Also bumps package version to 0.9.0-hosted.260403.2.
    
    Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
    
    * Renaming and merging hosting extensions. (#5091)
    
    * Rename AddAgentFrameworkHandler to AddFoundryResponses and add MapFoundryResponses
    
    - Rename extension methods: AddAgentFrameworkHandler -> AddFoundryResponses, MapAgentFrameworkHandler -> MapFoundryResponses
    - AddFoundryResponses now calls AddResponsesServer() internally
    - Add MapFoundryResponses() extension on IEndpointRouteBuilder
    - Update sample and tests to use new API names
    - Remove redundant AddResponsesServer() and /ready endpoint from sample
    
    Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
    
    * Fixing numbering in sample.
    
    ---------
    
    Co-authored-by: alliscode <bentho@microsoft.com>
    Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
    
    * Address breaking changes in 260408
    
    * Bump hosted internal package version
    
    * Add UserAgent middleware tests for Foundry hosting
    
    * Hosting Samples update
    
    * Hosting Samples update
    
    * Hosting Samples update
    
    * Hosting Samples update
    
    * ChatClientAgent working
    
    * Adding SessionStorage and SessionManagement, improving samples to align Consumption vs Hosting
    
    * Using updates
    
    * Update chat client agent for contributor and devs
    
    * Foundry Agent Hosting
    
    * Address text rag sample working
    
    * Version bump
    
    * Adding LocalTools + Workflow samples
    
    * Removing extra using samples
    
    * Add Hosted-McpTools sample with dual MCP pattern
    
    Demonstrates two MCP integration layers in a single hosted agent:
    - Client-side MCP: McpClient connects to Microsoft Learn, agent handles
      tool invocations locally (docs_search, code_sample_search, docs_fetch)
    - Server-side MCP: HostedMcpServerTool delegates tool discovery and
      invocation to the LLM provider (Responses API), no local connection
    
    Includes DevTemporaryTokenCredential for Docker local debugging,
    Dockerfile.contributor for ProjectReference builds, and the openai/v1
    route mapping for AIProjectClient compatibility in Development mode.
    
    * Bump Azure.AI.AgentServer packages to 1.0.0-beta.1/beta.21 and fix breaking API changes
    
    - Azure.AI.AgentServer.Core: 1.0.0-beta.11 -> 1.0.0-beta.21
    - Azure.AI.AgentServer.Invocations: 1.0.0-alpha.20260408.4 -> 1.0.0-beta.1
    - Azure.AI.AgentServer.Responses: 1.0.0-alpha.20260408.4 -> 1.0.0-beta.1
    - Azure.Identity: 1.20.0 -> 1.21.0 (transitive requirement)
    - Azure.Core: 1.52.0 -> 1.53.0 (transitive requirement)
    - Remove azure-sdk-for-net dev feed (packages now on nuget.org)
    - Fix OutputConverter for new builder API (auto-tracked children, split EmitTextDone/EmitDone)
    
    Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
    
    * Fixing small issues.
    
    * Fix IDE0009: add 'this' qualification in DevTemporaryTokenCredential
    
    Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
    
    * Fix IDE0009: add 'this' qualification in all HostedAgentsV2 samples
    
    Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
    
    * Fix CHARSET: add UTF-8 BOM to Hosted-LocalTools and Hosted-Workflows
    
    Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
    
    * Fix dotnet format: add Async suffix to test methods (IDE1006), fix encoding and style
    
    Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
    
    * Register AgentSessionStore in test DI setups
    
    Add InMemoryAgentSessionStore registration to all ServiceCollection
    setups in AgentFrameworkResponseHandlerTests and WorkflowIntegrationTests.
    This is needed after the AgentSessionStore infrastructure was introduced
    in the responses-hosting feature. Tests still have NotImplementedException
    stubs for CreateSessionCoreAsync which will be fixed when the session
    infrastructure is fully available.
    
    Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
    
    * Add Invocations protocol samples (hosted echo agent + client) (#5278)
    
    Add Hosted-Invocations-EchoAgent: a minimal echo agent hosted via the
    Invocations protocol (POST /invocations) using AddInvocationsServer and
    MapInvocationsServer, bridged to an Agent Framework AIAgent through a
    custom InvocationHandler.
    
    Add SimpleInvocationsAgent: a console REPL client that wraps HttpClient
    calls to the /invocations endpoint in a custom InvocationsAIAgent,
    demonstrating programmatic consumption of the Invocations protocol.
    
    Both samples default to port 8088 for consistency with other hosted
    agent samples.
    
    * Restructure FoundryHostedAgents samples into invocations/ and responses/
    
    Align dotnet hosted agent samples with the Python side (PR #5281) by
    reorganizing the directory structure:
    
    - Remove HostedAgentsV1 entirely (old API pattern)
    - Split HostedAgentsV2 into invocations/ and responses/ based on protocol
    - Move Using-Samples accordingly (SimpleAgent to responses, SimpleInvocationsAgent to invocations)
    - Update slnx with new project paths and add previously missing invocations projects
    - Update README cd paths from HostedAgentsV2 to invocations or responses
    - Rename .env.local to .env.example to match Python naming convention
    - Fix format violations in newly included invocations projects
    
    * Remove launchSettings, use .env for port configuration
    
    - Delete all launchSettings.json files (port 8088 now comes from ASPNETCORE_URLS in .env)
    - Add DotNetEnv to Hosted-Invocations-EchoAgent so it loads .env like the responses samples
    - Create .env.example for EchoAgent with ASPNETCORE_URLS and ASPNETCORE_ENVIRONMENT
    - Add AGENT_NAME to ChatClientAgent and FoundryAgent .env.example (required by those samples)
    - Add AZURE_BEARER_TOKEN=DefaultAzureCredential to all .env.example files
    - Update DevTemporaryTokenCredential in all 6 samples to treat the sentinel value
      as unavailable, allowing ChainedTokenCredential to fall through to DefaultAzureCredential
    - Update EchoAgent README with Configuration section
    
    * Use placeholder for AGENT_NAME in Hosted-FoundryAgent .env.example
    
    * Move FoundryResponsesHosting to responses/Hosted-WorkflowHandoff, use GetResponsesClient
    
    * Rename Hosted-Workflows to Hosted-Workflow-Simple, Hosted-WorkflowHandoff to Hosted-Workflow-Handoff
    
    * Remove FoundryResponsesRepl and empty FoundryResponsesHosting directory
    
    * Add Dockerfiles, README, agent yamls and bearer token support to Hosted-Workflow-Handoff
    
    - Add Dockerfile and Dockerfile.contributor for Docker-based testing
    - Add agent.yaml and agent.manifest.yaml with triage-workflow as primary agent
    - Add README.md following sibling pattern, noting Azure OpenAI vs Foundry endpoint
    - Add DevTemporaryTokenCredential and ChainedTokenCredential for Docker auth
    - Register triage-workflow as non-keyed default so azd invoke works without model
    - Update .env.example with AZURE_BEARER_TOKEN sentinel
    - Add .gitignore to 04-hosting to suppress VS-generated launchSettings.json
    - Fix docker run image name in Hosted-Workflow-Simple README
    
    * Fix AgentFrameworkResponseHandlerTests: implement session methods in test mock agents
    
    * .NET: Auto-instrument resolved AIAgents with OpenTelemetry for Foundry Hosted Agents (#5316)
    
    * Auto-instrument resolved AIAgents with OpenTelemetry using Core ResponsesSourceName
    
    * Add OTel telemetry capture tests for Foundry hosted agent handler
    
    * Net: Prepare Foundry Preview Release (#5336)
    
    * Prepare Foundry preview release 1.2.0-preview.*
    
    Bump VersionPrefix to 1.2.0 and update the preview stamp date. Invert packaging opt-in so only the Foundry preview set produces NuGet packages:
    
    - Microsoft.Agents.AI.Abstractions
    
    - Microsoft.Agents.AI
    
    - Microsoft.Agents.AI.Workflows
    
    - Microsoft.Agents.AI.Workflows.Generators
    
    - Microsoft.Agents.AI.Foundry
    
    Flip IsReleased=false on the preview set so they pick up the -preview.YYMMDD.N suffix. Gate GeneratePackageOnBuild on IsPackable=true. Remove the global IsPackable=true from nuget-package.props so the repo-level default (false) applies to everything else.
    
    * Lower preview VersionPrefix to 0.0.1
    
    Retroactive preview publish: bump VersionPrefix and GitTag from 1.2.0 to 0.0.1 so the 5 Foundry preview packages emit as 0.0.1-preview.260417.1.
    
    * Net: Publish all packages as 0.0.1-preview.260417.2 (#5341)
    
    Revises the Foundry pre-release approach to publish ALL normally packable src projects as preview packages stamped 0.0.1-preview.260417.2, including projects previously flagged IsReleased=true or with a non-default VersionSuffix (rc/alpha).
    
    nuget-package.props:
    
    - Collapse the four conditional PackageVersion expressions (IsReleaseCandidate, VersionSuffix, default preview, IsReleased stable) into a single unconditional 0.0.1-preview.260417.2. On this preview-only branch every package ships with the same pre-release stamp regardless of per-project flags.
    
    - Restore the global IsPackable=true default (offsetting the repo-wide IsPackable=false in Directory.Build.props). Projects that opt out (Mem0, Declarative) already set IsPackable=false AFTER importing this file so they remain non-packable.
    
    - Remove the IsReleased-gated EnablePackageValidation line. Package validation does not apply to a 0.0.1 preview.
    
    csproj reverts (Abstractions, Agents.AI, Workflows, Workflows.Generators, Foundry):
    
    - Revert the IsPackable=true opt-in block introduced in #5336 (now redundant since the props default is true again).
    
    - Restore IsReleased=true to its pre-PR value. The setting is now a no-op because the props no longer branches on it.
    
    * Bump preview version to 260420.1 and fix AgentServer package deps (#5367)
    
    - Bump PackageVersion to 0.0.1-preview.260420.1
    - Bump Azure.AI.AgentServer.Core beta.21 -> beta.22 (required by
      Azure.AI.AgentServer.Responses beta.3)
    - Replace AgentHostTelemetry.ResponsesSourceName with local constant
      (type made internal in AgentServer.Core beta.22)
    
    Co-authored-by: alliscode <bentho@microsoft.com>
    Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
    
    * .NET: Hosted agents toolbox support (#5368)
    
    * feat: Add Foundry Toolbox (MCP) support to AgentFrameworkResponseHandler
    
    Adds support for Foundry Toolsets MCP proxy integration in the hosted agent
    response handler. Toolsets connect at startup via IHostedService, gating the
    readiness probe per spec §3.1. MCP tools are injected into every request's
    ChatOptions and OAuth consent errors (-32006) are intercepted and surfaced as
    mcp_approval_request + incomplete SSE events.
    
    New files:
    - FoundryToolboxOptions.cs: configuration POCO for toolset names and API version
    - FoundryToolboxBearerTokenHandler.cs: DelegatingHandler with Azure Bearer token
      auth, Foundry-Features header injection, and 3x exponential backoff on 429/5xx
    - McpConsentContext.cs: AsyncLocal-based per-request consent state shared between
      the tool wrapper and the response handler
    - ConsentAwareMcpClientTool.cs: AIFunction wrapper that catches -32006 errors and
      signals consent via shared state and linked CancellationTokenSource
    - FoundryToolboxService.cs: IHostedService that creates McpClient per toolset at
      startup and exposes cached tools
    
    Modified files:
    - AgentFrameworkResponseHandler.cs: injects toolbox tools into ChatOptions, sets
      up linked CTS consent interception, emits mcp_approval_request on -32006
    - ServiceCollectionExtensions.cs: adds AddFoundryToolboxes(params string[]) extension
    - Microsoft.Agents.AI.Foundry.csproj: adds ModelContextProtocol and Azure.Identity
      dependencies under NETCoreApp condition
    
    Sample:
    - Hosted-Toolbox: minimal hosted agent sample using AddFoundryToolboxes
    
    * Rename toolset to toolbox in user-facing API; rename ConsentAwareMcpClientTool to ConsentAwareMcpClientAIFunction
    
    * Add HostedMcpToolboxAITool for client-selectable Foundry toolboxes
    
    Introduces HostedMcpToolboxAITool, a marker tool subclassing HostedMcpServerTool that rides the OpenAI Responses 'mcp' wire format to let clients request a specific Foundry toolbox per request.
    
    - New FoundryAITool.CreateHostedMcpToolbox(name, version?) factory.
    
    - FoundryToolboxOptions.StrictMode (default true) rejects unregistered toolboxes; set to false to allow lazy-open on first use.
    
    - FoundryToolboxService.GetToolboxToolsAsync(name, version?) resolves cached or lazy-opened MCP tools.
    
    - AgentFrameworkResponseHandler parses request.Tools for foundry-toolbox://name[?version=v] markers and injects resolved tools per request, merging with pre-registered ones.
    
    - Unit tests for marker parsing and strict-mode resolution.
    
    * Bump Azure.AI.Projects to 2.1.0-alpha; add ToolboxRecord/ToolboxVersion factory overloads + tests
    
    * Fix PR review issues: retry off-by-one, URI encoding, docs, tests, build
    
    - Fix off-by-one in FoundryToolboxBearerTokenHandler retry loop (4 attempts → 3)
    - URI-encode version parameter in HostedMcpToolboxAITool.BuildAddress
    - Add XML doc clarifying version pinning is reserved for future use
    - Add comment clarifying AddHostedService deduplication safety
    - Fix DevTemporaryTokenCredential expiry to use DateTimeOffset.MaxValue
    - Fix AgentCard ambiguity in A2AServer sample with using alias
    - Add 18 new unit tests for retry handler and ReadMcpToolboxMarkers
    
    Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
    
    ---------
    
    Co-authored-by: Roger Barreto <19890735+rogerbarreto@users.noreply.github.com>
    Co-authored-by: alliscode <bentho@microsoft.com>
    Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
    
    * .NET: Hosted agent adapter (#5371)
    
    * Bump preview version to 260420.1 and fix AgentServer package deps
    
    - Bump PackageVersion to 0.0.1-preview.260420.1
    - Bump Azure.AI.AgentServer.Core beta.21 -> beta.22 (required by
      Azure.AI.AgentServer.Responses beta.3)
    - Replace AgentHostTelemetry.ResponsesSourceName with local constant
      (type made internal in AgentServer.Core beta.22)
    
    Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
    
    * Fix CA1873: guard LogError with IsEnabled check in FoundryToolboxService
    
    Wrap the LogError call with an IsEnabled(LogLevel.Error) guard to satisfy
    the CA1873 analyzer rule which flags potentially expensive argument
    evaluation when logging is disabled.
    
    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>
    
    * .NET: Hosted agent adapter (#5374)
    
    * Bump preview version to 260420.1 and fix AgentServer package deps
    
    - Bump PackageVersion to 0.0.1-preview.260420.1
    - Bump Azure.AI.AgentServer.Core beta.21 -> beta.22 (required by
      Azure.AI.AgentServer.Responses beta.3)
    - Replace AgentHostTelemetry.ResponsesSourceName with local constant
      (type made internal in AgentServer.Core beta.22)
    
    Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
    
    * Fix CA1873: guard LogError with IsEnabled check in FoundryToolboxService
    
    Wrap the LogError call with an IsEnabled(LogLevel.Error) guard to satisfy
    the CA1873 analyzer rule which flags potentially expensive argument
    evaluation when logging is disabled.
    
    Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
    
    * Bumping NuGet version
    
    ---------
    
    Co-authored-by: alliscode <bentho@microsoft.com>
    Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
    
    * .NET: Hosted agent adapter (#5406)
    
    * Bump preview version to 260420.1 and fix AgentServer package deps
    
    - Bump PackageVersion to 0.0.1-preview.260420.1
    - Bump Azure.AI.AgentServer.Core beta.21 -> beta.22 (required by
      Azure.AI.AgentServer.Responses beta.3)
    - Replace AgentHostTelemetry.ResponsesSourceName with local constant
      (type made internal in AgentServer.Core beta.22)
    
    Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
    
    * Fix CA1873: guard LogError with IsEnabled check in FoundryToolboxService
    
    Wrap the LogError call with an IsEnabled(LogLevel.Error) guard to satisfy
    the CA1873 analyzer rule which flags potentially expensive argument
    evaluation when logging is disabled.
    
    Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
    
    * Bumping NuGet version
    
    * Restore conditional versioning, remove dev feed, bump Azure.AI.Projects to beta.1
    
    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>
    
    * Hosted agent adapter (#5408)
    
    * Bump preview version to 260420.1 and fix AgentServer package deps
    
    - Bump PackageVersion to 0.0.1-preview.260420.1
    - Bump Azure.AI.AgentServer.Core beta.21 -> beta.22 (required by
      Azure.AI.AgentServer.Responses beta.3)
    - Replace AgentHostTelemetry.ResponsesSourceName with local constant
      (type made internal in AgentServer.Core beta.22)
    
    Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
    
    * Fix CA1873: guard LogError with IsEnabled check in FoundryToolboxService
    
    Wrap the LogError call with an IsEnabled(LogLevel.Error) guard to satisfy
    the CA1873 analyzer rule which flags potentially expensive argument
    evaluation when logging is disabled.
    
    Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
    
    * Bumping NuGet version
    
    * Restore conditional versioning, remove dev feed, bump Azure.AI.Projects to beta.1
    
    Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
    
    * Address PR #5312 review comments
    
    - Add comment explaining NU1903 suppression (Microsoft.Bcl.Memory transitive vuln)
    - Remove NU1903 from sample/test projects where not needed
    - Fix Dockerfile ENTRYPOINT mismatch in Hosted-Workflow-Simple
    - Align agent name to 'hosted-workflow-simple' in agent.yaml and README
    - Fix Hosted-McpTools README: replace GitHub PAT refs with Microsoft Learn
    - Fix session persistence: only persist when client provides conversation ID
    - Upgrade IsNullOrEmpty to IsNullOrWhiteSpace for session ID checks
    
    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>
    
    * Split Foundry into stable V1 and preview Hosting package
    
    Extract hosted agent functionality from Microsoft.Agents.AI.Foundry into a
    new Microsoft.Agents.AI.Foundry.Hosting preview package. This resolves NU5104
    build errors caused by the stable Foundry package depending on prerelease
    Azure SDK packages (Azure.AI.AgentServer.Responses, Azure.AI.Projects beta).
    
    Changes:
    - Create Microsoft.Agents.AI.Foundry.Hosting with VersionSuffix=preview,
      targeting .NET Core only (net8.0/9.0/10.0)
    - Move all Hosting/ source files to the new project
    - Move ToolboxRecord/ToolboxVersion overloads to FoundryAIToolExtensions
    - Revert Azure.AI.Projects to 2.0.0 in Directory.Packages.props;
      Hosting uses VersionOverride for 2.1.0-beta.1
    - Clean V1 Foundry csproj: remove beta deps, ASP.NET Core ref, hosting conditionals
    - Update 8 hosted agent sample projects to reference Foundry.Hosting
    - Split unit tests: ToolboxRecord/ToolboxVersion tests moved to Hosting/
    - Add Foundry.Hosting to solution file
    
    Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
    
    * Address PR review comments: experimental attrs, doc fixes, token propagation
    
    - Add [Experimental(OPENAI001)] to all 7 public Hosting types per reviewer request
    - Fix McpConsentContext XML doc: 'Thread-static' -> 'Async-local' (AsyncLocal
      flows with ExecutionContext, not thread-static)
    - Expand UserAgentMiddleware test regex to match prerelease versions (e.g. 1.0.0-rc.4)
    - Propagate CancellationToken in AgentFrameworkResponseHandler session save
    
    Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
    
    * Remove unnecessary MEAI001 suppression from stable Foundry package
    
    MEAI001 was a leftover from when Hosting code lived in the same project.
    The stable V1 Foundry package builds clean without it, and suppressing
    experimental diagnostics in a released package can hide unintentional
    exposure of experimental APIs to consumers.
    
    Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
    
    * Add Foundry.Hosting to release solution filter
    
    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>
    Co-authored-by: Ben Thomas <ben.thomas@microsoft.com>
  • Python: Fix OpenAIEmbeddingClient to use AsyncOpenAI for /openai/v1 endpoints (#5137)
    * Fix OpenAIEmbeddingClient with /openai/v1 endpoint (#5068)
    
    When base_url ends with /openai/v1/ and a credential is provided,
    load_openai_service_settings was creating an AsyncAzureOpenAI client.
    The Azure SDK rewrites deployment-based endpoints (including /embeddings)
    by inserting /deployments/{model}/ into the URL, producing 404s on the
    OpenAI-compatible /openai/v1 endpoint.
    
    Use AsyncOpenAI instead of AsyncAzureOpenAI when the resolved base_url
    targets /openai/v1, converting the Azure token provider to an async
    api_key callable. The responses_mode path is unaffected because the
    Responses API (/responses) is not in the SDK's rewrite list.
    
    Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
    
    * Python: Fix OpenAIEmbeddingClient to use AsyncOpenAI for /openai/v1 endpoints
    
    Fixes #5068
    
    * Address review feedback: improve test coverage and remove unrelated changes
    
    - Revert unrelated formatting change in test_a2a_agent.py
    - Fix test_init_with_openai_v1_base_url_and_api_key_uses_openai_client to
      exercise the Azure settings path (via AZURE_OPENAI_BASE_URL env var)
      instead of the plain OpenAI path, covering the elif api_key branch
    - Add _ensure_async_token_provider unit tests for both sync and async
      token providers
    
    Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
    
    * Address review feedback for #5068: Python: [Bug]: `OpenAIEmbeddingClient` does not work with `/openai/v1` endpoint
    
    ---------
    
    Co-authored-by: MAF Dashboard Bot <maf-dashboard-bot@users.noreply.github.com>
    Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
    Co-authored-by: Evan Mattson <35585003+moonbox3@users.noreply.github.com>
  • Python: feat(evals): add ground_truth support for similarity evaluator (#5234)
    * feat(evals): add ground_truth support for similarity evaluator
    
    - Include expected_output as ground_truth in Foundry JSONL dataset rows
    - Add ground_truth to item schema and data mapping for similarity evaluator
    - Add expected_output parameter to evaluate_workflow
    - Add similarity Pattern 3 to evaluate_agent and evaluate_workflow samples
    - Add tests for ground_truth in dataset, schema, and evaluate_workflow
    
    * Apply suggestions from code review
    
    Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
    
    * fix: wrap long line to satisfy ruff E501
    
    ---------
    
    Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
  • .NET: Update .NET package version 1.2.0 (#5364)
    * release: Update version for .NET (1.2.0)
    
    * release: Update preview date tag
  • .NET: Expand Workflow Unit Test Coverage (#5390)
    * refactor: remove dead code
    
    * refactor: remove ignore YieldsMessageAttribute
    
    - the correct one to use is YieldsOutputAttribute
    - fixes a comment that mistakenly refers to `.YieldsMessage()` which does not exist.
    
    * fix: ChatForwardingExecutor does not use correct role for string messages
    
    - make ChatForwardingExecutor use its configured role for string messages rather than always use ChatRole.User
    - add ChatForwardingExecutor tests
    
    * fixup: remove unused attribute
    
    * test: Add tests for failure when .AsAgent used on a non-ChatProtocol workflow
    
    * test: Add FunctionExecutor tests
    
    - also fixes Send and YieldOutput type registration for synchronous output-returning delegates
    
    * test: Suppress CodeCoverage for obsolete names
    
    * fix: Re-add Obsolete attributes
    
    - avoid hard-breaking change
    - properly notify users that these attributes get ignored
  • .NET: Declarative workflows - Gracefully handle agent scenarios when no response is returned (#5376)
    * Gracefully handle agent scenarios when no response is returned
    
    * Make relevant object disposable and improve exception handling.
  • fix: Duplicate CallIds cause Handoff Message Filtering to fail (#5359)
    Some providers, e.g. Gemini, do not use the CallId mechanism to disambiguate simultaneous function calls. This can result in message lists containing multiple turn to fail to filter properly.
    
    The fix is to take advantage of the expectation that Handoff Orchestration is a "single-speaker" flow, which only has a single active AIAgent per "turn" and an agent's turn is not finished until all outstanding function calls are finished.
    
    This allows us to expect that any ambiguous-CallId FunctionCallContent are either in separate turns or will have had a response before the next issued call with the same Id.
  • Python: Add second approval-required tool (set_stop_loss) to concurrent_builder_tool_approval sample (#4875)
    * Add set_stop_loss tool to concurrent_builder_tool_approval sample
    
    Add a second approval-gated tool (set_stop_loss) to the concurrent workflow
    tool approval sample to demonstrate handling approval requests for different
    tools in the same concurrent workflow.
    
    Changes:
    - Add set_stop_loss(symbol, stop_price) with approval_mode='always_require'
    - Include new tool in both agents' tool lists
    - Update agent instructions and prompt to encourage stop-loss usage
    - Update docstring to reflect two approval-gated tools
    - Update sample output to show mixed approval requests
    
    Fixes #4874
    
    Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
    
    * Print tool name and arguments in concurrent sample's process_event_stream (#4874)
    
    Align process_event_stream in concurrent_builder_tool_approval.py to print
    the tool name and arguments when collecting approval requests, matching the
    sample output comment and the sequential_builder_tool_approval.py pattern.
    
    Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
    
    * Add None-guard for function_call access in tool approval sample (#4874)
    
    Add explicit None-checks before accessing function_call.name and
    function_call.arguments in concurrent_builder_tool_approval.py. The
    function_call field is typed Content | None, so direct attribute access
    without a guard could raise AttributeError and required type: ignore
    comments. The None-guard is consistent with the pattern used in
    _agent_run.py and removes the suppression comments.
    
    Also add a regression test verifying that function_call defaults to None
    and that the None-guard pattern is safe.
    
    Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
    
    * Apply same function_call None-guard to sibling tool-approval samples (#4874)
    
    Apply the same fix to sequential_builder_tool_approval.py and
    group_chat_builder_tool_approval.py, which had the identical pattern
    of accessing function_call.name/arguments without a None-guard.
    
    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: Bump versions for a release. Update CHANGELOG (#5385)
    * Bump versions for a release. Update CHANGELOG
    
    * Bump devui
  • Python: Foundry hosted agent V2 (#5379)
    * Python: Wrapper + Samples 1st (#5177)
    
    * Experiment
    
    * Update dependency and add non streaming
    
    * Add more samples
    
    * Rename samples
    
    * Add invocations
    
    * Comments 1
    
    * Comments 2
    
    * Comments 3
    
    * Improve README
    
    * Add local shell sample
    
    * WIP: Add eval and memory samples
    
    * Update user agent prefix
    
    * Update user agent prefix doc
    
    * Update dependency (#5215)
    
    * Add tests and more content types (#5235)
    
    * Add tests
    
    * fix tests and sample
    
    * Fix formatting
    
    * Remove function approval contents
    
    * Python: Refine samples and upgrade packages (#5261)
    
    * Refine samples and upgrade pacakges
    
    * Upgrade to a new package that fixes a bug
    
    * Update model env var
    
    * Move samples (#5281)
    
    * Python: Upgrade agentserver packages (#5284)
    
    * Upgrade agentserver packages
    
    * Fix new types
    
    * Python: Add special handling for workflows (#5298)
    
    * Add special handling for workflows
    
    * Address comments
    
    * Improve samples (#5372)
    
    * Python: Add more types (#5378)
    
    * Add more type supports
    
    * Upgrade packages
    
    * Remove TODOs in README
    
    * Fix README
    
    * Comments and mypy
    
    * User agent scoped
    
    * Fix README
    
    * Fix pre commit
    
    * Fix pre commit 2
    
    * Fix pre commit 3
    
    * Fix pre commit 4
    
    * Fix pre commit 5
    
    * Fix pre commit 6
    
    * Add azure-monitor-opentelemetry to dev deps
    
    Fixes Samples & Markdown CI failure. The PR's new transitive dep on
    azure-monitor-opentelemetry-exporter (via azure-ai-agentserver-core) makes
    pyright resolve the azure.monitor.opentelemetry namespace, flipping the
    check_md_code_blocks diagnostic for `configure_azure_monitor` from
    reportMissingImports (filtered) to reportAttributeAccessIssue (not filtered).
    Installing the umbrella azure-monitor-opentelemetry package in dev makes
    pyright resolve the symbol correctly, matching the install guidance the
    observability README already gives users.
    
    ---------
    
    Co-authored-by: Evan Mattson <evan.mattson@microsoft.com>
  • Python: Expose forwardedProps to agents and tools via session metadata (#5264)
    * Expose forwarded_props to agents and tools via session metadata (#5239)
    
    Include forwarded_props from AG-UI request input_data in session.metadata
    (agent runner) and function_invocation_kwargs (workflow runner) so that
    agents, tools, and workflow executors can access request-level metadata
    such as invocation source flags from CopilotKit.
    
    - Add forwarded_props to base_metadata in _agent_run.py when present
    - Add 'forwarded_props' to AG_UI_INTERNAL_METADATA_KEYS to filter it
      from LLM-bound client metadata
    - Extract forwarded_props in _workflow_run.py and pass via
      function_invocation_kwargs to workflow.run()
    - Accept both snake_case and camelCase keys (forwarded_props/forwardedProps)
    
    Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
    
    * fix(ag-ui): pass stream=True as literal to satisfy pyright overload resolution (#5239)
    
    The previous fix passed stream=True via **kwargs dict, which prevented
    pyright from resolving the Workflow.run() overload to the streaming
    variant. Pass stream=True as an explicit keyword argument so pyright
    can correctly infer the ResponseStream return type.
    
    Also remove unused pytest import in test file.
    
    Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
    
    * fix: address PR review feedback for forwarded_props (#5239)
    
    - Use key-presence checks instead of truthiness for forwarded_props so
      empty dict {} is forwarded correctly
    - Gate function_invocation_kwargs on workflow.run() signature inspection
      to avoid TypeError for workflows without **kwargs
    - Change _build_safe_metadata to drop (with warning) keys whose
      serialized values exceed 512 chars instead of truncating into invalid
      JSON
    - Rewrite metadata tests to exercise _build_safe_metadata directly with
      JSON-decodability and truncation assertions
    - Add workflow tests for empty dict forwarded_props, stream=True
      assertion, and signature-gated kwarg dropping
    
    Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
    
    * test: add stream=True assertions to CapturingWorkflow tests (#5239)
    
    Guard against accidental removal of the explicit stream=True kwarg
    in all forwarded_props CapturingWorkflow test cases.
    
    Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
    
    * Address review feedback for #5239: Python: Expose forwardedProps to agents and tools via session metadata
    
    ---------
    
    Co-authored-by: Copilot <copilot@github.com>
    Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
  • Python: Add support for Foundry Toolboxes (#5346)
    * Add support for the Foundry Toolbox in MAF
    
    Introduces a Foundry Toolbox integration: FoundryChatClient gains a
    get_toolbox() helper plus select_toolbox_tools(), normalize_tools in
    the core package flattens tool-collection wrappers (ToolboxVersionObject
    and generic iterables, while leaving Pydantic BaseModel instances
    alone), and the new agent_framework.foundry namespace re-exports the
    toolbox helpers. Ships with unit tests, a sample, and a design doc.
    
    azure-ai-projects is pinned to the public >=2.0.0,<3.0 range and the
    lockfile resolves from public PyPI. The toolbox test module skips when
    Toolbox* types are unavailable so CI stays green until the public 2.1.0
    SDK lands. OMC tooling directories (.omc/, .omx/) are gitignored.
    
    * Update to latest azure ai projects package
    
    * Improve sample
    
    * Rename ADR to 0025
    
    * Update ADR
    
    * Apply suggestion from @alliscode
    
    Co-authored-by: Ben Thomas <ben.thomas@microsoft.com>
    
    * Improve samples
    
    * Update test
    
    ---------
    
    Co-authored-by: Ben Thomas <ben.thomas@microsoft.com>
  • Python: Add search tool content for OpenAI responses (#5302)
    * Add OpenAI search tool content parsing
    
    Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
    
    * fix typing
    
    * simplified oai image test
    
    * same for azure
    
    * skip az responses api test
    
    ---------
    
    Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
  • .NET: Features/3768-devui-aspire-integration (#3771)
    * adds devui integration and samples
    
    * adds unit tests for devui integration
    
    * fix: correct formatting of copyright notice in unit test files
    
    * fixes formatting issues
    
    * fixes build for net8 target
    
    * fixes formatting errors on test apphost
    
    * adds copyright notice to multiple files and removes unnecessary using directives
    
    * Update dotnet/aspire-integration/Aspire.Hosting.AgentFramework.DevUI/DevUIAggregatorHostedService.cs
    
    Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
    
    * Update dotnet/aspire-integration/Aspire.Hosting.AgentFramework.DevUI/DevUIAggregatorHostedService.cs
    
    Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
    
    * Update dotnet/tests/Aspire.Hosting.AgentFramework.DevUI.UnitTests/Aspire.Hosting.AgentFramework.DevUI.UnitTests.csproj
    
    Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
    
    * Update dotnet/samples/DevUIIntegration/DevUIIntegration.AppHost/DevUIIntegration.AppHost.csproj
    
    Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
    
    * Update dotnet/aspire-integration/Aspire.Hosting.AgentFramework.DevUI/DevUIAggregatorHostedService.cs
    
    Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
    
    * Refactor project files to use TargetFrameworks instead of TargetFramework for multi-targeting support; add optional port property to DevUIResource class.
    
    * Add unit tests for DevUIAggregatorHostedService; refactor project files for TargetFrameworks support
    
    * Refactor project files to use TargetFrameworks for multi-targeting support in DevUIIntegration samples
    
    * Remove unnecessary using directive for Aspire.Hosting in DevUIAggregatorHostedServiceTests
    
    * merge
    
    * fixes Conversation routing for non-first backends
    
    * add documentation for devui integration sample
    
    * update project references in solution file for improved integration
    
    * fixes package versions post merge
    
    * move Aspire.Hosting.AgentFramework.DevUI to dotnet/src
    
    Move the project from aspire-integration/ to src/ to be consistent
    with the location of all other projects in the repo.
    
    * move DevUI sample to samples/05-end-to-end/DevUIAspireIntegration
    
    Move the sample from samples/DevUIIntegration/ to
    samples/05-end-to-end/DevUIAspireIntegration/ to match the location
    of other end-to-end samples.
    
    * remove unnecessary net472 framework condition from sample csproj files
    
    These projects only target net10.0, so the
    Condition="'$(TargetFramework)' != 'net472'" on ItemGroup is unnecessary.
    
    * update sample model name from gpt-4.1 to gpt-5.4
    
    Use a more up-to-date model name in the DevUI integration samples.
    
    * Revert "remove unnecessary net472 framework condition from sample csproj files"
    
    This reverts commit 08cf41253b.
    
    * fix: use TargetFrameworks to override multi-targeting from Directory.Build.props
    
    The parent Directory.Build.props sets TargetFrameworks to net10.0;net472,
    which overrides the singular TargetFramework in each csproj. Use the plural
    TargetFrameworks property set to net10.0 only to properly override it, and
    remove the now-unnecessary net472 condition on ItemGroup.
    
    * fixes aspire config
    
    * fix: update Microsoft.Extensions packages to version 10.0.1
    
    * Address Copilot review feedback on DevUI Aspire integration
    
    - Fix request body dropping in ProxyConversationsAsync: always read the
      body when ContentLength > 0 before routing, then pass it through to
      all proxy calls (previously null was passed when backend was resolved
      from query param or conversation map)
    - Fix resource leak: dispose aggregator on startup failure in catch block
    - Fix XML docs: accurately describe embedded resource serving behavior
    - Remove reflection from DevUIResourceTests (InternalsVisibleTo already set)
    - Make sensitive telemetry conditional on Development environment in samples
    
    Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
    
    * fix: update chat client version to gpt41 in both EditorAgent and WriterAgent
    
    ---------
    
    Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
    Co-authored-by: Roger Barreto <19890735+rogerbarreto@users.noreply.github.com>
    Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
  • Python: Flatten hyperlight execute_code output (#5333)
    * small fix for hyperlight
    
    * improved sandbox dependency
  • Python: Fix CopilotStudioAgent to reuse conversation ID from existing session (#5299)
    * Fix CopilotStudioAgent to reuse existing conversation on session (#5285)
    
    CopilotStudioAgent unconditionally called _start_new_conversation() in both
    _run_impl and _run_stream_impl, ignoring any existing service_session_id on
    the session. Add a guard to only start a new conversation when there is no
    existing service_session_id, matching the pattern used by other agents.
    
    Also fix pre-existing pyright reportMissingImports errors for orjson in
    file_history_provider samples.
    
    Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
    
    * Revert out-of-scope sample file changes
    
    Remove unrelated orjson type-ignore comment changes from sample files
    that were outside the scope of the conversation-ID reuse fix.
    
    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>
  • .NET: fix: Add session support for Handoff-hosted Agents (#5280)
    * fix: Add session support for Handoff-hosted Agents
    
    In order to better support using `Workflows` hosted as `AIAgents` inside of Handoff workflows, we need to make proper use of AgentSession. This causes potential issues around checkpointing and making sure that we properly compute only the new incoming messages for each agent invocation.
    
    * fix: AgentSession checkpointing using AIAgent's Serialize/Deserialize methods
    
    We cannot rely on implicit serialization through `HandoffHostState` because we are missing type information.
    
    * fix: Thread safety issue in `MultiPartyConversation.AllMessages`
    
    * fix: Enable unwrapping of FunctionResultContent when ExternalRequest was wrapped into FunctionCallContent
  • .NET: Add Code Interpreter container file download samples (#5014)
    * Add Code Interpreter container file download samples (#3081)
    
    - Add Agent_OpenAI_Step06_CodeInterpreterFileDownload (Public OpenAI)
    - Add Agent_Step24_CodeInterpreterFileDownload (Microsoft Foundry)
    - Both samples demonstrate downloading cfile_/cntr_ container files
      via ContainerClient instead of the standard Files API
    - Update solution file and parent READMEs
    
    * Address review feedback: flatten nested foreach loops using SelectMany
    
    Addresses https://github.com/microsoft/agent-framework/pull/5014#discussion_r3046908449 and https://github.com/microsoft/agent-framework/pull/5014#discussion_r3046920209
    
    ---------
    
    Co-authored-by: Roger Barreto <19890735+rogerbarreto@users.noreply.github.com>
    Co-authored-by: rogerbarreto <rogerbarreto@users.noreply.github.com>