Commit Graph

1625 Commits

  • Python: Fix as_agent() not defaulting name/description from client properties (#4484)
    * Fix as_agent() not defaulting name/description from client properties
    
    AzureAIClient.as_agent() and AzureAIAgentClient.as_agent() now fall back
    to self.agent_name and self.agent_description when name/description are
    not explicitly passed. This ensures Agent.name is populated for
    telemetry spans without requiring callers to repeat the name.
    
    Fixes #4471
    
    Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
    
    * Address review: use is None checks instead of truthiness
    
    Switch from name or self.agent_name to explicit is None checks so
    that callers can intentionally pass empty strings without them being
    replaced by client defaults. Added edge-case tests for empty strings.
    
    Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
    
    * Update docstrings to document name/description defaulting behavior
    
    Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
    
    ---------
    
    Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
  • Python: Forward runtime kwargs to skill resource functions (#4417)
    * support code skills
    
    * address pr review comments
    
    * address package and syntax checks
    
    * address pr review comments
    
    * address pr review comment
    
    * address failed check
    
    * rename agentskill and agetnskillprovider
    
    * move agent skills related assets to _skills.py
    
    * address pr review comments
    
    * address review comments
    
    * support kwargs
    
    * address pr review feedback
  • Python: Fix Python pyright package scoping and typing remediation (#4426)
    * Fix Python pyright package scoping and typing remediation
    
    Implements issue #4407 by removing the root pyright include, adding package-level pyright includes, and resolving pyright/mypy typing issues across Python packages. Also cleans unnecessary casts and applies line-level, rule-specific ignores where external libraries are too dynamic.
    
    Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
    
    * Reduce pyright cost in handoff cloning
    
    Simplify cloned_options construction in HandoffAgentExecutor to avoid expensive TypedDict narrowing/inference in _handoff.py, which was causing pyright to spend a long time in orchestrations.
    
    Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
    
    * fix types
    
    * Fix lint and type-check regressions
    
    Resolve current Python package check failures across lint, pyright, and mypy after recent code changes, including purview/declarative pyright issues and multiple ruff simplification findings.
    
    Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
    
    * fixed hooks
    
    * Stabilize package tests and test tasks
    
    Resolve cross-package non-integration test failures, simplify streaming type flow, harden locale/culture handling, and standardize package test poe tasks to exclude integration tests where applicable.
    
    Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
    
    * lots of small fixes
    
    * Fix current Python test regressions
    
    Address current failing unit tests in azure-ai, bedrock, and azure-cosmos while keeping Bedrock parsing logic inline (no new static helper methods).
    
    Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
    
    * small fixes
    
    * small fixes
    
    * removed pydantic from json
    
    * final updates
    
    * fix core
    
    * fix tests
    
    * fix obser
    
    ---------
    
    Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
  • .NET: Switch auth sample to use Singletons (#4454)
    * Switch auth sample to use Singletons
    
    * Address PR comments
    
    * Add comment to warn users to choose the appropriate lifetime for their service
  • .NET: CI Build time end to end improvement (#4208)
    * .NET: Upgrade to XUnit 3 and Microsoft Testing Platform (#4176)
    
    * Fix copilot studio integration tests failure (#4209)
    
    * Fix anthropic integration tests and skip reason (#4211)
    
    * Remove accidental add of code coverage for integration tests (#4219)
    
    * Add solution filtered parallel test run (#4226)
    
    * Fix build paths (#4228)
    
    * Fix coverage settings path and trait filter (#4229)
    
    * Add project name filter to solution (#4231)
    
    * Increase Integration Test Parallelism (#4241)
    
    * Increase integration tests threads to 4x (#4242)
    
    * Separate build and test into parallel jobs (#4243)
    
    * Filter src by framework for tests build (#4244)
    
    * Separate build and test into parallel jobs
    
    * Filter source projects by framework for tests build
    
    * Pre-build samples via tests to avoid timeouts (#4245)
    
    * Separate build from run for console sample validation (#4251)
    
    * Address PR comments (#4255)
    
    * Merge and move scripts (#4308)
    
    * .NET: Add Microsoft Fabric sample #3674 (#4230)
    
    Co-authored-by: Chris <66376200+crickman@users.noreply.github.com>
    
    * Python: Phase 2: Embedding clients for Ollama, Bedrock, and Azure AI Inference (#4207)
    
    * Phase 2: Embedding clients for Ollama, Bedrock, and Azure AI Inference
    
    Add embedding client implementations to existing provider packages:
    
    - OllamaEmbeddingClient: Text embeddings via Ollama's embed API
    - BedrockEmbeddingClient: Text embeddings via Amazon Titan on Bedrock
    - AzureAIInferenceEmbeddingClient: Text and image embeddings via Azure AI
      Inference, supporting Content | str input with separate model IDs for
      text (AZURE_AI_INFERENCE_EMBEDDING_MODEL_ID) and image
      (AZURE_AI_INFERENCE_IMAGE_EMBEDDING_MODEL_ID) endpoints
    
    Additional changes:
    - Rename EmbeddingCoT -> EmbeddingT, EmbeddingOptionsCoT -> EmbeddingOptionsT
    - Add otel_provider_name passthrough to all embedding clients
    - Register integration pytest marker in all packages
    - Add lazy-loading namespace exports for Ollama and Bedrock embeddings
    - Add image embedding sample using Cohere-embed-v3-english
    - Add azure-ai-inference dependency to azure-ai package
    
    Part of #1188
    
    Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
    
    * Fix mypy duplicate name and ruff lint issues
    
    - Rename second 'vector' variable to 'img_vector' in image embedding loop
    - Combine nested with statements in tests
    - Remove unused result assignments in tests
    
    Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
    
    * updates from feedback
    
    * Fix CI failures in embedding usage handling
    
    - Fix Azure AI embedding mypy issues by normalizing vectors to list[float],
      safely accumulating optional usage token fields, and filtering None entries
      before constructing GeneratedEmbeddings
    - Avoid Bandit false positive by initializing usage details as an empty dict
    - Update OpenAI embedding tests to assert canonical usage keys
      (input_token_count/total_token_count)
    
    Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
    
    ---------
    
    Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
    
    * [Purview] Mark responses as responses and fix epoch bug for python long overflow (#4225)
    
    * .NET: Support InvokeMcpTool for declarative workflows (#4204)
    
    * Initial implementation of InvokeMcpTool in declarative workflow
    
    * Cleaned up sample implementation
    
    * Updated sample comments.
    
    * Added missing executor routing attribute
    
    * Fix PR comments.
    
    * Updated based on PR comments.
    
    * Updated based on PR comments.
    
    * Removed unnecessary using statement.
    
    * Update Python package versions to rc2 (#4258)
    
    - Bump core and azure-ai to 1.0.0rc2
    - Bump preview packages to 1.0.0b260225
    - Update dependencies to >=1.0.0rc2
    - Add CHANGELOG entries for changes since rc1
    - Update uv.lock
    
    Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
    
    * .NET: Fixing issue where OpenTelemetry span is never exported in .NET in-process workflow execution (#4196)
    
    * 1. Add reproduction test for issue #4155: workflow.run Activity never stopped in streaming OffThread path
    
    The WorkflowRunActivity_IsStopped_Streaming_OffThread test demonstrates that
    the workflow.run OpenTelemetry Activity created in StreamingRunEventStream.RunLoopAsync
    is started but never stopped when using the OffThread/Default streaming execution.
    The background run loop keeps running after event consumption completes, so the
    using Activity? declaration never disposes until explicit StopAsync() is called.
    
    Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
    
    2. Fix workflow.run Activity never stopped in streaming OffThread execution (#4155)
    
    The workflow.run OpenTelemetry Activity in StreamingRunEventStream.RunLoopAsync
    was scoped to the method lifetime via 'using'. Since the run loop only exits on
    cancellation, the Activity was never stopped/exported until explicit disposal.
    
    Fix: Remove 'using' and explicitly dispose the Activity when the workflow reaches
    Idle status (all supersteps complete). A safety-net disposal in the finally block
    handles cancellation and error paths.
    
    Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
    
    * Add root-level workflow.session activity spanning run loop lifetime\n\nImplements two-level telemetry hierarchy per PR feedback from lokitoth:\n- workflow.session: spans the entire run loop / stream lifetime\n- workflow_invoke: per input-to-halt cycle, nested within the session\n\nThis ensures the session activity stays open across multiple turns,\nwhile individual run activities are created and disposed per cycle.\n\nAlso fixes linkedSource CancellationTokenSource disposal leak in\nStreamingRunEventStream (added using declaration)."
    
    * Address Copilot review: fix Activity/CTS disposal, rename activity, add error tag\n\n1. LockstepRunEventStream: Remove 'using' from Activity in async iterator\n   and manually dispose in finally block (fixes #4155 pattern). Also dispose\n   linkedSource CTS in finally to prevent leak.\n2. Tags.cs: Add ErrorMessage (\"error.message\") tag for runtime errors,\n   distinct from BuildErrorMessage (\"build.error.message\").\n3. ActivityNames: Rename WorkflowRun from \"workflow_invoke\" to \"workflow.run\"\n   for cross-language consistency.\n4. WorkflowTelemetryContext: Fix XML doc to say \"outer/parent span\" instead\n   of \"root-level span\".\n5. ObservabilityTests: Assert WorkflowSession absence when DisableWorkflowRun\n   is true.\n6. WorkflowRunActivityStopTests: Fix streaming test race by disposing\n   StreamingRun before asserting activities are stopped.\n7. StreamingRunEventStream/LockstepRunEventStream: Use Tags.ErrorMessage\n   instead of Tags.BuildErrorMessage for runtime error events."
    
    * Review fixes: revert workflow_invoke rename, use 'using' for linkedSource, move SessionStarted earlier\n\n- Revert ActivityNames.WorkflowRun back to \"workflow_invoke\" (OTEL semantic convention contract)\n- Use 'using' declaration for linkedSource CTS in LockstepRunEventStream (no timing sensitivity)\n- Move SessionStarted event before WaitForInputAsync in StreamingRunEventStream to match Lockstep behavior"
    
    * Improve naming and comments in WorkflowRunActivityStopTests"
    
    * Prevent session Activity.Current leak in lockstep mode, add nesting test
    
    Save and restore Activity.Current in LockstepRunEventStream.Start() so the
    session activity doesn't leak into caller code via AsyncLocal. Re-establish
    Activity.Current = sessionActivity before creating the run activity in
    TakeEventStreamAsync to preserve parent-child nesting.
    
    Add test verifying app activities after RunAsync are not parented under the
    session, and that the workflow_invoke activity nests under the session."
    
    * Fix stale XML doc: WorkflowRun -> WorkflowInvoke in ObservabilityTests
    
    ---------
    
    Co-authored-by: alliscode <bentho@microsoft.com>
    Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
    
    * Python / .NET Samples - Restructure and Improve Samples (Feature Branc… (#4092)
    
    * Python: .NET Samples - Restructure and Improve Samples (Feature Branch) (#4091)
    
    * Moved by agent (#4094)
    
    * Fix readme links
    
    * .NET Samples - Create `04-hosting` learning path step (#4098)
    
    * Agent move
    
    * Agent reorderd
    
    * Remove A2A section from README 
    
    Removed A2A section from the Getting Started README.
    
    * Agent fixed links
    
    * Fix broken sample links in durable-agents README (#4101)
    
    * Initial plan
    
    * Fix broken internal links in documentation
    
    Co-authored-by: crickman <66376200+crickman@users.noreply.github.com>
    
    * Revert template link changes; keep only durable-agents README fix
    
    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>
    
    * .NET Samples - Create `03-workflows` learning path step (#4102)
    
    * Fix solution project path
    
    * Python: Fix broken markdown links to repo resources (outside /docs) (#4105)
    
    * Initial plan
    
    * Fix broken markdown links to repo resources
    
    Co-authored-by: crickman <66376200+crickman@users.noreply.github.com>
    
    * Update README to rename .NET Workflows Samples section
    
    ---------
    
    Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
    Co-authored-by: crickman <66376200+crickman@users.noreply.github.com>
    
    * .NET Samples - Create `02-agents` learning path step (#4107)
    
    * .NET: Fix broken relative link in GroupChatToolApproval README (#4108)
    
    * Initial plan
    
    * Fix broken link in GroupChatToolApproval README
    
    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>
    
    * Update labeler configuration for workflow samples
    
    * .NET - Reorder Agents samples to start from Step01 instead of Step04 (#4110)
    
    * Fix solution
    
    * Resolve new sample paths
    
    * Move new AgentSkills and AgentWithMemory_Step04 samples
    
    * Fix link
    
    * Fix readme path
    
    * fix: update stale dotnet/samples/Durable path reference in AGENTS.md
    
    Co-authored-by: crickman <66376200+crickman@users.noreply.github.com>
    
    * Moved new sample
    
    * Update solution
    
    * Resolve merge (new sample)
    
    * Sync to new sample - FoundryAgents_Step21_BingCustomSearch
    
    * Updated README
    
    * .NET Samples - Configuration Naming Update (#4149)
    
    * .NET: Restore AzureFunctions index parity with ConsoleApps under DurableAgents samples (#4221)
    
    * Clean-up `05_host_your_agent`
    
    * Config setting consistency
    
    * Refine samples
    
    * AGENTS.md
    
    * Move new samples
    
    * Re-order samples
    
    * Move new project and fixup solution
    
    * Fixup model config
    
    * Fix up new UT project
    
    ---------
    
    Co-authored-by: Copilot <198982749+Copilot@users.noreply.github.com>
    
    * Python: Fix Bedrock embedding test stub missing meta attribute (#4287)
    
    * Fix Bedrock embedding test stub missing meta attribute
    
    * Increase test coverage so gate passes
    
    * Python: (ag-ui): fix approval payloads being re-processed on subsequent conversation turns (#4232)
    
    * Fix ag-ui tool call issue
    
    * Safe json fix
    
    * Python: Update workflow orchestration samples to use AzureOpenAIResponsesClient (#4285)
    
    * Update workflow orchestration samples to use AzureOpenAIResponsesClient
    
    * Fix broken link
    
    * Move scripts to scripts folder
    
    ---------
    
    Co-authored-by: Roger Barreto <19890735+rogerbarreto@users.noreply.github.com>
    Co-authored-by: Chris <66376200+crickman@users.noreply.github.com>
    Co-authored-by: Eduard van Valkenburg <eavanvalkenburg@users.noreply.github.com>
    Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
    Co-authored-by: Rishabh Chawla <rishabhchawla1995@gmail.com>
    Co-authored-by: Peter Ibekwe <109177538+peibekwe@users.noreply.github.com>
    Co-authored-by: Dmytro Struk <13853051+dmytrostruk@users.noreply.github.com>
    Co-authored-by: Ben Thomas <ben.thomas@microsoft.com>
    Co-authored-by: alliscode <bentho@microsoft.com>
    Co-authored-by: Copilot <198982749+Copilot@users.noreply.github.com>
    Co-authored-by: Evan Mattson <35585003+moonbox3@users.noreply.github.com>
    
    * Fix encoding (#4309)
    
    * Disable Parallelization for WorkflowRunActivityStopTests (#4313)
    
    * Revert parallel disable (#4324)
    
    * .NET: Disable flakey Workflow Observability tests (#4416)
    
    * Disable flakey OffThread test
    
    * Disable additional OffThread test
    
    * Disable a further test
    
    * Disable all observability tests
    
    ---------
    
    Co-authored-by: Roger Barreto <19890735+rogerbarreto@users.noreply.github.com>
    Co-authored-by: Chris <66376200+crickman@users.noreply.github.com>
    Co-authored-by: Eduard van Valkenburg <eavanvalkenburg@users.noreply.github.com>
    Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
    Co-authored-by: Rishabh Chawla <rishabhchawla1995@gmail.com>
    Co-authored-by: Peter Ibekwe <109177538+peibekwe@users.noreply.github.com>
    Co-authored-by: Dmytro Struk <13853051+dmytrostruk@users.noreply.github.com>
    Co-authored-by: Ben Thomas <ben.thomas@microsoft.com>
    Co-authored-by: alliscode <bentho@microsoft.com>
    Co-authored-by: Copilot <198982749+Copilot@users.noreply.github.com>
    Co-authored-by: Evan Mattson <35585003+moonbox3@users.noreply.github.com>
  • .NET: Add foundry extension samples for python and dotnet (#4359)
    * Add foundry extension samples for python and dotnet
    
    * Align foundry extension samples with existing hosted agent patterns
    
    - Fix Python multiagent indentation bug (from_agent_framework ran in both modes)
    - Remove hardcoded personal endpoint from appsettings.Development.json
    - Rename .NET folders/projects to PascalCase (FoundryMultiAgent, FoundrySingleAgent)
    - Upgrade .NET multiagent from net9.0 to net10.0
    - Add ManagePackageVersionsCentrally=false and analyzer blocks to .csproj files
    - Replace wildcard package versions with fixed versions
    - Use alpine Docker images and standard build pattern
    - Align agent.yaml structure (template nesting, displayName, resources, authors)
    - Convert .NET multiagent from namespace/class to top-level statements
    - Add run-requests.http for multiagent sample
    - Fix Python requirements.txt (remove dev deps, add agent-framework)
    - Add proper copyright headers
    
    Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
    
    * Align foundry samples: fix builds, upgrade AgentServer to beta.8
    
    - Fix TargetFrameworks (plural) to override inherited net472 from Directory.Build.props
    - Upgrade Azure.AI.AgentServer.AgentFramework to 1.0.0-beta.8 (latest)
    - Bump OpenTelemetry packages to 1.12.0 (required by beta.8)
    - Fix Roslynator/format errors (imports ordering, BOM, sealed record, target-typed new)
    - Verified with docker dotnet format (matching CI pipeline)
    
    Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
    
    * Refactor hosted samples to use AIProjectClient.CreateAIAgentAsync
    
    Replace PersistentAgentsClient and manual AzureOpenAIClient setup with
    AIProjectClient.CreateAIAgentAsync() from Microsoft.Agents.AI.AzureAI.
    
    - FoundryMultiAgent: Remove Azure.AI.Agents.Persistent, use CreateAIAgentAsync
      for Writer and Reviewer agents with cleanup in finally block
    - FoundrySingleAgent: Remove manual GetConnection/AzureOpenAIClient chain,
      use CreateAIAgentAsync with hotel search tool
    - Update csproj: add Microsoft.Agents.AI.AzureAI, remove unused packages
    
    Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
    
    * Update READMEs to reflect AIProjectClient.CreateAIAgentAsync usage
    
    - Reference Microsoft.Agents.AI.AzureAI and Microsoft.Agents.AI.Workflows packages
    - Add Azure AI Developer role requirement for agents/write data action
    - Replace PersistentAgentsClient references
    
    Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
    
    * Add HostedAgents READMEs and Foundry samples to solution
    
    - Create dotnet/samples/05-end-to-end/HostedAgents/README.md with sample index
    - Create python/samples/05-end-to-end/hosted_agents/README.md with sample index
    - Add FoundryMultiAgent and FoundrySingleAgent to agent-framework-dotnet.slnx
    
    Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
    
    * Fix Python linting: reorder imports before load_dotenv, remove trailing whitespace
    
    Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
    
    * Update uv.lock to match latest package versions
    
    Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
    
    * Fix trailing whitespace in foundry_single_agent agent.yaml
    
    Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
    
    * Exclude dotnet.microsoft.com from link checker
    
    This domain intermittently times out in CI, causing flaky markdown
    link check failures unrelated to PR changes.
    
    Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
    
    * Align env vars to AZURE_AI_PROJECT_ENDPOINT and default model to gpt-4o-mini
    
    Addresses PR review feedback:
    - Rename PROJECT_ENDPOINT to AZURE_AI_PROJECT_ENDPOINT across all
      Foundry samples (dotnet + python) to match existing samples
    - Change default model from gpt-4.1-mini to gpt-4o-mini consistently
    
    Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
    
    * Skip flaky test CreatesWorkflowEndToEndActivities_WithCorrectName_DefaultAsync
    
    Tracked in #4398
    
    Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
    
    * Remove Python foundry samples from PR scope
    
    Python hosted agent samples need further alignment with the azure-ai
    package conventions. Removing from this PR to ship .NET samples first.
    
    Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
    
    * Narrow linkspector exclusion to dotnet.microsoft.com/download only
    
    Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
    
    ---------
    
    Co-authored-by: Leo Yao <leoyao@Leos-MacBook-Pro.local>
    Co-authored-by: Roger Barreto <19890735+rogerbarreto@users.noreply.github.com>
    Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
  • .NET: Increase credential timeout for Integration Tests (#4472)
    * Increase credential timeout for Integration Tests
    
    * Fix format error.
    
    * Update further tests
    
    * Fix comment
    
    * Rename credentials file and class.
    
    * Fix broken reference.
  • Python: Add propagate_session to as_tool() for session sharing in agent-as-tool scenarios (#4439)
    * Python: Add propagate_session parameter to as_tool() for session sharing
    
    Add opt-in session propagation in agent-as-tool scenarios. When
    propagate_session=True, the parent agent's AgentSession is forwarded
    to the sub-agent's run() call, allowing both agents to share session
    state (history, metadata, session_id).
    
    - Add propagate_session parameter to BaseAgent.as_tool() (default False)
    - Include session in additional_function_arguments so it flows to tools
    - Add 3 tests for propagation on/off and shared state verification
    - Add sample showing session propagation with observability middleware
    
    Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
    
    * Clarify propagate_session docstring per review feedback
    
    Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
    
    ---------
    
    Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
  • .NET: bug fix for duplicate output on GitHubCopilotAgent (#3981)
    * bug fix for duplicate output on GitHubCopilotAgent
    
    * Add Test code for bug fix of duplicate output on GitHubCopilotAgenttT
    
    * update Test code for bug fix of duplicate output on GitHubCopilotAgenttT
    
    * update Test for duplicate output of GitHubCopilotAgent
    
    ---------
    
    Co-authored-by: Mark Wallace <127216156+markwallace-microsoft@users.noreply.github.com>
    Co-authored-by: Dmytro Struk <13853051+dmytrostruk@users.noreply.github.com>
  • .NET: Discover skill resources from directory instead of markdown links (#4401)
    * discover resources in skills folder
    
    * address pr review comments
    
    * change type of AllowedResourceExtensions
    
    * address pr review comment
  • Python: [BREAKING] Support code-defined agent skills (#4387)
    * support code skills
    
    * address pr review comments
    
    * address package and syntax checks
    
    * address pr review comments
    
    * address pr review comment
    
    * address failed check
    
    * rename agentskill and agetnskillprovider
    
    * move agent skills related assets to _skills.py
    
    * address pr review comments
    
    * address review comments
  • Python: feat(claude): add plugins, setting_sources, thinking, and effort options to ClaudeAgentOptions (#4425)
    * feat(claude): add plugins, setting_sources, thinking, and effort options
    
    Add four Claude Agent SDK options to ClaudeAgentOptions that are clean
    passthroughs with no abstraction conflicts:
    
    - plugins: load Claude Code plugins programmatically via SdkPluginConfig
    - setting_sources: control which .claude settings files are loaded
    - thinking: modern extended thinking config (adaptive/enabled/disabled)
    - effort: control thinking depth (low/medium/high/max)
    
    * feat(claude): remove max_thinking_tokens, add plugins/setting_sources/thinking/effort
    
    Remove the deprecated max_thinking_tokens field from ClaudeAgentOptions
    in favor of the new thinking field (ThinkingConfig).
    
    Add four Claude Agent SDK options as clean passthroughs:
    - plugins: load Claude Code plugins via SdkPluginConfig
    - setting_sources: control which .claude settings files are loaded
    - thinking: extended thinking config (adaptive/enabled/disabled)
    - effort: thinking depth control (low/medium/high/max)
  • .NET: Skip flacky UT + (Attempt) Merge Gatekeeper fix (#4456)
    * Skip flacky UT
    
    * Ignore org-level GitHub App checks in merge-gatekeeper
    
    Add Cleanup artifacts, Agent, Prepare, and Upload results to the
    ignored list. These are check runs created by an org-level GitHub App
    (MSDO), not by any workflow in this repo, and their transient failures
    should not block merges.
    
    Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
    
    ---------
    
    Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
  • .NET: Update Azure.AI.Projects 2.0.0-beta.1 (#4270)
    * Update Microsoft.Agents.AI.AzureAI for Azure.AI.Projects SDK 2.0.0
    
    - Bump Azure.AI.Projects to 2.0.0-alpha.20260213.1
    - Bump Azure.AI.Projects.OpenAI to 2.0.0-alpha.20260213.1
    - Bump System.ClientModel to 1.9.0 (transitive dependency)
    - Switch both GetAgent and CreateAgentVersion to protocol methods
      with MEAI user-agent policy injection via RequestOptions
    - Migrate 29 CREATE-path tests from FakeAgentClient to HttpHandlerAssert
      pattern for real HTTP pipeline testing
    - Fix StructuredOutputDefinition constructor (BinaryData -> IDictionary)
    - Fix responses endpoint path (openai/responses -> /responses)
    - Add local-packages NuGet source for pre-release nupkgs
    
    Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
    
    * Update Azure.AI.Projects to 2.0.0-beta.1 from NuGet.org
    
    - Update Azure.AI.Projects and Azure.AI.Projects.OpenAI to 2.0.0-beta.1
    - Remove local-packages NuGet source (packages now on nuget.org)
    - Fix MemorySearchTool -> MemorySearchPreviewTool rename
    - Fix RedTeams.CreateAsync ambiguous call
    - Fix CreateAgentVersion/Async signature change (BinaryData -> string)
    - Suppress AAIP001 experimental warning for WorkflowAgentDefinition
    
    Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
    
    * Move s_modelWriterOptionsWire field before methods that use it
    
    Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
    
    * Fix flaky test: prevent spurious workflow_invoke Activity on timeout wake-up
    
    The StreamingRunEventStream run loop uses a 1-second timeout on
    WaitForInputAsync. When the timeout fires before the consumer calls
    StopAsync, the loop would create a spurious workflow_invoke Activity
    even though no actual input was provided. This caused the
    WorkflowRunActivity_IsStopped_Streaming_OffThread_MultiTurnAsync test
    to intermittently fail (expecting 2 activities but finding 3).
    
    Fix: guard the loop body with a HasUnprocessedMessages check. On
    timeout wake-ups with no work, the loop waits again without creating
    an activity or changing the run status.
    
    Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
    
    * Fix epoch race condition causing unit tests to hang on net10.0 and net472
    
    The HasUnprocessedMessages guard (previous commit) correctly prevents
    spurious workflow_invoke Activity creation on timeout wake-ups, but
    exposed a latent race in the epoch-based signal filtering.
    
    The race: when the run loop processes messages quickly and calls
    Interlocked.Increment(ref _completionEpoch) before the consumer calls
    TakeEventStreamAsync, the consumer reads the already-incremented epoch
    and sets myEpoch = epoch + 1. This causes the consumer to skip the
    valid InternalHaltSignal (its epoch < myEpoch) and block forever
    waiting for a signal that will never arrive (since the guard prevents
    spurious signal generation).
    
    Fix: read _completionEpoch without +1. The +1 was originally needed to
    filter stale signals from timeout-driven spurious loop iterations, but
    those no longer exist thanks to the HasUnprocessedMessages guard.
    
    Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
    
    * Revert "Fix epoch race condition causing unit tests to hang on net10.0 and net472"
    
    This reverts commit 6ce7f01be8.
    
    * Revert "Fix flaky test: prevent spurious workflow_invoke Activity on timeout wake-up"
    
    This reverts commit 98963e17f2.
    
    * Skip hanging multi-turn declarative integration tests
    
    The ValidateMultiTurnAsync tests (ConfirmInput.yaml, RequestExternalInput.yaml)
    hang indefinitely in CI, blocking the merge queue. The hang is SDK-independent
    (reproduces with both Azure.AI.Projects 1.2.0-beta.5 and 2.0.0-beta.1) and
    is a pre-existing issue in the declarative workflow multi-turn test logic.
    
    Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
    
    * Remove unused using directive in IntegrationTest.cs
    
    Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
    
    * Restore Azure.AI.Projects 2.0.0-beta.1 version bump
    
    The merge from main accidentally reverted the package versions back to
    1.2.0-beta.5. This is the primary change of this PR.
    
    Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
    
    * Address merge conflict
    
    * Skip flaky WorkflowRunActivity_IsStopped_Streaming_OffThread_MultiTurnAsync test
    
    Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
    
    * Skip CheckSystem test cases temporarily
    
    Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
    
    ---------
    
    Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
  • Disable OpenAIAssistant structured output integration tests (#4451)
    Skip all three structured output run tests in
    OpenAIAssistantStructuredOutputRunTests as they fail intermittently
    on the build agent/CI, matching the pattern already used in
    AzureAIAgentsPersistentStructuredOutputRunTests.
    
    Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
  • Python: Fix PowerFx eval crash on non-English system locales by setting CurrentUICulture to en-US (#4408)
    * Fix #4321: Set CurrentUICulture to en-US in PowerFx eval()
    
    On non-English systems, CultureInfo.CurrentUICulture causes PowerFx to
    emit localized error messages. The existing ValueError guard only matches
    English strings ("isn't recognized", "Name isn't valid"), so undefined
    variable errors crash instead of returning None gracefully.
    
    Fix: save and restore CurrentUICulture alongside CurrentCulture before
    calling engine.eval(), ensuring error messages are always in English.
    
    Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
    
    * Reuse single CultureInfo instance to avoid redundant allocations
    
    Cache CultureInfo("en-US") in a local variable instead of instantiating
    it twice per eval() call, as suggested in PR review.
    
    Fixes #4321
    
    Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
    
    * Add assertion for CurrentUICulture restoration after eval
    
    Assert that the production code's finally-block correctly restores
    CurrentUICulture to it-IT after eval returns, covering future
    regressions where the culture could leak.
    
    The CultureInfo caching suggestion (comment #2) was already
    implemented in the production code.
    
    Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
    
    ---------
    
    Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
  • Python: Fix MCP tools duplicated on second turn when runtime tools are present (#4432)
    * Fix MCP tools duplicated on second turn when runtime tools are present
    
    When AG-UI's collect_server_tools pre-expands MCP functions on turn 2
    (after the MCP server is connected), _prepare_run_context unconditionally
    appends them again from self.mcp_tools, duplicating every MCP tool.
    
    Skip MCP functions whose names already exist in the final tool list,
    following the same name-based dedup pattern used in _merge_options.
    
    Fixes #4381
    
    Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
    
    * mypy fix
    
    * Remove issue-specific references from test docstring
    
    Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
    
    ---------
    
    Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
  • Python: Upgraded azure-ai-projects to 2.0.0b4 (#4438)
    * Upgraded azure-ai-projects to 2.0.0b4
    
    * Fixed tests
  • .NET: Updated Copilot SDK to the latest version (#4406)
    * Updated Copilot SDK to the latest version
    
    * Added retry
  • Python: Fix: Parse oauth_consent_request events in Azure AI client (#4197)
    * Fix: Parse oauth_consent_request events in Azure AI client (#3950)
    
    When Azure AI Agent Service returns an oauth_consent_request output item
    for OAuth-protected MCP tools, the base OpenAI responses parser drops it
    (hits case _ default branch). This causes agent runs to complete silently
    with zero content.
    
    Changes:
    - Add oauth_consent_request ContentType and Content.from_oauth_consent_request()
      factory with consent_link field and user_input_request=True
    - Override _parse_response_from_openai and _parse_chunk_from_openai in
      RawAzureAIClient to intercept Azure-specific oauth_consent_request items
    - Add _emit_oauth_consent helper in AG-UI to emit CustomEvent for frontends
    - Add tests proving base parser drops the event and Azure AI override catches it
    
    Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
    
    * addressed comment
    
    * addressed comments
    
    * addressed comments
    
    ---------
    
    Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
  • Python: Add file_ids and data_sources support to get_code_interpreter_tool() (#4201)
    * Python: Add file_ids and data_sources support to AzureAIAgentClient.get_code_interpreter_tool()
    
    Update the factory method to accept file_ids and data_sources keyword
    arguments, matching the underlying azure.ai.agents SDK CodeInterpreterTool
    constructor. This enables users to attach uploaded files for code
    interpreter analysis.
    
    Fixes #4050
    
    Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
    
    * addressed comments
    
    * addressed comments
    
    * Add per-message file attachment support for AzureAIAgentClient
    
    Add hosted_file handling in _prepare_messages() to convert
    Content.from_hosted_file() into MessageAttachment on ThreadMessageOptions.
    This enables per-message file scoping for code interpreter, matching the
    underlying Azure AI Agents SDK MessageAttachment pattern.
    
    - Add hosted_file case in _prepare_messages() match statement
    - Import MessageAttachment from azure.ai.agents.models
    - Add sample for per-message CSV file attachment with code interpreter
    - Add employees.csv test data file
    - Add 3 unit tests for hosted_file attachment conversion
    
    Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
    
    * Address PR review: validation, fix assertions, remove MessageAttachment
    
    - Add empty string validation in resolve_file_ids()
    - Add test for Content with file_id=None
    - Add test for empty string file_ids
    - Revert MessageAttachment/hosted_file handling from _prepare_messages()
      (moved to separate issue #4352 for proper design)
    - Remove per-message file upload sample and employees.csv
    - Keep data_sources assertion as-is (dict keyed by asset_identifier)
    
    Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
    
    ---------
    
    Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
  • Python: Fix workflow tests pyright warnings (#4362)
    * Fix workflow tests pyright warnings
    
    * Update uv.lock
    
    * Fix pyright
    
    * Comments
    
    * Update root pyproject pyright setting
    
    * Update core pyproject pyright setting
    
    * Update core pyproject pyright setting
  • ADR: Python context compaction strategy (#3802)
    * Add ADR for Python context compaction strategy
    
    * Remove async vs sync open question - compact() is async
    
    * updated adr
    
    * docs: refine context compaction ADR
    
    Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
    
    * updated adr
    
    * further refinement
    
    * renamed and numbered
    
    * remove XX version
    
    ---------
    
    Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
  • Python: Add OpenTelemetry instrumentation to ClaudeAgent (#4278) (#4326)
    * Python: Add OpenTelemetry instrumentation to ClaudeAgent (#4278)
    
    Add inline telemetry to ClaudeAgent.run() so that enable_instrumentation()
    emits invoke_agent spans and metrics. Covers both streaming and
    non-streaming paths using the same observability helpers as
    AgentTelemetryLayer. Adds 5 unit tests for telemetry behavior.
    
    Co-Authored-By: amitmukh <amimukherjee@microsoft.com>
    
    * Address PR review feedback for ClaudeAgent telemetry
    
    - Add justification comment for private observability API imports
    - Pass system_instructions to capture_messages for system prompt capture
    - Use monkeypatch instead of try/finally for test global state isolation
    
    Co-Authored-By: amitmukh <amitmukh@users.noreply.github.com>
    Co-Authored-By: Claude <noreply@anthropic.com>
    
    * Adopt AgentTelemetryLayer instead of inline telemetry
    
    Restructure ClaudeAgent to inherit from AgentTelemetryLayer via a
    _ClaudeAgentRunImpl mixin, eliminating duplicated telemetry code and
    private API imports.
    
    MRO: ClaudeAgent → AgentTelemetryLayer → _ClaudeAgentRunImpl → BaseAgent
    
    - Remove inline _run_with_telemetry / _run_with_telemetry_stream methods
    - Remove private observability helper imports (_capture_messages, etc.)
    - Add default_options property mapping system_prompt → instructions
    - Net -105 lines by reusing core telemetry layer
    
    Co-Authored-By: amitmukh <amitmukh@users.noreply.github.com>
    Co-Authored-By: Claude <noreply@anthropic.com>
    
    * Fix mypy: align _ClaudeAgentRunImpl.run() signature with AgentTelemetryLayer.run()
    
    Remove explicit `options` parameter from mixin's run() signature and
    extract it from **kwargs to match AgentTelemetryLayer's signature.
    Also align overload return types (ResponseStream, Awaitable) to match.
    
    Co-Authored-By: Claude <noreply@anthropic.com>
    
    * Introduce RawClaudeAgent following framework's RawAgent/Agent pattern
    
    Replace private _ClaudeAgentRunImpl mixin with public RawClaudeAgent
    class that contains all core logic (init, run, lifecycle, tools).
    ClaudeAgent becomes a thin wrapper that adds AgentTelemetryLayer.
    
    - RawClaudeAgent(BaseAgent): full implementation without telemetry
    - ClaudeAgent(AgentTelemetryLayer, RawClaudeAgent): adds OTel tracing
    - Export RawClaudeAgent from package __init__.py
    
    Users who want to skip telemetry or provide their own can use
    RawClaudeAgent directly.
    
    Co-Authored-By: Claude <noreply@anthropic.com>
    
    * Address review nits: trim RawClaudeAgent docstring, fix import paths
    
    - Simplify RawClaudeAgent docstring to a single basic example (not the
      primary entry point for most users)
    - Use agent_framework.anthropic import path in docstrings instead of
      direct agent_framework_claude path
    - Add RawClaudeAgent to agent_framework.anthropic lazy re-exports
    
    Co-Authored-By: Claude <noreply@anthropic.com>
    
    ---------
    
    Co-authored-by: Amit Mukherjee <amimukherjee@microsoft.com>
    Co-authored-by: amitmukh <amitmukh@users.noreply.github.com>
    Co-authored-by: Claude <noreply@anthropic.com>
    Co-authored-by: Dmytro Struk <13853051+dmytrostruk@users.noreply.github.com>
  • Python: Fix StandardMagenticManager to propagate session to manager agent (#4409)
    * Fix #4371: Propagate session to manager agent in StandardMagenticManager
    
    StandardMagenticManager._complete() was calling self._agent.run(messages)
    without passing a session. This caused context providers (e.g.
    RedisHistoryProvider) configured on the manager agent to silently fail,
    as each call created a new ephemeral session with a different session_id.
    
    Changes:
    - Create an AgentSession in StandardMagenticManager.__init__()
    - Pass session=self._session in _complete() calls to agent.run()
    - Persist/restore the session in checkpoint save/restore methods
    - Add regression tests for session propagation and checkpoint round-trip
    
    Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
    
    * Add type: ignore[reportPrivateUsage] to private attribute assertions in tests
    
    Address PR review feedback: add # type: ignore[reportPrivateUsage] comments
    to _session attribute accesses in the new regression tests, matching the
    existing convention used elsewhere in test_magentic.py (e.g., lines 401-406).
    
    The @pytest.mark.asyncio decorator is not needed because pyproject.toml
    sets asyncio_mode = "auto".
    
    Fixes #4371
    
    Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
    
    * Address review: use getattr for private _session access in tests (#4371)
    
    Replace direct mgr._session access with getattr(mgr, "_session") to avoid
    reportPrivateUsage type-checking warnings without needing type: ignore comments.
    
    Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
    
    * Apply pre-commit auto-fixes
    
    * Address PR review: fix session restore guard and improve test robustness (#4371)
    
    - Use 'is not None' instead of truthiness check for session_payload restore
    - Use getattr() for private _session attribute access in tests
    - Add backward-compatibility test for on_checkpoint_restore with empty state
    
    Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
    
    * Make non-async tests plain def to avoid pytest-asyncio dependency (#4409)
    
    Tests that never await anything don't need to be async. Using plain def
    ensures they always run regardless of pytest-asyncio configuration.
    
    Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
    
    * Apply pre-commit auto-fixes
    
    ---------
    
    Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
  • .NET: [BREAKING] Change *Provider StateKey to list of StateKeys (#4395)
    * Change *Provider StateKey to list of StateKeys
    
    * Add more statekey validation tests
    
    * Address PR comments
  • Python: Added Shell tool (#4339)
    * Added shell tool
    
    * Fixed CI error
    
    * Add ShellTool support for OpenAI and Anthropic providers
    
    - Add shell_tool_call, shell_tool_result, and shell_command_output content types
    - Add ShellTool class and shell_tool decorator to core
    - Add get_hosted_shell_tool() to OpenAI Responses client
    - Handle shell_call and shell_call_output parsing in OpenAI (sync and streaming)
    - Map ShellTool to Anthropic bash tool API format
    - Parse bash_code_execution_tool_result as shell_tool_result in Anthropic
    - Add unit tests for all new functionality
    - Add sample scripts for hosted and local shell execution
    
    Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
    
    * Addressed comments
    
    * Reverted ruff change
    
    * Fixed tests
    
    * Addressed comments
    
    ---------
    
    Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
  • Python: Fix IndexError when reasoning models produce reasoning-only messages in Magentic-One workflow (#4413)
    * Fix IndexError when reasoning models return no text content (#4384)
    
    In _prepare_message_for_openai(), the text_reasoning case unconditionally
    accessed all_messages[-1] to attach reasoning_details. When a reasoning
    model (e.g. gpt-5-mini) returns reasoning_details without text content,
    all_messages is empty, causing an IndexError.
    
    Guard the access by initializing all_messages with the current args dict
    when it is empty, so reasoning_details can be safely attached.
    
    Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
    
    * Address review: buffer reasoning details for valid message payloads (#4384)
    
    - Buffer pending reasoning details and attach to the next message with
      content/tool_calls, avoiding standalone reasoning-only messages.
    - When reasoning is the only content, emit a message with empty content
      to satisfy Chat Completions schema requirements.
    - Strengthen test assertions to verify text+reasoning co-location and
      that all messages with reasoning_details also have content or tool_calls.
    
    Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
    
    * Fix text_reasoning handling: always buffer and tighten tests (#4384)
    
    - Always buffer reasoning into pending_reasoning instead of conditionally
      attaching to the previous message via fragile all_messages emptiness check
    - Attach buffered reasoning to last message at end-of-loop when no subsequent
      content consumed it
    - Assert exact content values (content == '' not in ('', None))
    - Assert exact list lengths (== 1 not >= 1) for stronger regression guards
    - Add test for reasoning before FunctionCallContent
    
    Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
    
    * Apply pre-commit auto-fixes
    
    ---------
    
    Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
  • Python: Add Azure Cosmos history provider package (#4271)
    * Created cosmos history provider
    
    * add marker
    
    * Python: address Cosmos PR feedback
    
    - address provider/test/sample review feedback and cleanup typing
    - add cosmos integration test coverage and skip gating
    - add dedicated cosmos emulator jobs to python merge/integration workflows
    - switch cosmos workflow execution to package poe integration-tests task
    
    Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
    
    * Python: handle empty Cosmos session id
    
    - replace default partition fallback for empty session_id
    - log warning and generate GUID when session_id is empty
    - update unit tests to validate GUID fallback behavior
    
    Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
    
    * fix sample
    
    * fix cross partition query
    
    ---------
    
    Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
  • [BREAKING] Add response filter for store input in *Providers (#4327)
    * Add response filter for store input for *Providers
    
    * Apply suggestions from code review
    
    Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
    
    * Address feedback
    
    * Apply suggestions from code review
    
    Co-authored-by: SergeyMenshykh <68852919+SergeyMenshykh@users.noreply.github.com>
    
    ---------
    
    Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
    Co-authored-by: SergeyMenshykh <68852919+SergeyMenshykh@users.noreply.github.com>
  • Python: Add regression tests for Entry JoinExecutor Workflow.Inputs initialization (#4335)
    * Python: Add regression tests for #3948 - Entry JoinExecutor initializes Workflow.Inputs
    
    Add tests verifying that when workflow.run() is called with a dict or string
    input, the Entry node (JoinExecutor with kind: 'Entry') correctly initializes
    Workflow.Inputs via _ensure_state_initialized so that:
    - Expressions like =inputs.age resolve to the correct value
    - Conditions like =Local.age < 13 evaluate based on actual input (not blank/0)
    - String inputs populate both inputs.input and System.LastMessage.Text
    
    Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
    
    * Apply pre-commit auto-fixes
    
    * Fix D420 and RUF070 lint errors across packages
    
    * Revert _workflow.py yield-inside-context-manager changes
    
    Moving yield inside `with _framework_event_origin()` blocks in the
    async generator causes ContextVar token reset failures on Python 3.12
    Windows. The token stays un-reset while the generator is suspended,
    and async generator finalization in a different contextvars.Context
    triggers ValueError, corrupting OpenTelemetry span state and causing
    test_span_creation_and_attributes to see leaked spans.
    
    Keep yields outside the context manager blocks to ensure tokens are
    reset immediately before the generator suspends.
    
    ---------
    
    Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
  • Python: Add auto_retry.py sample for rate limit handling (#4223)
    * Initial plan
    
    * Add auto_retry.py sample for rate limiting handling
    
    Co-authored-by: eavanvalkenburg <13749212+eavanvalkenburg@users.noreply.github.com>
    
    * Update auto_retry sample to use class decorator for get_response retries
    
    Co-authored-by: eavanvalkenburg <13749212+eavanvalkenburg@users.noreply.github.com>
    
    * Address review feedback on auto_retry sample header and wrapper usage
    
    Co-authored-by: eavanvalkenburg <13749212+eavanvalkenburg@users.noreply.github.com>
    
    * Restore class-decorator retry sample and address reviewer feedback
    
    Co-authored-by: eavanvalkenburg <13749212+eavanvalkenburg@users.noreply.github.com>
    
    ---------
    
    Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
    Co-authored-by: eavanvalkenburg <13749212+eavanvalkenburg@users.noreply.github.com>
  • Python: fix(python): Handle thread.message.completed event in Assistants API streaming (#4333)
    * fix: handle thread.message.completed event in Assistants API streaming
    
    Previously, `thread.message.completed` events fell through to the
    catch-all `else` branch and yielded empty `ChatResponseUpdate` objects,
    silently discarding fully-resolved annotation data (file citations,
    file paths, and their character-offset regions).
    
    This commit adds a dedicated handler for `thread.message.completed`
    that:
    - Walks the completed ThreadMessage.content array
    - Extracts text blocks with their fully-resolved annotations
    - Maps FileCitationAnnotation and FilePathAnnotation to the
      framework's Annotation type with proper TextSpanRegion data
    - Yields a ChatResponseUpdate containing the complete text and
      annotations
    
    Fixes #4322
    
    * test: add tests for thread.message.completed annotation handling
    
    Tests cover:
    - File citation annotation extraction
    - File path annotation extraction
    - Multiple annotations on a single text block
    - Text-only messages (no annotations)
    - Non-text blocks are skipped
    - Mixed content blocks (text + image)
    - Conversation ID propagation
    
    * fix: address Copilot review - add quote field and log unrecognized annotations
    
    - Include `quote` from `annotation.file_citation.quote` in
      `additional_properties` for FileCitationAnnotation, preserving the
      exact cited text snippet from the source file
    - Add `else` clause to log unrecognized annotation types at debug level,
      consistent with the pattern in `_responses_client.py`
    - Add `import logging` and module-level logger
    
    * test: add coverage for quote field and unrecognized annotation logging
    
    - test_message_completed_with_file_citation_quote: verifies quote is
      included in additional_properties
    - test_message_completed_with_file_citation_no_quote: verifies quote
      is omitted when None
    - test_message_completed_unrecognized_annotation_logged: verifies
      unknown annotation types are logged at debug level and skipped
    
    * fix: address reviewer nits — logger name convention + annotation type string
    
    Per @giles17's review:
    - Use logging.getLogger('agent_framework.openai') to match module convention
    - Simplify debug message to use annotation.type instead of type().__name__
    
    * refactor: move message.completed tests into consolidated test file
    
    Per @giles17's review: moved all tests from test_assistants_message_completed.py
    into test_openai_assistants_client.py and deleted the standalone file.
    
    * fix: resolve mypy no-redef and ruff RET504 lint errors
    
    - Remove duplicate type annotation for 'ann' variable (no-redef)
    - Return directly from fixture instead of unnecessary assignment (RET504)
    
    * fix: rename annotation variable in completed block to fix mypy type conflict
    
    The 'annotation' loop variable in thread.message.completed has type
    FileCitationAnnotation | FilePathAnnotation, which conflicts with the
    delta block's 'annotation' of type FileCitationDeltaAnnotation |
    FilePathDeltaAnnotation. Renamed to 'completed_annotation' to avoid
    mypy 'Incompatible types in assignment' error.
    
    * fix: remove quote field from FileCitationAnnotation handling
    
    ---------
    
    Co-authored-by: Giles Odigwe <79032838+giles17@users.noreply.github.com>
  • Python: fix(python): Use AgentResponse.value instead of model_validate_json in HITL sample (#4405)
    * fix(python): use AgentResponse.value instead of model_validate_json in HITL sample
    
    Since the agent is configured with response_format=GuessOutput, the
    AgentResponse already provides .value with the parsed Pydantic model.
    Using .value is more idiomatic and avoids redundant JSON parsing.
    
    Fixes #4396
    
    * fix: add safety guard for AgentResponse.value being None
    
    Address Copilot review feedback: .value is optional and may be None
    if response_format isn't propagated through the streaming path.
    Add an explicit None check with a clear error message.
  • Bump uv from 0.10.5 to 0.10.7 in /python (#4393)
    Bumps [uv](https://github.com/astral-sh/uv) from 0.10.5 to 0.10.7.
    - [Release notes](https://github.com/astral-sh/uv/releases)
    - [Changelog](https://github.com/astral-sh/uv/blob/main/CHANGELOG.md)
    - [Commits](https://github.com/astral-sh/uv/compare/0.10.5...0.10.7)
    
    ---
    updated-dependencies:
    - dependency-name: uv
      dependency-version: 0.10.7
      dependency-type: direct:development
      update-type: version-update:semver-patch
    ...
    
    Signed-off-by: dependabot[bot] <support@github.com>
    Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
  • Bump poethepoet from 0.42.0 to 0.42.1 in /python (#4392)
    Bumps [poethepoet](https://github.com/nat-n/poethepoet) from 0.42.0 to 0.42.1.
    - [Release notes](https://github.com/nat-n/poethepoet/releases)
    - [Commits](https://github.com/nat-n/poethepoet/compare/v0.42.0...v0.42.1)
    
    ---
    updated-dependencies:
    - dependency-name: poethepoet
      dependency-version: 0.42.1
      dependency-type: direct:development
      update-type: version-update:semver-patch
    ...
    
    Signed-off-by: dependabot[bot] <support@github.com>
    Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
  • Bump prek from 0.3.3 to 0.3.4 in /python (#4391)
    Bumps [prek](https://github.com/j178/prek) from 0.3.3 to 0.3.4.
    - [Release notes](https://github.com/j178/prek/releases)
    - [Changelog](https://github.com/j178/prek/blob/master/CHANGELOG.md)
    - [Commits](https://github.com/j178/prek/compare/v0.3.3...v0.3.4)
    
    ---
    updated-dependencies:
    - dependency-name: prek
      dependency-version: 0.3.4
      dependency-type: direct:development
      update-type: version-update:semver-patch
    ...
    
    Signed-off-by: dependabot[bot] <support@github.com>
    Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
  • Bump ruff from 0.15.2 to 0.15.4 in /python (#4390)
    Bumps [ruff](https://github.com/astral-sh/ruff) from 0.15.2 to 0.15.4.
    - [Release notes](https://github.com/astral-sh/ruff/releases)
    - [Changelog](https://github.com/astral-sh/ruff/blob/main/CHANGELOG.md)
    - [Commits](https://github.com/astral-sh/ruff/compare/0.15.2...0.15.4)
    
    ---
    updated-dependencies:
    - dependency-name: ruff
      dependency-version: 0.15.4
      dependency-type: direct:development
      update-type: version-update:semver-patch
    ...
    
    Signed-off-by: dependabot[bot] <support@github.com>
    Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
  • Bump rollup (#4386)
    Bumps [rollup](https://github.com/rollup/rollup) from 4.52.4 to 4.59.0.
    - [Release notes](https://github.com/rollup/rollup/releases)
    - [Changelog](https://github.com/rollup/rollup/blob/master/CHANGELOG.md)
    - [Commits](https://github.com/rollup/rollup/compare/v4.52.4...v4.59.0)
    
    ---
    updated-dependencies:
    - dependency-name: rollup
      dependency-version: 4.59.0
      dependency-type: indirect
    ...
    
    Signed-off-by: dependabot[bot] <support@github.com>
    Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
  • Bump rollup in /python/samples/demos/ag_ui_workflow_handoff/frontend (#4284)
    Bumps [rollup](https://github.com/rollup/rollup) from 4.57.1 to 4.59.0.
    - [Release notes](https://github.com/rollup/rollup/releases)
    - [Changelog](https://github.com/rollup/rollup/blob/master/CHANGELOG.md)
    - [Commits](https://github.com/rollup/rollup/compare/v4.57.1...v4.59.0)
    
    ---
    updated-dependencies:
    - dependency-name: rollup
      dependency-version: 4.59.0
      dependency-type: indirect
    ...
    
    Signed-off-by: dependabot[bot] <support@github.com>
    Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
  • .NET: AzureAI Package - Skip tool validation when UseProvidedChatClientAsIs is true (#4389)
    * Skip tool validation when UseProvidedChatClientAsIs is true (#3855)
    
    When GetAIAgentAsync is called with ChatClientAgentOptions.UseProvidedChatClientAsIs = true,
    skip requireInvocableTools validation so users can handle function calls manually
    via custom ChatClient middleware without needing to provide matching AIFunction tools.
    
    Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
    
    * Simplify requireInvocableTools expression per review feedback
    
    UseProvidedChatClientAsIs is a non-nullable bool, so use ! operator
    instead of != true for clarity.
    
    Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
    
    * Decouple tool matching from validation and add tool preservation test (#3855)
    
    Always match provided AIFunctions to server-side function definitions
    regardless of requireInvocableTools flag. Only throw when validation
    is required and no match is found. This ensures UseProvidedChatClientAsIs
    still preserves user-provided AIFunction tools instead of falling back
    to the broken ResponseToolAITool wrapper.
    
    Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
    
    ---------
    
    Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
  • .NET: Skip OffThread observability test (#4399)
    * Skip flaky OffThread observability test
    
    Temporarily skip CreatesWorkflowEndToEndActivities_WithCorrectName_OffThreadAsync
    due to intermittent failures. Tracked in #4398.
    
    Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
    
    * Update dotnet/tests/Microsoft.Agents.AI.Workflows.UnitTests/ObservabilityTests.cs
    
    Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
    
    ---------
    
    Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
    Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
  • .NET: AuthN & AuthZ sample with asp.net service and web client (#4354)
    * Add sample demonstrating authentication and user access in agent tools
    
    * Add fixes to enable running on windows
    
    * Add launchsettings, add docker-compose to slnx and fix formatting
    
    * Switch to Expenses rather than todo based sample and address PR comments
    
    * Rename sample
    
    * Fix formatting