Commit Graph

2155 Commits

  • .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>
  • 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
  • Python: Add long-running agents and background responses support (#3808)
    * Python: Add long-running agents and background responses support
    
    - Add ContinuationToken TypedDict to core types
    - Add continuation_token field to ChatResponse, ChatResponseUpdate,
      AgentResponse, and AgentResponseUpdate
    - Add background and continuation_token options to OpenAIResponsesOptions
    - Implement polling via responses.retrieve() and streaming resumption
      in RawOpenAIResponsesClient
    - Propagate continuation tokens through agent run() and
      map_chat_to_agent_update
    - Fix streaming telemetry 'Failed to detach context' error in both
      ChatTelemetryLayer and AgentTelemetryLayer by avoiding
      trace.use_span() context attachment for async-managed spans
    - Add 14 unit tests for continuation token types and background flows
    - Add background_responses sample showing polling and stream resumption
    
    Fixes #2478
    
    * Python: Add A2A long-running task support via ContinuationToken
    
    - Make ContinuationToken provider-agnostic (total=False, optional task_id/context_id fields)
    - Add background param to A2AAgent.run() controlling token emission
    - Add poll_task() for single-request task state retrieval
    - Add resubscribe support via continuation_token param on run()
    - Extract _updates_from_task() and _map_a2a_stream() for cleaner code
    - Streamline run()/streaming by removing intermediate _stream_updates wrapper
    - Update A2A sample to show background=False (default) with link to background_responses sample
    - Remove stale BareAgent from __all__
    - Add 12 new A2A continuation token tests
    
    * fix logic for overriding continuation token when done
    
    * refactored ContinuationToken setup
  • Python: Add streaming support for code interpreter deltas (#3775)
    * add streaming support for code interpreter deltas
    
    * addressed copilot comments
    
    * mypy fix
  • Python: [BREAKING] Standardize TypeVar naming convention (TName → NameT) (#3770)
    * standardized typevar to use suffix T
    
    * addressed copilot comments
  • .NET: [BREAKING] Update message source code to match python. (#3805)
    * Update message source code to match python.
    
    * Apply suggestion from @Copilot
    
    Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
    
    * Address PR comment
    
    * Move setting of source information to extension method
    
    * Add underscore for attribution key to indicate internal usage
    
    * Stick to version 102 of the SDK since 103 is causing issues.
    
    * Revert global.json change
    
    * Fix unit test
    
    ---------
    
    Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
  • Python: Include sub-workflow structure in graph signature for checkpoint validation (#3783)
    * Include sub-workflow structure in graph signature for checkpoint validation
    
    * Remove redundant computation
  • .NET: Add Foundry Agents Tool Sample - Local MCP (#3703)
    * .NET: Add Local MCP sample #3674
    
    * Apply format fixes
    
    * .NET: Use local MCP client instead of hosted MCP in Step27 sample
    
    * Address PR review feedback: cleanup, try/finally, update parent README
  • .NET: Fix: Checkpoint Deserialization breaks when JSON metadata properties are out of order (#3442)
    * Fix checkpoint JSON deserialization with out-of-order metadata properties (#2962)
    
    * Simplify: propagate AllowOutOfOrderMetadataProperties from incoming JsonSerializerOptions
  • Fix streaming path to include chat history in messages sent to chat client (#3798)
    RunCoreStreamingAsync was passing inputMessagesForProviders (which lacks
    chat history) to GetStreamingResponseAsync instead of
    inputMessagesForChatClient (which includes chat history). This caused
    streaming runs to lose conversation context on subsequent calls.
    
    The non-streaming path (RunCoreAsync) already correctly used
    inputMessagesForChatClient. This aligns the streaming path to match.
    
    Also adds a unit test that validates chat history is included in
    messages sent to the chat client during streaming on subsequent calls.
    
    Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
    Co-authored-by: lokitoth <6936551+lokitoth@users.noreply.github.com>
  • Python: Fix prek runner duplication and add skills (#3791)
    * Python: fix prek runner running fmt/lint in all packages on core change
    
    When a core package file changed, run_tasks_in_changed_packages.py ran
    fmt, lint, and pyright in ALL 22 packages (66 tasks). Only type-checking
    tasks (pyright, mypy) need to propagate to all packages since type
    changes in core affect downstream packages. File-local tasks (fmt, lint)
    only need to run in packages with actual file changes.
    
    This reduces a core-only change from 66 tasks to 24 tasks (2 local +
    22 pyright).
    
    Also adds no-commit-to-branch builtin hook to protect the main branch
    from direct commits.
    
    * Python: add agent skills extracted from AGENTS.md and coding standards
    
    Add 5 skills to python/.github/skills/ following the Agent Skills format:
    - python-development: coding standards, type annotations, docstrings, logging
    - python-testing: test structure, fixtures, running tests, async mode
    - python-code-quality: linting, formatting, type checking, prek hooks, CI
    - python-package-management: monorepo structure, lazy loading, versioning
    - python-samples: sample structure, PEP 723, documentation guidelines
    
    * Python: deduplicate AGENTS.md and instructions with agent skills
    
    * updated skills
    
    * fixes from review
    
    * Python: increase timeout for web search integration test
  • Python: Fix code samples in AGENTS.md files that fail pre-commit checks (#3779)
    * Fix code samples in AGENTS.md files that fail pre-commit checks
    
    * Fixes
  • Python: ADR: Unifying Context Management with ContextMiddleware (Python) (#3609)
    * Add ADR for Python ContextMiddleware unification
    
    * Add session serialization/deserialization design to ADR
    
    * Add Related Issues section mapping to ADR
    
    * Update session management: create_session, get_session_by_id, agent.serialize_session
    
    * ADR: Add hooks alternative, context compaction discussion, and PR feedback
    
    - Add Option 3: ContextHooks with before_run/after_run pattern
    - Add detailed pros/cons for both wrapper and hooks approaches
    - Add Open Discussion section on context compaction strategies
    - Clarify response_messages is read-only (use AgentMiddleware for modifications)
    - Add SimpleRAG examples showing input-only filtering
    - Clarify default storage only added when NO middleware configured
    - Add RAGWithBuffer examples for self-managed history
    - Rename hook methods to before_run/after_run
    
    * ADR: Restructure and add .NET comparison
    
    - Add class hierarchy clarification for both options
    - Merge detailed design sections (side-by-side comparison)
    - Move detailed design before decision outcome
    - Move compaction discussion after decision
    - Add .NET implementation comparison (feature equivalence)
    - Update .NET method names to match actual implementation
    - Rename hook methods to before_run/after_run
    - Fix storage context table for injected context
    
    * tweaks
    
    * fix smart load
    
    * ADR: Add naming discussion note for ContextHooks
    
    - Note that class and method names are open for discussion
    - Add alternative method naming options table
    - Include invoking/invoked as option matching current Python and .NET
    
    * Update context middleware design: remove smart mode, add attribution filtering
    
    - Remove smart mode for load_messages (now explicit bool, default True)
    - Add attribution marker in additional_properties for message filtering
    - Update validation to warn on multiple or zero storage loaders
    - Add note about ChatReducer naming from .NET
    - Note that attribution should not be propagated to storage
    
    * Add Decision 2: Instance Ownership (instances in session vs agent)
    
    - Option A: Instances in Session (current proposal)
    - Option B: Instances in Agent, State in Session
      - B1: Simple dict state with optional return
      - B2: SessionState object with mutable wrapper
    - Updated examples to use Hooks pattern (before_run/after_run)
    - Added open discussion on hook factories in Option B model
    
    * Update ADR: Choose ContextPlugin with before_run/after_run and Option B1
    
    Decision outcomes:
    - Option 3 (Hooks pattern) with ContextPlugin class name
    - Methods: before_run/after_run
    - Option B1: Instances in Agent, State in Session (simple dict)
    - Whole state dict passed to plugins (mutable, no return needed)
    - Added trust note: plugins reason over messages, so they're trusted by default
    
    Status changed from proposed to accepted.
    
    * Add agent and session params to before_run/after_run methods
    
    Signature now: before_run(agent, session, context, state)
    
    * Remove ContextPluginRunner, store plugins directly on agent
    
    Simpler design: agent stores Sequence[ContextPlugin] and calls
    before_run/after_run directly in the run method.
    
    * Update workplan to 2 PRs for simpler review
    
    * updated doc
    
    * Refine ADR: serialization, ownership, decorators, session methods, exports
    
    - Add to_dict()/from_dict() on AgentSession with 'type' discriminator
    - Present serialization as Option A (direct) vs Option B (through agent)
    - Rewrite ownership section as 2x2 matrix (orthogonal decision)
    - Move Instance Ownership Options before Decision Outcome
    - Fix get_session to use service_session_id, split from create_session
    - Add decorator-based provider convenience API (@before_run/@after_run)
    - Add _ prefix naming strategy for all PR1 types (core + external)
    - Constructor compatibility table for existing providers
    - Add load_messages=False skip logic to all agent run loops
    - Clarify abstract vs non-abstract in execution pattern samples
    - Update auto-provision: trigger on conversation_id or store=True
    - Document root package exports (ContextProvider, HistoryProvider, etc.)
    - Rename section heading to 'Key Design Considerations'
    
    * Rename ADR to 0016-python-context-middleware.md
    
    * Fix broken link: #3-unified-storage-middleware → #3-unified-storage
  • Python: Fix workflow not pausing when agent calls declaration-only tool (#3757)
    * Fix workflow not pausing when agent calls declaration-only tool
    
    * Remove comment
  • .NET: Workflow telemetry opt in (#3467)
    * feat(workflows): Make telemetry opt-in via WithOpenTelemetry()
    
    - Add WorkflowTelemetryOptions class with EnableSensitiveData property
    - Add WorkflowTelemetryContext to manage ActivitySource lifecycle
    - Add WithOpenTelemetry() extension method on WorkflowBuilder
    - Update all workflow components to use telemetry context:
      - WorkflowBuilder, Workflow, Executor
      - InProcessRunnerContext, InProcessRunner
      - LockstepRunEventStream, StreamingRunEventStream
      - All edge runners (Direct, FanIn, FanOut, Response)
    - Telemetry is now disabled by default
    - Users must call WithOpenTelemetry() to enable spans/activities
    
    BREAKING CHANGE: Workflow telemetry is now opt-in. Users who relied on
    automatic telemetry must add .WithOpenTelemetry() to their workflow builder.
    
    * refactor: Pass telemetry context as parameter instead of via interface
    
    - Remove IWorkflowContextWithTelemetry interface
    - Add internal ExecuteAsync overload that accepts WorkflowTelemetryContext
    - Public ExecuteAsync delegates with WorkflowTelemetryContext.Disabled
    - InProcessRunner passes TelemetryContext when calling ExecuteAsync
    - BoundContext now implements IWorkflowContext (not the removed interface)
    
    * Add optional ActivitySource parameter to WithOpenTelemetry
    
    Allow users to provide their own ActivitySource when enabling telemetry,
    giving them better control over the ActivitySource lifecycle. When not
    provided, the framework creates one internally (existing behavior).
    
    Changes:
    - Add optional activitySource parameter to WithOpenTelemetry() extension
    - Update WorkflowTelemetryContext to accept external ActivitySource
    - Add unit test for user-provided ActivitySource scenario
    
    * Add component-level telemetry control with disable flags
    
    Allow users to selectively disable specific activity types via
    WorkflowTelemetryOptions. All activities are enabled by default.
    
    New disable flags:
    - DisableWorkflowBuild: Disables workflow.build activities
    - DisableWorkflowRun: Disables workflow_invoke activities
    - DisableExecutorProcess: Disables executor.process activities
    - DisableEdgeGroupProcess: Disables edge_group.process activities
    - DisableMessageSend: Disables message.send activities
    
    Added helper methods to WorkflowTelemetryContext for each activity type
    and updated all activity creation sites to use them.
    
    * Implement EnableSensitiveData to log executor input/output
    
    When EnableSensitiveData is true in WorkflowTelemetryOptions, executor
    input and output are logged as JSON-serialized attributes in the
    executor.process activity.
    
    New activity tags:
    - executor.input: JSON serialized input message
    - executor.output: JSON serialized output result (non-void only)
    
    Added suppression attributes for AOT/trimming warnings since this is
    an opt-in feature for debugging/diagnostics.
    
    * Refactor activity start methods to centralize tagging logic
    
    Move tagging logic into WorkflowTelemetryContext methods:
    - StartExecutorProcessActivity now accepts executorId, executorType,
      messageType, and message; sets all tags including executor.input
      when EnableSensitiveData is true
    - Added SetExecutorOutput method to set executor.output after execution
    - StartMessageSendActivity now accepts sourceId, targetId, and message;
      sets all tags including message.content when EnableSensitiveData is true
    
    Simplified Executor.cs and InProcessRunnerContext.cs by removing
    inline tagging code. Added message.content tag constant.
    
    * Revert Python changes
    
    * Update samples and code cleanup
    
    * Fix file formatting
    
    * Add comment
    
    * Add telemetry configuration to declarative workflow
    
    * Remove delays in tests
    
    * Address comments
  • Python: Added explicit schema handling to @tool decorator (#3734)
    * Added explicit schema handling to @tool decorator
    
    * Resolved comments
  • Python: [BREAKING] Renamed next middleware parameter to call_next (#3735)
    * Renamed next middleware parameter to call_next
    
    * Resolved comments
  • Python: replace pre-commit with prek, add PEP 723 script deps, clean up dev dependencies (#3748)
    * python: replace pre-commit with prek, add PEP 723 script deps, clean up dev dependencies
    
    - Replace pre-commit with prek (Rust-native, faster pre-commit alternative)
    - Move supported hooks to repo: builtin for zero-clone speed
    - Add new builtin hooks: trailing-whitespace, check-merge-conflict, detect-private-key, check-added-large-files
    - Update all hook versions to latest (pre-commit-hooks v6, pyupgrade v3.21.2, bandit 1.9.3, uv-pre-commit 0.10.0)
    - Add PEP 723 inline script metadata to 34 samples with external deps
    - Remove autogen-agentchat/autogen-ext from dev deps (now declared per-sample)
    - Remove unused dev deps: pytest-env, tomli-w
    - Add agent-framework-core>=1.0.0b260130 lower bound to all 21 packages
    - Update CI workflow to use j178/prek-action
    - Update docs: DEV_SETUP.md, AGENTS.md, CODING_STANDARD.md, SAMPLE_GUIDELINES.md
    
    * updated lock
    
    * python: fix prek config paths for local execution and CI workflow
    
    Remove global 'files: ^python/' filter and strip python/ prefix from all path patterns in .pre-commit-config.yaml so prek finds files when run from the python/ directory. Update CI workflow to use --cd python instead of --config path. Include trailing whitespace fixes and dev dependency cleanup.
    
    * python: move helper scripts to scripts/ folder and exclude from checks
    
    * python: exclude AGENTS.md from prek markdown code lint
    
    * python: exclude AGENTS.md and azure_ai_search sample from markdown lint
    
    * fix m365 sample
    
    * python: ignore CPY rule for samples with PEP 723 headers
    
    * fix in dev_setup
    
    * python: replace aiofiles with regular open in samples
    
    * python: suppress reportUnusedImport in markdown code block checker
    
    * python: use samples pyright config for markdown code block checker
    
    Write a temp pyrightconfig.json matching pyrightconfig.samples.json rules (typeCheckingMode=off, only reportMissingImports and reportAttributeAccessIssue). Filter output to only fail on these rules since syntax-level errors (top-level await, undefined vars) are expected in README documentation snippets.
    
    * python: use markdown-code-lint with fixed globs instead of prek file list
    
    The prek-markdown-code-lint task received all changed files including non-README markdown and files with pre-existing broken imports. Replace with the standard markdown-code-lint task which uses the correct glob patterns (README.md, packages/**/README.md, samples/**/*.md).
    
    * python: exclude READMEs with pre-existing broken imports from markdown lint
    
    * python: fix broken README code snippets instead of excluding them
    
    - ag-ui: replace TextContent (removed) with content.type == 'text'
    - durabletask: fix import path to durabletask.worker.TaskHubGrpcWorker
    - orchestrations: use constructor params instead of .participants() method
    - observability: mark deprecated code blocks as plain text, filter
      reportMissingImports to agent_framework modules only
    - remove README excludes from markdown-code-lint task
    
    * add revision to gaia download
    
    * feat(python): parallelize checks across packages
    
    Run (package × task) cross-product in parallel using ThreadPoolExecutor
    and subprocesses. Key changes:
    
    - Add scripts/task_runner.py with shared parallel execution engine
    - Update run_tasks_in_packages_if_exists.py to accept multiple tasks
    - Update run_tasks_in_changed_packages.py with --files flag and parallel support
    - Add check-packages poe task (fmt+lint+pyright+mypy in parallel)
    - Add prek-markdown-code-lint and prek-samples-check with change detection
    - Split CI code quality workflow into parallel prek and mypy jobs
    - Update DEV_SETUP.md to document new parallel behavior
    
    Core package changes still trigger checks on all packages.
    
    * feat(ci): split code quality into 4 parallel jobs
    
    Split the single prek job into parallel jobs:
    - pre-commit-hooks: lightweight hooks (SKIP=poe-check)
    - package-checks: fmt/lint/pyright/mypy via check-packages
    - samples-markdown: samples-lint, samples-syntax, markdown-code-lint
    - mypy: change-detected mypy checks
    
    All 4 jobs run concurrently (×2 Python versions = 8 runners).
    
    * feat(ci): use only Python 3.10 for code quality checks
    
    * refactor(python): add future annotations and remove quoted types
    
    Add `from __future__ import annotations` to 93 package files that
    used quoted string annotations, then run pyupgrade --py310-plus to
    remove the now-unnecessary quotes.
    
    Fixes https://github.com/microsoft/agent-framework/issues/3578
  • .NET: [BREAKING] Add ability to mark the source of Agent request messages and use that for filtering (#3540)
    * Add ability to mark the source of Agent request messages and use that for filtering
    
    * Add support for source, in addition to source type, and add unit tests for automatic stamping
    
    * Address PR comments.
    
    * Add merge fixes
    
    * Address PR comments
  • Python: Add samples syntax checking with pyright (#3710)
    * Add samples syntax checking with pyright
    
    - Add pyrightconfig.samples.json with relaxed type checking but import validation
    - Add samples-syntax poe task to check samples for syntax and import errors
    - Add samples-syntax to check and pre-commit-check tasks
    - Fix 78 sample errors:
      - Update workflow builder imports to use agent_framework_orchestrations
      - Change content type isinstance checks to content.type comparisons
      - Use Content factory methods instead of removed content type classes
      - Fix TypedDict access patterns for Annotation
      - Fix various API mismatches (normalize_messages, ChatMessage.text, role)
    
    * fixed a bunch of samples and tweaks to pre-commit
    
    * updated lock
    
    * updated lock
    
    * fixes
    
    * added lint to samples
  • [BREAKING] Python: Move single-config fluent methods to constructor parameters (#3693)
    * Move single-config fluent methods to constructor parameters
    
    * Updates
    
    * Adjust magentic and group chat
  • Python: Fix HandoffBuilder silently dropping context_provider during agent cloning (#3721)
    * Initial plan
    
    * Fix context_provider parameter name bug and add test
    
    Co-authored-by: markwallace-microsoft <127216156+markwallace-microsoft@users.noreply.github.com>
    
    * Improve context_provider test to directly check cloned agent
    
    Co-authored-by: markwallace-microsoft <127216156+markwallace-microsoft@users.noreply.github.com>
    
    * Improve test based on code review feedback
    
    Co-authored-by: markwallace-microsoft <127216156+markwallace-microsoft@users.noreply.github.com>
    
    * Remove unused events variable in test_context_provider_preserved_during_handoff
    
    Co-authored-by: markwallace-microsoft <127216156+markwallace-microsoft@users.noreply.github.com>
    
    * Fix formatting: remove trailing whitespace from test_handoff.py
    
    Co-authored-by: markwallace-microsoft <127216156+markwallace-microsoft@users.noreply.github.com>
    
    ---------
    
    Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
    Co-authored-by: markwallace-microsoft <127216156+markwallace-microsoft@users.noreply.github.com>
  • [BREAKING] Python: Merge send_responses into run method (#3720)
    * Streamline workflow run api with send responses in one method
    
    * Fixes
    
    * Address copilot feedback
  • Python: [BREAKING] Renamed AgentProtocol to SupportsAgentRun (#3717)
    * Renamed AgentProtocol to AgentLike
    
    * Resolved comments
    
    * Renamed AgentLike to SupportsAgentRun
    
    * Resolved comments
  • .NET: Introduce Core implementation methods for session methods on AIAgent (#3699)
    * Introduce Core implementation methods for session methods on AIAgent
    
    * Update changelog
  • [BREAKING] Python: Refactor workflow events to unified discriminated union pattern (#3690)
    * Refactor events
    
    * Merge main
    
    * Fixes
    
    * Cleanup
    
    * Update samples and tests
    
    * Remove unused imports
    
    * PR feedback
    
    * Merge main. Add properties for events to help typing
    
    * Formatting
    
    * Cleanup
    
    * use builtins.type to avoid shadowing by WorkflowEvent.type attribute
    
    * Final improvements
  • Python: [BREAKING] Renamed AgentRunContext to AgentContext (#3714)
    * Renamed AgentRunContext to AgentContext
    
    * Update python/packages/core/AGENTS.md
    
    Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
    
    ---------
    
    Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
  • Python: Fix GroupChat orchestrator message cleanup issue (#3712)
    * Fix GroupChat orchestrator message cleanup issue
    
    Apply clean_conversation_for_handoff to GroupChatOrchestrator and
    AgentBasedGroupChatOrchestrator _handle_response methods to remove
    tool-related content that causes API errors from empty messages.
    
    Fixes #3705
    
    * Move orchestration related files to orchestrations package.
    
    * Fix imports
    
    ---------
    
    Co-authored-by: alliscode <bentho@microsoft.com>
    Co-authored-by: Evan Mattson <evan.mattson@microsoft.com>