Commit Graph

1447 Commits

  • .NET: [BREAKING] Add session StateBag for state storage and support multiple providers on the Agent (#3806)
    * .NET: [BREAKING] Add session statebag to use for state storage instead of inside providers (#3737)
    
    * Add a StateBag to AgentSession and pass Agent and AgentSession to AIContextProvider and ChatHistoryProviders
    
    * Convert all AIContextProviders to use the statebag
    
    * Update InMemoryChatHistoryProvider to use StateBag
    
    * Update Comsos and Workflow ChatHistoryProviders
    
    * Update 3rd party chat history storage sample.
    
    * Remove serialize method from providers
    
    * Replacing provider factories with properties
    
    * Remove Providers from Session and flatten state bag serialization
    
    * Update samples to use getservice on agent
    
    * Updated additional session types to serialize statebag
    
    * Fix regression
    
    * Address PR comments
    
    * Address PR comments.
    
    * Fix formatting
    
    * Fix unit tests
    
    * Remove InMemoryAgentSession since it is not required anymore.
    
    * Address PR comments
    
    * Convert sessions for A2AAgent, ChatClientAgent, CopilotStudioAgent and GithubCopilotAgent to use regular json serialization.
    
    * Fix durable agent session jso usgae
    
    * Add jso to InMemory and Workflow ChatHistoryProviders
    
    * Update InMemoryChatHistoryProvider to use an options class for it's many optional settings.
    
    * Apply suggestions from code review
    
    Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
    
    * Address PR feedback
    
    * Fix verification bug.
    
    * Improve state bag thread safety
    
    * Address PR comments and fix unit tests
    
    * Address PR comments
    
    * Fix unit test
    
    ---------
    
    Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
    
    * Add a public StateKey property to providers (#3810)
    
    * .NET: [BREAKING] Update providers in such a way that they can participate in a pipeline (#3846)
    
    * Make providers pipeline capable
    
    * Fix unit tests
    
    * Move source stamping to providers from base class
    
    * Also update samples.
    
    * Address PR comments
    
    * Rename AsAgentRequestMessageSourcedMessage to WithAgentRequestMessageSource
    
    * .NET: [BREAKING] Add consistent message filtering to all providers. (#3851)
    
    * Add consistent message filtering to all providers.
    
    * Remove old chat history filtering classes
    
    * Fix merge issues
    
    * Fix unit test
    
    * Enforce non-nullable property
    
    * Fix merging bug and make troubleshooting source info easier by adding tostring implementation
    
    * .NET: [BREAKING] Add support for multiple AIContextProviders on a ChatClientAgent (#3863)
    
    * Add support for multiple AIContextProviders on a ChatClientAgent
    
    * Address PR comments and fix tests
    
    * Address PR comments.
    
    * .NET: [BREAKING]Delay AIContext Materialization until the end of the pipeline is reached. (#3883)
    
    * Delay AIContext Materialization until the end of the pipeline is reached.
    
    * Address PR comments.
    
    * Address PR comments
    
    * Modify InvokedContext to be immutable (#3888)
    
    * .NET: Address Feedback on StateBag feature branch PR (#3910)
    
    * Address Feedback on statebag feature branch PR
    
    * Update dotnet/src/Microsoft.Agents.AI.DurableTask/CHANGELOG.md
    
    Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
    
    * Address PR comments
    
    ---------
    
    Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
    
    ---------
    
    Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
  • Python: Replace wildcard imports with explicit imports (#3908)
    * Python: Replace wildcard imports with explicit imports
    
    - Replace all 'from ... import *' with explicit symbol imports
    - Add __all__ declarations to namespace packages for re-exports
    - Update CODING_STANDARD.md to prohibit wildcard imports
    - Maintain exported API and preserve all functionality
    
    fixes #3605
    
    * Refine wildcard guidance example text
    
    * Simplify explicit exports without self-aliases
  • Python: fix: prevent repeating instructions in continued Responses API conversations (#3909)
    * fix: prevent repeating instructions in continued Responses API conversations
    
    - Instructions are now only prepended to messages on the first turn
    - When conversation_id/response_id exists (continuation), instructions are skipped
    - Covers OpenAI and Azure Responses API paths
    - Adds regression tests for all continuation scenarios
    
    Fixes #3498
    
    * Apply lint fixes to continuation tests
    
    * Consolidate responses continuation tests
  • .NET: Disable irrelevant integration test (#3913)
    * disable irrelevant integration test
    
    * Update dotnet/tests/AzureAI.IntegrationTests/AIProjectClientAgentStructuredOutputRunTests.cs
    
    Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
    
    ---------
    
    Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
  • .NET: Preserve caller context (#3803)
    * fix stuck orchestration
    
    * add previously removed RunAsync<T> method to DurableAIAgent
    
    * suppress IDE0005 warning
    
    * update changelog and remove unused constructor of AgentResponse<T>
    
    * updatge the changelog
    
    * address PR review feedback
  • .NET Workflows - Rename agent-provider and add comments (Declarative Workflows) (#3895)
    * Renamed with comments
    
    * Fix rename arcs
    
    * Integration tests
  • Python: Remove duplicate samples (#3899)
    * Remove duplicate samples
    
    * Correct paths
    
    * Update readme
    
    * Update readme
    
    * Fix ruff
    
    ---------
    
    Co-authored-by: Evan Mattson <35585003+moonbox3@users.noreply.github.com>
  • Python: Fix non-ascii chars in span attributes (#3894)
    * Fix non-ascii chars in span attributes
    
    * Comments
  • Python: Fix streamed workflow agent continuation context by finalizing AgentExecutor streams (#3882)
    * Fix streamed workflow agent continuation context by finalizing AgentExecutor streams
    
    * Fix stream handling
    
    * Fixes
    
    * Fix DevUI and tests
  • Python: (ag-ui): fix Workflow.as_agent() streaming regression (#3875)
    * fix Workflow.as_agent() streaming regression in ag-ui
    
    * Address PR feedback
    
    * PR feedback
  • Python: [BREAKING] PR2 — Wire context provider pipeline, remove old types, update all consumers (#3850)
    * PR2: Wire context provider pipeline and update all internal consumers
    
    - Replace AgentThread with AgentSession across all packages
    - Replace ContextProvider with BaseContextProvider across all packages
    - Replace context_provider param with context_providers (Sequence)
    - Replace thread= with session= in run() signatures
    - Replace get_new_thread() with create_session()
    - Add get_session(service_session_id) to agent interface
    - DurableAgentThread -> DurableAgentSession
    - Remove _notify_thread_of_new_messages from WorkflowAgent
    - Wire before_run/after_run context provider pipeline in RawAgent
    - Auto-inject InMemoryHistoryProvider when no providers configured
    
    * fix: update all tests for context provider pipeline, fix lazy-loaders, remove old test files
    
    * refactor: update all sample files for context provider pipeline (AgentThread→AgentSession, ContextProvider→BaseContextProvider)
    
    * fix: update remaining ag-ui references (client docstring, getting_started sample)
    
    * fix: make get_session service_session_id keyword-only to avoid confusion with session_id
    
    * refactor: rename _RunContext.thread_messages to session_messages
    
    * refactor: remove _threads.py, _memory.py, and old provider files; migrate devui to use plain message lists
    
    * rename: remove _new_ prefix from test files
    
    * refactor: rewrite SlidingWindowChatMessageStore as SlidingWindowHistoryProvider(InMemoryHistoryProvider)
    
    * fix: read full history from session state directly instead of reaching into provider internals
    
    * fix: update stale .pyi stubs, sample imports, and README references for new provider types
    
    * fix: remove stale message_store, _notify_thread_of_new_messages, and session_id.key references in samples
    
    * refactor: merge context_providers and sessions sample folders into sessions, remove aggregate_context_provider
    
    * refactor: UserInfoMemory stores state in session.state instead of instance attributes
    
    * feat: add Pydantic BaseModel support to session state serialization
    
    Pydantic models stored in session.state are now automatically serialized
    via model_dump() and restored via model_validate() during to_dict()/from_dict()
    round-trips. Models are auto-registered on first serialization; use
    register_state_type() for cold-start deserialization.
    
    Also export register_state_type as a public API.
    
    * fix mem0
    
    * Update sample README links and descriptions for session terminology
    
    - Replace 'thread' with 'session' in sample descriptions across all READMEs
    - Update file links for renamed samples (mem0_sessions, redis_sessions, etc.)
    - Fix Threads section → Sessions section in main samples/README.md
    - Update tools, middleware, workflows, durabletask, azure_functions READMEs
    - Update architecture diagrams in concepts/tools/README.md
    - Update migration guides (autogen, semantic-kernel)
    
    * Fix broken Redis README link to renamed sample
    
    * Fix Mem0 OSS client search: pass scoping params as direct kwargs
    
    AsyncMemory (OSS) expects user_id/agent_id/run_id as direct kwargs,
    while AsyncMemoryClient (Platform) expects them in a filters dict.
    Adds tests for both client types.
    
    Port of fix from #3844 to new Mem0ContextProvider.
    
    * Fix rebase issues: restore missing _conversation_state.py and checkpoint decode logic
    
    - Add back _conversation_state.py (encode/decode_chat_messages) lost in rebase
    - Fix on_checkpoint_restore to decode cache/conversation with decode_chat_messages
    - Fix on_checkpoint_restore to use decode_checkpoint_value for pending requests
    - Add tests/workflow/__init__.py for relative import support
    - Fix test_agent_executor checkpoint selection (checkpoints[1] not superstep)
    
    * Add STORES_BY_DEFAULT ClassVar to skip redundant InMemoryHistoryProvider injection
    
    Chat clients that store history server-side by default (OpenAI Responses API,
    Azure AI Agent) now declare STORES_BY_DEFAULT = True. The agent checks this
    during auto-injection and skips InMemoryHistoryProvider unless the user
    explicitly sets store=False.
    
    * Fix broken markdown links in azure_ai and redis READMEs
    
    * Fix getting-started samples to use session API instead of removed thread/ContextProvider API
    
    * updates to workflow as agent
    
    * fix group chat import
    
    * Rename Thread→Session throughout, fix service_session_id propagation, remove stale AGUIThread
    
    - Fix: Propagate conversation_id from ChatResponse back to session.service_session_id
      in both streaming and non-streaming paths in _agents.py
    - Rename AgentThreadException → AgentSessionException
    - Remove stale AGUIThread from ag_ui lazy-loader
    - Rename use_service_thread → use_service_session in ag-ui package
    - Rename test functions from *_thread_* to *_session_*
    - Rename sample files from *_thread* to *_session*
    - Update docstrings and comments: thread → session
    - Update _mcp.py kwargs filter: add 'session' alongside 'thread'
    - Fix ContinuationToken docstring example: thread=thread → session=session
    - Fix _clients.py docstring: 'Agent threads' → 'Agent sessions'
    
    * Fix broken markdown links after thread→session file renames
    
    * fix azure ai test
  • .NET: Update GitHub.Copilot.SDK to 0.1.23 and copy new session config prope… (#3788)
    * Update GitHub.Copilot.SDK to 0.1.23 and copy new session config properties
    
    - Bump GitHub.Copilot.SDK from 0.1.18 to 0.1.23
    - Add new SessionConfig properties: ReasoningEffort, Hooks, OnUserInputRequest,
      WorkingDirectory, ConfigDir, InfiniteSessions
    - Add missing ResumeSessionConfig properties: Model, SystemMessage,
      AvailableTools, ExcludedTools, ReasoningEffort, Hooks, OnUserInputRequest,
      WorkingDirectory, ConfigDir, InfiniteSessions
    - Fix UserMessageDataAttachmentsItem -> UserMessageDataAttachmentsItemFile
      for new polymorphic attachment API
    - Add unit tests for new session config properties
    
    * Address PR review: centralize config mapping and improve test coverage
    
    - Extract CopySessionConfig/CopyResumeSessionConfig as internal static helpers
      to eliminate duplicated mapping logic between RunCoreStreamingAsync and
      CreateResumeConfig (addresses reviewer comment on drift risk)
    - Add InternalsVisibleTo for unit test project
    - Replace shallow constructor tests with comprehensive property-verification
      tests that validate every config property is correctly copied, including
      OnUserInputRequest (addresses reviewer comments on test coverage)
    
    * Remove accidentally committed git-lfs hooks
  • Python: restructure: Python samples into progressive 01-05 layout (#3862)
    * restructure: Python samples into progressive 01-05 layout
    
    - 01-get-started/: 6 numbered steps (hello agent → hosting)
    - 02-agents/: all agent concept samples (tools, middleware, providers, etc.)
    - 03-workflows/: ALL existing workflow samples preserved as-is
    - 04-hosting/: azure-functions, durabletask, a2a
    - 05-end-to-end/: demos, evaluation, hosted agents
    - Old files moved to _to_delete/ for review
    - Added AGENTS.md with structure documentation
    - autogen-migration/ and semantic-kernel-migration/ preserved at root
    
    * fix: switch to AzureOpenAI Foundry, fix CI failures
    
    - Switch all 01-get-started samples to AzureOpenAIResponsesClient with
      Azure AI Foundry project endpoint (AZURE_AI_PROJECT_ENDPOINT +
      AZURE_OPENAI_RESPONSES_DEPLOYMENT_NAME + AzureCliCredential)
    - Add _to_delete/ and 05-end-to-end/ to pyrightconfig.samples.json excludes
    - Fix test paths in packages/ that referenced old getting_started/ dirs:
      durabletask conftest + streaming test, azurefunctions conftest,
      devui conftest + capture_messages + openai_sdk_integration
    - Fix workflow_as_agent_human_in_the_loop.py import (sibling import)
    - Update hosting READMEs and tool comment paths
    - Replace root README.md with new structure overview
    - Update AGENTS.md to document Azure OpenAI Foundry as default provider
    
    * cleanup: remove _to_delete folder, copy resource files to active dirs
    
    All files in _to_delete/ were either:
    - Exact duplicates of files in the new structure (240 files)
    - Same file with only comment path updates (100 files)
    - One import-fix diff (workflow_as_agent_human_in_the_loop.py)
    - One superseded minimal_sample.py
    
    Resource files (sample.pdf, countries.json, employees.pdf, weather.json)
    copied to 02-agents/sample_assets/ and 02-agents/resources/ since active
    samples reference them.
    
    * fix: address PR review comments, centralize resources, remove root duplicates
    
    - Fix type annotation in 04_memory.py (string union -> proper types)
    - Fix old sample paths in observability files
    - Fix grammar/spelling in observability samples
    - Move sample_assets/ and resources/ to shared/ folder
    - Remove 8 duplicate observability files from 02-agents root
    - Update resource path references in multimodal_input and provider samples
    
    * fix: update broken links from old getting_started paths to new structure
    
    - Update relative paths in READMEs: getting_started/ → 01-get-started/,
      02-agents/, 03-workflows/, 04-hosting/, 05-end-to-end/
    - Fix absolute GitHub URLs in package READMEs
    - Fix broken link in ollama package README
    
    * fix: convert absolute GitHub URLs to relative paths for link checker
    
    Absolute URLs to python/samples/ on main branch 404 until PR merges.
    Converted to relative paths that linkspector can verify locally.
    
    * fix: update link for handoff sample moved to orchestrations/
    
    * fix: update chatkit-integration README path from demos/ to 05-end-to-end/
    
    * fix: update broken links in orchestrations README to match flat directory structure
  • .NET Workflows - Add unit tests for ForeachExecutor (Declarative Workflows) (#3835)
    * Initial plan
    
    * Add comprehensive unit tests for ForeachExecutor
    
    Co-authored-by: crickman <66376200+crickman@users.noreply.github.com>
    
    * Formatting
    
    * Checkpoint
    
    * Checkpoint
    
    * Updated test capabilities for non-discrete
    
    * Update dotnet/tests/Microsoft.Agents.AI.Workflows.Declarative.UnitTests/ObjectModel/ForeachExecutorTest.cs
    
    Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
    
    * Update dotnet/tests/Microsoft.Agents.AI.Workflows.Declarative.UnitTests/ObjectModel/ForeachExecutorTest.cs
    
    Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
    
    * Consistency
    
    * Cleanup test
    
    * Fixed
    
    ---------
    
    Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
    Co-authored-by: crickman <66376200+crickman@users.noreply.github.com>
    Co-authored-by: Chris Rickman <crickman@microsoft.com>
    Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
  • Bump pillow from 12.1.0 to 12.1.1 in /python (#3852)
    Bumps [pillow](https://github.com/python-pillow/Pillow) from 12.1.0 to 12.1.1.
    - [Release notes](https://github.com/python-pillow/Pillow/releases)
    - [Changelog](https://github.com/python-pillow/Pillow/blob/main/CHANGES.rst)
    - [Commits](https://github.com/python-pillow/Pillow/compare/12.1.0...12.1.1)
    
    ---
    updated-dependencies:
    - dependency-name: pillow
      dependency-version: 12.1.1
      dependency-type: indirect
    ...
    
    Signed-off-by: dependabot[bot] <support@github.com>
    Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
  • Python: Centralize tool result parsing in FunctionTool.invoke() (#3854)
    * Centralize tool result parsing in FunctionTool.invoke()
    
    - Add parse_result static method to FunctionTool that converts raw
      function return values to strings at invocation time
    - Add result_parser parameter to FunctionTool and @tool decorator
      for custom parsing
    - Remove prepare_function_call_results from all 9 consumer files
      and from the public API
    - Update MCPTool to parse MCP types directly to strings via
      _parse_tool_result_from_mcp and _parse_prompt_result_from_mcp
    - Change MCPTool parse_tool_results/parse_prompt_results type from
      Literal[True] | Callable | None to Callable | None
    - Remove ReturnT type parameter from FunctionTool (now single
      generic ArgsT since invoke() always returns str)
    - Update all subclass signatures and docstrings
    
    Fixes #1147
    
    * Fix test_mcp_tool_call_tool_with_meta_integration for string results
    
    The test was still accessing result[0].additional_properties but
    invoke() now returns a string, not a list of Content objects.
    
    * Fix SIM108 lint: use binary operator for output assignment
    
    * Fix bedrock: use FunctionTool.parse_result instead of str() fallback
    
    str(result) turns None into literal 'None' and dicts into Python reprs
    with single quotes, breaking JSON parsing. Use the shared parse_result
    which handles None as '' and serializes via json.dumps.
    
    * updated lock
    
    * updates from feedback
  • .NET: [BREAKING] Change SerializeSession to be Async (#3879)
    * Change SerializeSession to be Async
    
    * Update Changelog
  • Python: (samples): adopt AzureOpenAIResponsesClient, reorganize orchestration examples, and fix workflow/orchestration bugs (#3873)
    * adopt AzureOpenAIResponsesClient, reorganize orchestration examples, and fix workflow/orchestration bugs
    
    * Updates
    
    * add comment
  • Python: Replace Pydantic Settings with TypedDict + load_settings() (#3843)
    * Replace Pydantic Settings with TypedDict + load_settings()
    
    - Remove pydantic-settings dependency, add python-dotenv
    - Delete _pydantic.py (AFBaseSettings, HTTPsUrl)
    - Add _settings.py with generic load_settings() function, SecretString,
      type coercion, and Required field validation (SettingNotFoundError)
    - Convert all 13 settings classes from AFBaseSettings subclasses to
      TypedDict definitions with load_settings() calls
    - Update all consumers from attribute access to dict access
    - Add 20 unit tests for load_settings() covering basic loading, dotenv,
      SecretString, type coercion, and required field validation
    - Update all existing tests for new settings patterns
    
    * Fix mypy type errors from settings conversion
    
    - Fix str | None attribute access in responses_client (walrus operator)
    - Fix SecretString | None narrowing in bedrock (type: ignore after guard)
    - Convert _context_provider.py attribute access to dict access (missed file)
    - Fix endpoint type narrowing in search_provider and context_provider
    - Fix purview: str | None .rstrip(), int | None defaults, urlparse bytes
    
    * Address PR review: required_fields param, type validation, fixes
    
    - Move required field validation from TypedDict annotations (Required)
      to a required_fields parameter on load_settings(), enabling runtime
      decisions about which fields are required
    - Remove Required imports and restore from __future__ import annotations
      in ollama and foundry_local
    - Add _check_override_type() for deterministic ServiceInitializationError
      on invalid override types (e.g. dict passed for str field)
    - Fix all multi-exception test catches back to single exception type
    - Fix Ollama host=None: use .get() so None is passed through to SDK default
    - Fix Purview processor: use explicit is-None checks instead of or operator
    - Remove unused BaseModel import from openai/_shared.py
    - Add 4 new tests (24 total): required_fields param, type validation
    
    * Fix type validation: allow int for float fields
    
    _check_override_type now permits int values for float-typed fields,
    matching Python's standard numeric promotion behavior.
    
    * fix: wrap urlparse arg with str() to fix mypy bytes endswith error
  • .NET Workflows - Add unit tests for DefaultActionExecutor (Declarative Workflows) (#3836)
    * Initial plan
    
    * Add comprehensive unit tests for DefaultActionExecutor with 100% code coverage
    
    Co-authored-by: crickman <66376200+crickman@users.noreply.github.com>
    
    * Address code review feedback: Add explicit Xunit using and improve variable naming
    
    Co-authored-by: crickman <66376200+crickman@users.noreply.github.com>
    
    * Streamlined tests
    
    * Update dotnet/tests/Microsoft.Agents.AI.Workflows.Declarative.UnitTests/ObjectModel/DefaultActionExecutorTest.cs
    
    Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
    
    * Restore all 4 test cases and remove redundant event assertions
    
    Co-authored-by: crickman <66376200+crickman@users.noreply.github.com>
    
    * Remove redudant tests
    
    ---------
    
    Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
    Co-authored-by: crickman <66376200+crickman@users.noreply.github.com>
    Co-authored-by: Chris Rickman <crickman@microsoft.com>
    Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
  • Python: Fix declarative package powerfx import crash and response_format kwarg error (#3841)
    * Fix declarative package powerfx import crash and response_format kwarg error
    
    * Address PR feedback. Propagate kwargs for declarative workflows
    
    * move tests
    
    * Fix options merge logic
  • .NET Workflows - Add unit tests for CopyConversationMessagesExecutor (Declarative Workflows) (#3834)
    * Initial plan
    
    * Add CopyConversationMessagesExecutorTest with 7 comprehensive test cases
    
    Co-authored-by: crickman <66376200+crickman@users.noreply.github.com>
    
    * Simplify ExecuteTestAsync to avoid duplicate event filtering logic
    
    Co-authored-by: crickman <66376200+crickman@users.noreply.github.com>
    
    * Refine
    
    ---------
    
    Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
    Co-authored-by: crickman <66376200+crickman@users.noreply.github.com>
    Co-authored-by: Chris Rickman <crickman@microsoft.com>
  • [BREAKING] Python: Checkpoint refactor: encode/decode, checkpoint format, etc (#3744)
    * WIP: Checkpoint refactor: encode/decode, checkpoint format, etc
    
    * WIP: Remove workflow ID in checkpoints
    
    * Refactor checkpointing
    
    * Add get_latest tests
    
    * Increase test coverage
    
    * Fix formatting
    
    * Fix unit tests
    
    * Fix samples
    
    * fix unit tests
    
    * fix pipeline
    
    * Copilot comments
    
    * Fix tests
    
    * Fix more tests
    
    * Address comments part 1
    
    * Address comments part 2
    
    * Comments
  • .NET Workflows - Add unit tests for EditTableExecutorAction (Declarative Workflows) (#3832)
    * Initial plan
    
    * Add comprehensive unit tests for EditTableExecutor with 100% coverage
    
    Co-authored-by: crickman <66376200+crickman@users.noreply.github.com>
    
    * Remove redundant State.Bind() calls from EditTableExecutorTest
    
    Co-authored-by: crickman <66376200+crickman@users.noreply.github.com>
    
    * Fix formatting
    
    * Update dotnet/tests/Microsoft.Agents.AI.Workflows.Declarative.UnitTests/ObjectModel/EditTableExecutorTest.cs
    
    Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
    
    ---------
    
    Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
    Co-authored-by: crickman <66376200+crickman@users.noreply.github.com>
    Co-authored-by: Chris Rickman <crickman@microsoft.com>
    Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
  • Python: Add more packages to unit test coverage gate (#3831)
    * Add more packages to unit test coverage gate
    
    * Trigger workflow
    
    * Remove azure ai search
    
    * Add purview
    
    * Add declarative to coverage report
  • Bump cryptography from 46.0.4 to 46.0.5 in /python (#3839)
    Bumps [cryptography](https://github.com/pyca/cryptography) from 46.0.4 to 46.0.5.
    - [Changelog](https://github.com/pyca/cryptography/blob/main/CHANGELOG.rst)
    - [Commits](https://github.com/pyca/cryptography/compare/46.0.4...46.0.5)
    
    ---
    updated-dependencies:
    - dependency-name: cryptography
      dependency-version: 46.0.5
      dependency-type: indirect
    ...
    
    Signed-off-by: dependabot[bot] <support@github.com>
    Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
  • Python: Allow AzureOpenAIResponsesClient creation with Foundry project endpoint (#3814)
    * Initial plan
    
    * feat: extend AzureOpenAIResponsesClient to support Foundry project endpoints
    
    Add project_client and project_endpoint parameters to allow creating
    the client via an Azure AI Foundry project. When provided, the client
    uses AIProjectClient.get_openai_client() to obtain the OpenAI client.
    The azure-ai-projects package is imported lazily and only required
    when using the project endpoint path.
    
    Co-authored-by: eavanvalkenburg <13749212+eavanvalkenburg@users.noreply.github.com>
    
    * fix: address code review - remove duplicate MagicMock imports in tests
    
    Co-authored-by: eavanvalkenburg <13749212+eavanvalkenburg@users.noreply.github.com>
    
    * fix: add type field to Responses API input items and add Foundry sample
    
    - Add 'type: message' to input items in _prepare_message_for_openai
      to comply with the Responses API schema requirement
    - Filter out empty dicts from unsupported content types to prevent
      sending items with invalid empty type values
    - Add azure_responses_client_with_foundry.py sample demonstrating
      AzureOpenAIResponsesClient with project_endpoint
    - Update README and pyrightconfig.samples.json accordingly
    
    * updates to response format and setup
    
    * fix: patch AIProjectClient at correct module path in test
    
    Patch agent_framework.azure._responses_client.AIProjectClient instead of
    azure.ai.projects.aio.AIProjectClient since the import is at module level.
    
    * docs: add Foundry sample to READMEs and document AZURE_AI_PROJECT_ENDPOINT env var
    
    ---------
    
    Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
    Co-authored-by: eavanvalkenburg <13749212+eavanvalkenburg@users.noreply.github.com>
    Co-authored-by: eavanvalkenburg <github@vanvalkenburg.eu>
  • .NET: Move SO agent to samples (#3820)
    * move SO agent to samples
    
    * change file encoding
    
    * fix files encoding
  • Bump poethepoet from 0.40.0 to 0.41.0 in /python (#3767)
    Bumps [poethepoet](https://github.com/nat-n/poethepoet) from 0.40.0 to 0.41.0.
    - [Release notes](https://github.com/nat-n/poethepoet/releases)
    - [Commits](https://github.com/nat-n/poethepoet/compare/v0.40.0...v0.41.0)
    
    ---
    updated-dependencies:
    - dependency-name: poethepoet
      dependency-version: 0.41.0
      dependency-type: direct:development
      update-type: version-update:semver-minor
    ...
    
    Signed-off-by: dependabot[bot] <support@github.com>
    Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
    Co-authored-by: Mark Wallace <127216156+markwallace-microsoft@users.noreply.github.com>
  • Python: [BREAKING] Replace Hosted*Tool classes with tool methods (#3634)
    * Replace Hosted*Tool classes with client static factory methods
    
    * fixed failing test
    
    * mypy fix
    
    * mypy fix 2
    
    * declarative mypy fix
    
    * addressed comments
    
    * ToolProtocol removal
    
    * fixed test
    
    * agents mypy fix
    
    * fix failing tests
    
    * mypy fix
    
    * addressed comments
    
    * fixed tests
    
    * addressed comments + added factory method overrides for azureai v2 client
    
    * mypy fix
    
    * added kwargs to azureai tool methods
    
    * fixed in test
    
    * _sessions fix
    
    * test fix
  • .NET: Add unit tests for EditTableV2Executor (#3773)
    * Initial plan
    
    * Add comprehensive unit tests for EditTableV2Executor
    
    - Test AddItemOperation with record and scalar values
    - Test ClearItemsOperation
    - Test RemoveItemOperation
    - Test TakeLastItemOperation (with items and empty table)
    - Test TakeFirstItemOperation (with items and empty table)
    - Test error cases (null ItemsVariable, non-table variable)
    - Include ExecuteTestAsync and CreateModel helper methods
    - All 10 tests passing
    
    Co-authored-by: crickman <66376200+crickman@users.noreply.github.com>
    
    * Add comprehensive unit tests for EditTableV2Executor - complete with 100% coverage
    
    - Added 13 comprehensive tests covering all code paths
    - Test AddItemOperation with record and scalar values
    - Test ClearItemsOperation
    - Test RemoveItemOperation (including non-table value case)
    - Test TakeLastItemOperation (with items and empty table)
    - Test TakeFirstItemOperation (with items and empty table)
    - Test error cases (null ItemsVariable, non-table variable, null operation values)
    - Include ExecuteTestAsync and CreateModel helper methods
    - 100% line and branch coverage achieved
    
    Co-authored-by: crickman <66376200+crickman@users.noreply.github.com>
    
    * Update tests / refine product code
    
    * Checkpoint
    
    * Updated
    
    * Update dotnet/tests/Microsoft.Agents.AI.Workflows.Declarative.UnitTests/ObjectModel/SetTextVariableExecutorTest.cs
    
    Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
    
    * Address code review feedback
    
    - Fix typo: rename metadataExpresssion to metadataExpression
    - Fix test name in AddMessageWithMetadataAsync (was using wrong test name)
    - Fix test name in ClearGlobalScopeAsync (was using wrong test name)
    - Remove pre-population in SetTextVariableExecutorTest that made tests ineffective
    - Use explicit .Where() filter in SetMultipleVariablesExecutorTest foreach loop
    
    Co-authored-by: crickman <66376200+crickman@users.noreply.github.com>
    
    ---------
    
    Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
    Co-authored-by: crickman <66376200+crickman@users.noreply.github.com>
    Co-authored-by: Chris Rickman <crickman@microsoft.com>
    Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
  • Python: [BREAKING] Simplify API: ChatAgent -> Agent, ChatMessage -> Message (#3747)
    * [BREAKING] Rename ChatAgent -> Agent, ChatMessage -> Message, ChatClientProtocol -> SupportsChatGetResponse
    
    Simplify the public API by removing redundant 'Chat' prefix from core types:
    - ChatAgent -> Agent
    - RawChatAgent -> RawAgent
    - ChatMessage -> Message
    - ChatClientProtocol -> SupportsChatGetResponse
    
    Also renamed internal WorkflowMessage (was Message in _runner_context) to avoid collision.
    
    No backward compatibility aliases - this is a clean breaking change.
    
    * [BREAKING] Rename Agent chat_client parameter to client
    
    * Fix rebase issues: WorkflowMessage references and broken markdown links
    
    * Fix formatting and lint issues from code quality checks
    
    * Fix import ordering in workflow sample files
    
    * fixed rebase
    
    * Fix test failures: use WorkflowMessage and A2AMessage after ChatMessage→Message rename
    
    - Replace Message(data=..., source_id=...) with WorkflowMessage(...) in workflow tests
    - Fix isinstance check in A2A agent to use A2AMessage instead of Message
    - Fix import in test_workflow_observability.py (Message→WorkflowMessage)
    
    * Fix lint, fmt, and sample errors after ChatMessage→Message rename
    
    - Auto-fix 70+ ruff lint issues across samples (ChatMessage→Message refs)
    - Fix HostedVectorStoreContent→Content.from_hosted_vector_store in file search sample
    - Fix _normalize_messages→normalize_messages in custom agent sample
    - Fix context.terminate→raise MiddlewareTermination in middleware samples
    - Fix with_update_hook→with_transform_hook in override middleware sample
    - Add TOptions_co import back to custom_chat_client sample
    - Add noqa for FastAPI File() default in chatkit sample
    - Fix B023 loop variable capture in weather agent sample
    
    * fix: update Agent constructor calls from chat_client to client in declaration-only tool tests
    
    * fix: add register_cleanup to devui lazy-loading proxy and type stub
    
    * fixed tests and updated new pieces
    
    * fix agui typevar
    
    * fix merge errors
    
    * fix merge conflicts
    
    * fiux merge
    
    * Remove unused links
    
    ---------
    
    Co-authored-by: Evan Mattson <evan.mattson@microsoft.com>
  • [BREAKING] Python: Remove workflow register factory methods. Update tests and samples (#3781)
    * Remove workflow register factory methods. Update tests and samples
    
    * Address Copilot feedback
  • Python: PR1 — New session and context provider types (side-by-side) (#3763)
    * PR1: Add core context provider types and tests
    
    New types in _sessions.py (no changes to existing code):
    - SessionContext: per-invocation state with extend_messages/get_messages/
      extend_instructions/extend_tools and read-only response property
    - _ContextProviderBase: base class with before_run/after_run hooks
    - _HistoryProviderBase: storage base with load/store flags, abstract
      get_messages/save_messages, default before_run/after_run
    - AgentSession: lightweight session with state dict, to_dict/from_dict
    - InMemoryHistoryProvider: built-in provider storing in session.state
    
    35 unit tests covering all classes and configuration flags.
    
    * feat: keyword-only params, stateless InMemoryHistoryProvider, deep serialization
    
    - Make before_run/after_run parameters keyword-only
    - InMemoryHistoryProvider stores ChatMessage objects directly (no per-cycle serialization)
    - Deep serialization via to_dict/from_dict only at session boundary
    - State type registry for automatic deserialization of registered types
    - Updated tests for new serialization approach
    
    * feat: add new-pattern provider implementations for external packages
    
    - _RedisContextProvider(BaseContextProvider) - Redis search/vector context
    - _RedisHistoryProvider(BaseHistoryProvider) - Redis-backed message storage
    - _Mem0ContextProvider(BaseContextProvider) - Mem0 semantic memory
    - _AzureAISearchContextProvider(BaseContextProvider) - Azure AI Search (semantic + agentic)
    
    All use temporary _ prefix names for side-by-side coexistence with existing providers.
    Will be renamed in PR2 when old ContextProvider/ChatMessageStore are removed.
    
    * test: add tests for new-pattern provider implementations
    
    - 32 tests for _RedisContextProvider and _RedisHistoryProvider
    - 29 tests for _Mem0ContextProvider
    - 17 tests for _AzureAISearchContextProvider
    
    * fix: address PR review comments and CI failures
    
    - Move module docstring before imports in _sessions.py (review comment)
    - Import TYPE_CHECKING unconditionally in Redis _context_provider.py (NameError on Python <3.12)
    - Fix Mem0 test_init_auto_creates_client_when_none to patch at class level
    
    * feat: add source attribution to extend_messages
    
    Set attribution marker in additional_properties for each message
    added via extend_messages(), matching the tool attribution pattern.
    Uses setdefault to preserve any existing attribution.
    
    * refactor: make attribution value a dict with source_id key
    
    * add attribution and use sets for filters
    
    * Add source_type to message attribution and copy messages in extend_messages
    
    - SessionContext.extend_messages now accepts source as str or object with
      source_id attribute; when an object is passed, its class name is recorded
      as source_type in the attribution dict
    - Messages are shallow-copied before attribution is added so callers'
      original objects are never mutated
    - Filter framework-internal keys (attribution) from A2A wire metadata
      to prevent leaking internal state over the wire
    
    * fix: correct mypy type: ignore comment from union-attr to attr-defined
    
    * set attribution to _attribution
    
    * adjusted naming of bools