enforce-code-owner
520 Commits
| Author | SHA1 | Message | Date | |
|---|---|---|---|---|
|
|
0d75365331 |
.NET: Add Cosmos NoSQL vector memory sample (#7552)
* .NET: Add Cosmos NoSQL vector memory sample * Address Cosmos memory sample review feedback * Fix Cosmos NoSQL memory sample build --------- Co-authored-by: nos-redacted <nosxredacted@gmail.com> |
||
|
|
c987529df3 |
.NET: [BREAKING] Rename to AgentIsolationKeyProvider (#7567)
* Update store isolation documentation Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: 824a2e29-e79c-42aa-b28e-aa6c12ec3292 * Rename store isolation key provider Rename the shared session isolation abstraction to reflect its use for both session and task stores. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: 824a2e29-e79c-42aa-b28e-aa6c12ec3292 * Rename to AgentIsolationKeyProvider per review feedback Drops the `Store` qualifier and keeps an `Agent` prefix so the type is not confused with generic isolation-key abstractions from other libraries, while leaving room for future non-store isolation (memory, retrieval). - StoreIsolationKeyProvider -> AgentIsolationKeyProvider - ClaimsIdentityStoreIsolationKeyProvider(+Options) -> ClaimsIdentityAgentIsolationKeyProvider(+Options) - GetStoreIsolationKeyAsync -> GetIsolationKeyAsync - UseClaimsBasedStoreIsolation -> UseClaimsBasedAgentIsolation XML docs now state that the `Agent` prefix identifies the hosting API domain and does not mean agent instances are isolated. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: 824a2e29-e79c-42aa-b28e-aa6c12ec3292 * Update hosting spec for AgentIsolationKeyProvider rename Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: 824a2e29-e79c-42aa-b28e-aa6c12ec3292 --------- Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: 824a2e29-e79c-42aa-b28e-aa6c12ec3292 |
||
|
|
da056275e6 |
.NET: [Experimental] Extend A2A task store with isolation key scoping (#7504)
* .NET: Add tenant-scoped task store isolation for A2A hosting Wrap ITaskStore with IsolationKeyScopedTaskStore when a SessionIsolationKeyProvider is registered, mirroring the existing session store isolation pattern. This ensures task operations are scoped per tenant in multi-user deployments. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: adc30d6c-ce66-40bb-933e-9801c2156cda * fix formatting issue --------- Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: adc30d6c-ce66-40bb-933e-9801c2156cda |
||
|
|
84d5a5eec1 |
Consolidate Dependabot dependency updates (#7445)
* Bump AgentMemory from 1.2.0 to 1.3.0 --- updated-dependencies: - dependency-name: AgentMemory dependency-version: 1.3.0 dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <support@github.com> * .NET: consolidate #7280 AgentMemory.AgentFramework 1.3.0 * Bump github/codeql-action/init from 4.37.0 to 4.37.3 Bumps [github/codeql-action/init](https://github.com/github/codeql-action) from 4.37.0 to 4.37.3. - [Release notes](https://github.com/github/codeql-action/releases) - [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md) - [Commits](https://github.com/github/codeql-action/compare/99df26d4f13ea111d4ec1a7dddef6063f76b97e9...e4fba868fa4b1b91e1fdab776edc8cfbe6e9fb81) --- updated-dependencies: - dependency-name: github/codeql-action/init dependency-version: 4.37.3 dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com> * Bump astral-sh/setup-uv from 8.3.2 to 9.0.0 Bumps [astral-sh/setup-uv](https://github.com/astral-sh/setup-uv) from 8.3.2 to 9.0.0. - [Release notes](https://github.com/astral-sh/setup-uv/releases) - [Commits](https://github.com/astral-sh/setup-uv/compare/11f9893b081a58869d3b5fccaea48c9e9e46f990...c771a70e6277c0a99b617c7a806ffedaca235ff9) --- updated-dependencies: - dependency-name: astral-sh/setup-uv dependency-version: 9.0.0 dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] <support@github.com> * Bump github/codeql-action/analyze from 4.37.0 to 4.37.3 Bumps [github/codeql-action/analyze](https://github.com/github/codeql-action) from 4.37.0 to 4.37.3. - [Release notes](https://github.com/github/codeql-action/releases) - [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md) - [Commits](https://github.com/github/codeql-action/compare/99df26d4f13ea111d4ec1a7dddef6063f76b97e9...e4fba868fa4b1b91e1fdab776edc8cfbe6e9fb81) --- updated-dependencies: - dependency-name: github/codeql-action/analyze dependency-version: 4.37.3 dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com> * Bump actions/cache from 5.0.5 to 6.1.0 Bumps [actions/cache](https://github.com/actions/cache) from 5.0.5 to 6.1.0. - [Release notes](https://github.com/actions/cache/releases) - [Changelog](https://github.com/actions/cache/blob/main/RELEASES.md) - [Commits](https://github.com/actions/cache/compare/27d5ce7f107fe9357f9df03efb73ab90386fccae...55cc8345863c7cc4c66a329aec7e433d2d1c52a9) --- updated-dependencies: - dependency-name: actions/cache dependency-version: 6.1.0 dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] <support@github.com> * Bump actions/checkout from 6.0.2 to 7.0.1 Bumps [actions/checkout](https://github.com/actions/checkout) from 6.0.2 to 7.0.1. - [Release notes](https://github.com/actions/checkout/releases) - [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md) - [Commits](https://github.com/actions/checkout/compare/de0fac2e4500dabe0009e67214ff5f5447ce83dd...3d3c42e5aac5ba805825da76410c181273ba90b1) --- updated-dependencies: - dependency-name: actions/checkout dependency-version: 7.0.1 dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] <support@github.com> * Bump astral-sh/setup-uv in /.github/actions/python-setup Bumps [astral-sh/setup-uv](https://github.com/astral-sh/setup-uv) from 8.3.2 to 9.0.0. - [Release notes](https://github.com/astral-sh/setup-uv/releases) - [Commits](https://github.com/astral-sh/setup-uv/compare/11f9893b081a58869d3b5fccaea48c9e9e46f990...c771a70e6277c0a99b617c7a806ffedaca235ff9) --- updated-dependencies: - dependency-name: astral-sh/setup-uv dependency-version: 9.0.0 dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] <support@github.com> * Bump ty from 0.0.60 to 0.0.64 in /python Bumps [ty](https://github.com/astral-sh/ty) from 0.0.60 to 0.0.64. - [Release notes](https://github.com/astral-sh/ty/releases) - [Changelog](https://github.com/astral-sh/ty/blob/main/CHANGELOG.md) - [Commits](https://github.com/astral-sh/ty/compare/0.0.60...0.0.64) --- updated-dependencies: - dependency-name: ty dependency-version: 0.0.65 dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com> * Bump prek from 0.4.10 to 0.4.11 in /python Bumps [prek](https://github.com/j178/prek) from 0.4.10 to 0.4.11. - [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.4.10...v0.4.11) --- updated-dependencies: - dependency-name: prek dependency-version: 0.4.11 dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com> * Bump uv from 0.11.29 to 0.11.32 in /python Bumps [uv](https://github.com/astral-sh/uv) from 0.11.29 to 0.11.32. - [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.11.29...0.11.32) --- updated-dependencies: - dependency-name: uv dependency-version: 0.12.0 dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <support@github.com> * Bump ruff from 0.15.22 to 0.16.0 in /python Bumps [ruff](https://github.com/astral-sh/ruff) from 0.15.22 to 0.16.0. - [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.22...0.16.0) --- updated-dependencies: - dependency-name: ruff dependency-version: 0.16.0 dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <support@github.com> * update uv-build requirement in /python --- updated-dependencies: - dependency-name: uv-build dependency-version: 0.12.0 dependency-type: direct:development ... Signed-off-by: dependabot[bot] <support@github.com> * Python: align workspace pins for #7436-#7439 * Python: support ty 0.0.64 diagnostics for #7436 * Python: apply Ruff 0.16 formatting for #7439 * Update workflow action version annotations --------- Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> |
||
|
|
9c8151699a | Fix Handoff orchestration sample not responding to user input (#7442) | ||
|
|
43309018be |
.NET and Python: Extract Durable Task and Azure Functions integrations (#7465)
* Extract Durable Task and Azure Functions integrations Remove the migrated implementations, samples, tests, documentation, and repository wiring now owned by microsoft/agent-framework-durable-extension. Preserve Python compatibility through the agent_framework.azure shim and agent-framework-core[all], and leave customer-facing redirects to the new repository. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: 6181dcf9-857b-43ea-9fd2-fcd6b175ffdd * Fix feature registry validation after extraction Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: 6181dcf9-857b-43ea-9fd2-fcd6b175ffdd * Narrow external feature package paths Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: 6181dcf9-857b-43ea-9fd2-fcd6b175ffdd --------- Copilot-Session: 6181dcf9-857b-43ea-9fd2-fcd6b175ffdd |
||
|
|
6a3d535204 |
.NET: Add regression tests and sample guidance for stable agent IDs in checkpointed workflows (#7415)
* Add regression tests and sample guidance for stable agent IDs in checkpointed workflows * Updated tests to address PR comments * Improve test for checkpoint state. |
||
|
|
73f48d255e |
.NET: Add FileMemoryProvider sample to 02-agents/AgentWithMemory (#7401)
* Add FileMemoryProvider sample * Address PR comments |
||
|
|
0ca6a3e652 |
.NET: Add source (ZIP) deploy oriented hosted agent samples (#7372)
* Add zip/code-deploy POC for Hosted-ChatClientAgent (.NET) Migrate the sample to Foundry source (ZIP) deployment as the default: add azure.yaml with codeConfiguration (remote_build, dotnet_10) and the tool-generated .agentignore, make the csproj self-contained (single target, CPM off, published PackageReferences), and simplify Program.cs to the pristine end-user hosting path. Container files are kept for now; contributor and remaining samples handled in follow-ups. * .NET: Auto-bind Foundry hosted port for zip/code deploy; migrate Hosted-ChatClientAgent to source (ZIP) Foundry.Hosting: AddFoundryResponses now binds Kestrel to FoundryEnvironment.Port (the PORT env var, default 8088) for a plain WebApplication.CreateBuilder (Tier 3) host, mirroring AgentHostBuilder. This lets a source/ZIP-deployed .NET agent pass the readiness probe with no Dockerfile. It respects an explicit ASPNETCORE_URLS override and is idempotent. Adds FoundryListenPortTests plus a serialized env-var collection. Hosted-ChatClientAgent: migrate to source (ZIP) deploy as the default. Add azure.yaml with codeConfiguration (remote_build, dotnet_10) and the tool-generated .agentignore, make the csproj self-contained (single target, CPM off) with a local Directory.Packages.props, embed the local-dev per-agent route so the Using-Samples REPL can reach the local server, and rewrite the README around the azd flow. Documents AZURE_TOKEN_CREDENTIALS=dev for local runs. Using-Samples/SimpleAgent: fix the per-agent endpoint scheme rewrite so the local HTTP dev port is preserved (the policy now lives on the per-agent ProjectOpenAIClientOptions that actually serves the request). * .NET: Bind Foundry hosted port unconditionally; drop container files and the local-only agent route Zip/code deploy runs the sample as a plain ASP.NET app, so the Foundry readiness port was never bound and every invoke returned HTTP 424 session_not_ready. The first attempt skipped the binding when ASPNETCORE_URLS was already set, but the .NET base image always sets it to port 80, so the skip always tripped. Kestrel ListenAnyIP overrides ASPNETCORE_URLS, so the binding is now unconditional and PORT stays the only knob. Sample cleanup for zip deploy: * Remove Dockerfile, Dockerfile.contributor, agent.manifest.yaml and agent.yaml. Source deploy needs none of them. * Remove LocalDevEndpoint.cs and the invented per-agent local route. The local server already serves the standard POST /responses route, so the client can reach it directly. * Trim .env.example: the port and environment variables are no longer needed. * Exclude .checkpoints/ from the upload so local session state does not ship. SimpleAgent now asks at startup whether to chat with the local server or the deployed agent, the same choice azd ai agent invoke exposes through --local. Local uses an OpenAI responses client pointed at http://localhost:8088; Foundry uses the per-agent endpoint. Add scripts/New-ContributorStage.ps1, which stages a sample to a temp folder with the local Agent Framework source packed into a feed inside the upload, so contributors can deploy framework changes through the same azd flow end users run. * Pin hosted agent listen port in azure.yaml * Use the documented env map in azure.yaml * Make the contributor flow an extra step inside the end-user flow * Keep contributor scaffolding out of the sample project file * Document the full deploy walkthrough and add a bash contributor script * Trim troubleshooting detail from the sample README * Pass the model deployment name to the hosted container * Add --local and --remote flags to the SimpleAgent REPL * Use central package management in the hosted sample * Clarify where the contributor step fits in the deploy walkthrough * Restore the HTTP scheme rewrite for local AIProjectClient runs * Keep the sample package versions in the project file * Drop the sample Directory.Packages.props * Add a container deploy variant of the hosted chat client agent sample * Treat a blank model deployment variable as unset * Let azd prompt for the Foundry project and expand the contributor section * Document the stale conversation 404 in the hosted agent samples * Remove using directives already covered by global usings * Bind the Foundry listen port only inside a hosted container * Resolve the Foundry listen port from IConfiguration |
||
|
|
ad20ab009b |
.NET: Add GitHub Copilot BYOK sample (#7337)
* .NET: Add GitHub Copilot BYOK sample Demonstrates routing GitHubCopilotAgent requests through a custom OpenAI-compatible endpoint via SessionConfig.Provider instead of the default GitHub Copilot backend. * Potential fix for pull request finding Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com> * Update dotnet/samples/02-agents/AgentProviders/github-copilot/Agent_With_GitHubCopilot_BYOK/README.md Co-authored-by: Roger Barreto <19890735+rogerbarreto@users.noreply.github.com> * Update dotnet/samples/02-agents/AgentProviders/github-copilot/Agent_With_GitHubCopilot_BYOK/README.md Co-authored-by: Roger Barreto <19890735+rogerbarreto@users.noreply.github.com> * .NET: Address remaining BYOK sample review feedback - Make the provider type configurable via BYOK_PROVIDER_TYPE (default "openai") instead of hardcoding "openai", since the sample already documents Azure/Anthropic support. - Stop calling the endpoint "OpenAI-compatible" everywhere; Anthropic isn't OpenAI-wire- compatible, so reword to "your own endpoint" and list the actual supported providers. - Move the "About BYOK" explainer to the top of the README so the term is introduced before it's used, and finish applying the WireApi/ModelId comment suggestions. - Reword the AgentProviders/README.md entry to match (not OpenAI-specific). * .NET: Fix UTF-8 BOM on BYOK sample Program.cs The repo's .editorconfig requires utf-8-bom for .cs files; check-format was failing because the new file was written without one. --------- Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com> Co-authored-by: Roger Barreto <19890735+rogerbarreto@users.noreply.github.com> |
||
|
|
d0a0d5a3df |
.NET: Add TodoProvider and AgentModeProvider samples (#7262)
* Add samples for todo and mode providers * Address PR review: add Step21 to samples index and trim slash-command input Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * Print agent mode after each turn in AgentMode sample Reflects mode changes the agent makes itself via the mode_set tool. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --------- Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> |
||
|
|
0d5c0f8fa0 |
.NET: Add language and prompt customization to Magentic orchestration (#7263)
* Add language and prompt customization to Magentic orchestration * Update default prompts formatting |
||
|
|
ad26cfe8c7 |
.NET: Switch to using new community toolkit VectorData packages (#5694)
* Switch to using new community toolkit VectorData packages * Fix formatting. * Update dotnet/Directory.Packages.props Co-authored-by: Adam Sitnik <adam.sitnik@gmail.com> * Fix build error. * Upgrade MEAI * Upgrade additional dependencies * Address rename after package upgrade. * Revert some packages versions due to version mismatches --------- Co-authored-by: Adam Sitnik <adam.sitnik@gmail.com> |
||
|
|
ddb0622f9c |
.NET: Added GettingStarted example demonstrating Dapr as an agent provider (#1615)
* Added example demonstrating creating an AIAgent using the Microsoft.AI.Extensions implementation of IChatClient using Dapr as the inference backend provider - in this example, using Ollama Signed-off-by: Whit Waldo <whit.waldo@innovian.net> * Update dotnet/samples/GettingStarted/AgentProviders/Agent_With_Dapr/README.md Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * Added copyright statement at top of file Signed-off-by: Whit Waldo <whit.waldo@innovian.net> * Update dotnet/agent-framework-dotnet.slnx That's odd the IDE added it a second time. Co-authored-by: westey <164392973+westey-m@users.noreply.github.com> * Address review nits: configurable Dapr gRPC endpoint and document VersionOverride Make the Dapr sidecar gRPC endpoint configurable via the DAPR_GRPC_ENDPOINT environment variable (defaulting to http://localhost:3501) and document it in the README. Add a comment explaining why the Microsoft.Extensions.* VersionOverride entries are needed and when they can be removed. --------- Signed-off-by: Whit Waldo <whit.waldo@innovian.net> Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> Co-authored-by: westey <164392973+westey-m@users.noreply.github.com> Co-authored-by: Roger Barreto <19890735+RogerBarreto@users.noreply.github.com> |
||
|
|
1f1da1bddb |
.NET: [BREAKING] Hosting OpenAI Responses protocol helpers and optional execution state (#7000)
* .NET: Add OpenAI Responses protocol helpers and optional execution state (ADR-0032)
* Fix netstandard2.0/net472 build; harden helpers and workflow checkpoint key per review
* .NET: Migrate hosting Responses samples to Azure.AI.Projects and fix workflow resume
Migrate HostingResponsesAgent and HostingResponsesWorkflow samples from
Azure.AI.OpenAI to Azure.AI.Projects (AIProjectClient.AsAIAgent), using the
FOUNDRY_PROJECT_ENDPOINT/FOUNDRY_MODEL convention.
Fix HostedWorkflowState.RunOrResumeAsync: on subsequent turns, restore the
session's latest checkpoint and run the workflow forward with the new turn's
input (mirroring the Python hosting host's restore-then-run semantics) instead
of resuming a halted run with no input, which waited on input indefinitely.
Add round-trip resume tests and update ADR-0032/spec-003 wording.
* .NET: Fix HostedWorkflowState resume hang on unserviced external requests
On resume, HostedWorkflowState.RunOrResumeAsync drained the workflow with the
blocking WatchStreamAsync overload, so a workflow that halts at an unserviced
RequestInfoEvent (human-in-the-loop / approval) blocked forever — asymmetric
with the first-turn RunAsync path, which returns at the same halt. Break the
drain when a superstep completes with HasPendingRequests, restoring symmetry
with turn 1. Add a HITL approval-gate workflow and a resume-does-not-block test.
* .NET: Warn when a HostedWorkflowState resume makes no progress
Add an optional ILoggerFactory to HostedWorkflowState and log a warning when a
resumed turn produces no events, mirroring the Python host's zero-event restore
warning (a stale checkpoint or an input that does not match the workflow's
expected type leaves session state unprogressed). Add a non-chat string workflow
helper, a capturing logger, and a red/green test.
* .NET: Resume HostedWorkflowState from durable checkpoint on cursor miss
Add CheckpointManager.GetLatestCheckpointAsync(sessionId) and have
HostedWorkflowState fall back to it when its in-memory head cursor misses, so a
durable CheckpointManager resumes a session across a process restart or a new
holder instead of restarting from the workflow's start executor. Mirrors the
Python host's per-turn get_latest read-through. Add a counting workflow that
proves resume-vs-fresh via accumulated state, plus a red/green test, and update
ADR-0032/spec-003 and the XML remarks.
* .NET: Serialize HostedWorkflowState turns through a workflow lock
A single workflow instance backs the holder and workflow instances do not
support concurrent runs (the runner throws "already owned by another runner"),
so concurrent turns could fault or race the head cursor. Serialize all turns
through one SemaphoreSlim (mirroring the Python host's workflow lock) and make
HostedWorkflowState IDisposable to own it. Add a gated workflow and a
deterministic concurrency red/green test.
* .NET: Cover non-chat resume and multi-turn checkpoint advance
Add tests for HostedWorkflowState resuming a non-chat-protocol workflow (no
TurnToken) and for a third turn continuing to advance the head checkpoint,
closing the coverage gaps the parity review flagged.
* .NET: Add streaming workflow resume path and stream the workflow sample
Add HostedWorkflowState.RunOrResumeStreamingAsync, which yields the turn's
WorkflowEvents as they occur (fresh run or checkpoint resume) under the same
serialization lock and records the head checkpoint after the stream drains,
keeping the blocking and streaming workflow paths in lockstep with the Python
host. Honor stream:true in the HostingResponsesWorkflow sample by projecting
AgentResponseUpdateEvent updates over the Responses SSE wire. Add a streaming
resume test and update the README/spec.
* .NET: Cover Responses input adaptation to a typed workflow start executor
Demonstrate that HostedWorkflowState's generic RunOrResumeAsync<TInput> is the
input-adaptation seam (parity with Python's ResponsesChannel run hook): the app
adapts the Responses input into the workflow start executor's own type at the
call site. Add a typed-brief workflow and a test, and note the seam in spec-003.
* .NET: Drain workflow resume non-blocking to prevent hang and truncation
The resume drain used a SuperStepCompletedEvent{HasPendingRequests} proxy over
the blocking public WatchStreamAsync. That proxy (a) truncated a resumed turn
when a superstep both emitted a request and queued downstream work, and (b)
could fail to fire at all — re-introducing the indefinite hang — when a resume
input drove no superstep (e.g. a rejected non-chat input).
Make StreamingRun.WatchStreamAsync(bool blockOnPendingRequest, CancellationToken)
public and drain both the blocking and streaming resume paths with
blockOnPendingRequest:false, exactly matching the first-turn RunAsync semantics
(Run.RunToNextHaltAsync). Add guard tests: resume with a rejected input does not
hang, and a resume superstep with a request plus downstream work is not
truncated (verified red against the old proxy).
* .NET: Return file-store checkpoint index in commit order
CheckpointManager.GetLatestCheckpointAsync takes the last entry of a store's
index as the head checkpoint. FileSystemJsonCheckpointStore backed its index
with a HashSet, whose enumeration order is not contractual: after a rollback
frees and reuses a slot, enumeration can diverge from commit order, so the
durable read-through could resume a stale checkpoint. Mirror the HashSet with an
insertion-ordered list and enumerate it from RetrieveIndexAsync so 'latest' is
reliable. Add a CheckpointManager.GetLatestCheckpointAsync contract test over the
file store.
Note: the HashSet disorder is only reachable via the internal rollback path, so
the test locks the ordering contract rather than reproducing the rare disorder.
* .NET: Advance cursor when a streaming resume is abandoned
RunOrResumeStreamingAsync recorded the head checkpoint only after the stream was
fully enumerated. If an SSE consumer disconnected mid-turn after supersteps had
committed, the in-memory cursor kept the previous turn's head; because the next
turn is then a cursor hit, durable read-through could not self-heal, so it
resumed pre-disconnect state. Record the run's last committed checkpoint in a
finally so an abandoned stream still advances the cursor. Add a red/green test.
* .NET: Stream only the final agent's updates in the workflow sample
ExtractUpdates streamed every agent's updates, so the sequential Writer->Reviewer
sample streamed the intermediate draft and the final answer over SSE, differing
from the non-streaming response (final message only). Filter the streamed updates
to the final agent so streaming and non-streaming produce the same response.
Live-verified against Foundry: one output item streamed instead of two.
* .NET: Isolate the holder lock in the concurrency test
The concurrency test asserted the second same-session turn did not enter the
workflow, which also passes via the engine's concurrent-run ownership guard
(which faults) rather than the holder lock (which waits). Assert instead that the
second turn is not completed while the first holds the lock: a fault would
complete the task, so a pending task isolates the holder lock from the engine
guard. Verified red with the lock removed.
* Fix IDE1006 naming in tests; address review feedback and add hosting/live tests
* Document commit-order contract for ICheckpointStore.RetrieveIndexAsync
* Restructure hosting samples under af-hosting with client/server split matching Python parity
* Clarify hosting sample README wording and drop Python comparisons
* Make AgentSessionStore.DeleteSessionAsync abstract and rename session id parameter to sessionStoreId
* Rename OpenAIResponses id helpers and parse the request once for id extraction
* Reclaim per-session locks in HostedAgentState and demonstrate session locking in the agent sample
* Internalize per-session locking in HostedAgentState (automatic, on by default) and remove mirroring-Python wording from code and spec
* Remove HostedAgentState; app-owned routes use AgentSessionStore directly
HostedAgentState only bundled an AIAgent with an AgentSessionStore and, after
the per-session lock was removed, its GetOrCreateSessionAsync/SaveSessionAsync/
DeleteSessionAsync were pass-throughs that just bound the agent argument.
Create-on-miss already lives in the store (unlike Python, whose get/set-only
SessionStore justifies its AgentState holder), so the type earned its place
only via the lock.
Each AgentSessionStore.GetSessionAsync now returns an independent session
instance per call, so concurrent gets fork the same stored state (e.g.
branching from previous_response_id or managing several conversation ids)
without sharing an instance. The store does no cross-call locking; serializing
concurrent runs against the same id is the application's concern.
- Delete HostedAgentState and its unit tests.
- Rewire the local_responses sample and the OpenAI hosting unit/integration
tests to call AgentSessionStore (GetSessionAsync/SaveSessionAsync) directly.
- Update ADR-0032, spec-003, and the af-hosting sample READMEs.
* Isolate hosted session snapshots and distinguish conversation vs response continuation
Mirrors the Python hosted-session isolation work: a hosted session read must be
an independent copy, and the app-owned route must persist under the right
continuation key depending on how the caller continued the thread.
- AgentSessionStore.GetSessionAsync: document the isolation invariant (each
call returns an independent AgentSession so concurrent branches from one
previous_response_id do not observe each other's mutations or alter stored
state); fix the stale "or null if not found" wording (in-box stores return a
fresh created session on miss). The in-box stores already satisfy this via a
serialize/deserialize snapshot round-trip.
- local_responses sample + hosting unit-test route: choose the save key by
channel. A stable conversation id is a mutable head (write back under the
same id; app owns single-writer coordination). A previous_response_id
continuation or first turn is an immutable snapshot (save under the new
response id so branches from the same prior response stay independent).
- Add regression tests: independent get returns a distinct instance
(InMemoryAgentSessionStore); previous_response_id supports independent
branches ([1,2,2,3,3]); conversation id advances the mutable head ([1,2]).
- Update the sample README and ADR-0032 wording.
* Add workflow-factory support to HostedWorkflowState for concurrent sessions
HostedWorkflowState backed every session with one shared Workflow instance and
serialized all turns through a lock, so independent sessions could not run
concurrently. Add a workflow-factory constructor and remove the run lock.
- New constructor HostedWorkflowState(Func<CancellationToken, ValueTask<Workflow>>
workflowFactory, ..., bool cacheWorkflow = false):
- cacheWorkflow: false (default) builds a fresh instance per run, so independent
sessions run in parallel. A resume rehydrates a fresh instance from the
session's checkpoint in the shared store.
- cacheWorkflow: true builds the workflow once, lazily on first use, and reuses
it (a deferred, cached target that, like a shared instance, cannot run
concurrent turns).
- Remove the internal SemaphoreSlim run lock and IDisposable; the instance
constructor is unchanged in behaviour (one shared instance still cannot run
concurrent turns). Turns are no longer serialized by the holder; a single
writer per session is the application's responsibility.
- Switch the local_responses_workflow sample to the factory constructor with an
explicit cacheWorkflow: false, and document the option.
- Add tests: parallel independent sessions (factory), fresh-instance resume,
cached factory builds once and reuses, uncached factory builds per run.
- Update ADR-0032, spec-003, and the sample README.
* Clarify in ADR-0032 how .NET covers AgentState factory and async-setup via DI
* Rebuild cached workflow after a faulted build and add checkpoint index dedup tests
|
||
|
|
c033adb1f4 |
.NET: [BREAKING] Graduate HarnessAgent (#7119)
* Graduate HarnessAgent * Switch harness project to released and remove unreleased shell dependency * Address PR comments. |
||
|
|
f4e49958f3 |
samples: add AgentMemory (Neo4j-agent memory reimplemented in NET ) shopping assistant sample (#7096)
* samples: add Neo4j Shopping Assistant (standalone, published AgentMemory 1.0.1) The .NET port of the official Neo4j Agent Memory "retail assistant" example (neo4j-labs/agent-memory examples/microsoft_agent_retail_assistant, referenced from the Learn integration page), which is currently Python-only. Wires Neo4jMemoryContextProvider (AIContextProvider), MemoryToolFactory memory tools, and a ProductCatalog of retail tools over a Neo4j :Product graph, via the published AgentMemory + AgentMemory.AgentFramework 1.0.1 NuGet packages. Lives at the repo root rather than under dotnet/samples/: that tree is .NET 10 + Central Package Management + Microsoft.Agents.AI ~1.13 with source ProjectReferences, while AgentMemory currently targets net9.0 + Microsoft.Agents.AI 1.9.0. A repo-native version needs AgentMemory bumped to track the newer Agents.AI/Extensions.AI line first. Cross-linked from dotnet/samples/02-agents/AgentWithMemory/README.md as a "See also" entry, same pattern already used for the cross-folder Custom Memory Implementation link. Verified: dotnet build succeeds (0 warnings, 0 errors) against the published packages, proving the AgentMemory public surface is package-consumable. Matches sibling AgentWithMemory samples' conventions (BOM + copyright file header on .cs files, README sections: Features Demonstrated / Prerequisites / Environment Variables / Run the Sample / Expected Output). Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> * samples: move Neo4j shopping assistant into AgentWithMemory as Step06 Relocates the standalone shopping-assistant sample from the repo root into dotnet/samples/02-agents/AgentWithMemory/AgentWithMemory_Step06_MemoryUsingAgentMemory, following that folder's naming/README/solution conventions. Renames its identity from "Neo4j" to "AgentMemory" (the library it actually demonstrates) since this is a community .NET port, not an officially recognized Neo4j integration - Neo4j is still referenced where it's a genuine technical detail (the graph backing store, env vars, Cypher). Adds empty Directory.Build.props/targets markers so it stays isolated from the repo's net10.0/CPM build, and registers it (skipped, like the Mem0 sample) in the CI sample-verification list since it needs a live Neo4j instance. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> * Update dotnet/samples/02-agents/AgentWithMemory/README.md Co-authored-by: westey <164392973+westey-m@users.noreply.github.com> * Update dotnet/samples/02-agents/AgentWithMemory/AgentWithMemory_Step06_MemoryUsingAgentMemory/AgentWithMemory_Step06_MemoryUsingAgentMemory.csproj Co-authored-by: westey <164392973+westey-m@users.noreply.github.com> * cleanup :) * DefaultAzureCredential warning * fixes - simplification userId * minor doc fix * NU1015 fix * PR review fixes-improvements * Bump AgentMemory to 1.2.0, let the context provider surface memory tools WithMemoryOwnerScoping(sp) (1.1.0) already removed the need to manually wrap agent.RunAsync in ownerContext.BeginOwnerScope(userId). This picks up 1.2.0's ExposeMemoryToolsFromContextProvider option, so Neo4jMemoryContextProvider now appends the memory tools to AIContext.Tools itself on every model call — no more separate MemoryToolFactory wiring, AIContextProviders = [memoryProvider] is enough. Addresses westey-m's PR review suggestion. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> * improvements according to pr review comments * Fix CI: use plural TargetFrameworks to actually restrict this sample to net10.0 Directory.Build.props sets a repo-wide TargetFrameworks (plural) list before this project's own properties are evaluated, and the SDK decides multi-targeting from that plural property at Sdk.props time. The prior singular TargetFramework=net10.0 override didn't take effect early enough, so restore still ran against net9.0/net8.0/netstandard2.0/net472 too - frameworks the published AgentMemory 1.2.0 packages don't support (NU1202), plus surfaced an OpenTelemetry.Api advisory as an error (NU1902) since TreatWarningsAsErrors is on repo-wide. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> * Fix CI: pin OpenTelemetry.Api to unblock NU1902 audit failure The sample opts out of central package management, so it was pulling in OpenTelemetry.Api 1.12.0 transitively (via Microsoft.Agents.AI), which has a known moderate-severity vulnerability (GHSA-g94r-2vxg-569j). The repo treats NuGet audit warnings as errors, so restore failed outright and took down every dotnet-build matrix leg plus check-format. Pinned OpenTelemetry.Api to 1.15.3, matching Directory.Packages.props. With restore succeeding, previously-masked analyzer/format issues surfaced and are fixed too: RCS1118 (const local for immutable Cypher queries), CA1859 (List<IRecord> param instead of IReadOnlyList<IRecord>), and IDE1006 naming violations (s_seed field prefix, PascalCase Cypher/Shopper consts). Verified locally with the same mcr.microsoft.com/dotnet/sdk:10.0 image CI uses: dotnet build --warnaserror and dotnet format --verify-no-changes both pass clean, and a full solution build completed ~24 min with zero errors. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> --------- Co-authored-by: Claude Sonnet 5 <noreply@anthropic.com> Co-authored-by: westey <164392973+westey-m@users.noreply.github.com> |
||
|
|
b3f2e53923 |
.NET: [BREAKING] Graduate ToolApprovalAgent and add ToolAutoApprovalRuleContext (#7107)
* Graduate ToolApprovalAgent and introduce tool auto approval context * Address PR comments |
||
|
|
d93fc2dd74 |
.NET: [BREAKING] Harness: Switch FileAccess to opt-in (#7093)
* Switch FileAcessProvider on Harness to opt-in * Address PR comment --------- Co-authored-by: Evan Mattson <35585003+moonbox3@users.noreply.github.com> |
||
|
|
54617557e6 |
Update Foundry branding (#6999)
Replace user-facing Azure AI Foundry branding with Microsoft Foundry across docs, samples, comments, and display text while preserving technical identifiers. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Co-authored-by: Evan Mattson <35585003+moonbox3@users.noreply.github.com> |
||
|
|
23977a6045 |
.NET: Add name collision warnings for auto-approvals (#7089)
* Add name collision warnings for auto-approvals * Address PR comments |
||
|
|
e57f046d8a | Graduate mode and todo providers (#7052) | ||
|
|
beb65b21a8 |
.NET: [BREAKING] Graduate message injection out of experimental (#7044)
* Remove experiemental flags for MessageInjection component * Improve locking on message injection. |
||
|
|
875031ff56 | Fix broken sample | ||
|
|
fbaa346eec |
.NET: Python/.Net: Agent Harness blog post accompanying samples part 3 (#6741)
* Python/.Net: Agent Harness blog post accompanying samples part 3 * Delete inadvertently added files * Address PR feedback. * Rename files that are causing dotnet format failures * Address PR comment * Fix blog links |
||
|
|
3d17615b6e |
.NET: Replace MAF AG-UI abstractions with the AG-UI C# SDK abstractions (#6653)
* .NET: Replace internal AG-UI implementation with external ag-ui packages Remove the in-tree Microsoft.Agents.AI.AGUI sources and consume the external AG-UI .NET SDK packages (AGUI.Abstractions, AGUI.Formatting, AGUI.Protobuf, AGUI.Client, AGUI.Server) at 0.1.0-preview instead. - Microsoft.Agents.AI.Hosting.AGUI.AspNetCore keeps its own ASP.NET glue (MapAGUI / AddAGUI / SSE result) layered over the framework-agnostic AGUI.Server primitives (ToChatRequestContext / AsAGUIEventStreamAsync). - Migrate call sites to the options-based AGUIChatClient constructor and recover the originating AG-UI input via ChatOptions.TryGetRunAgentInput. - Multi-turn continuation flows through parentRunId + threadId on RawRepresentationFactory; shared state flows through RunAgentInput.State and is surfaced as StateSnapshotEvent raw representations. - Update samples, hosting/unit/integration tests, and central package versions. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * Add migration README for removed Microsoft.Agents.AI.AGUI package Keep the package folder in place with a README explaining that the in-tree AG-UI protocol abstractions moved to the external AGUI.* NuGet packages, with a mapping of old namespaces to the new packages and a migration guide. --------- Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Co-authored-by: Roger Barreto <19890735+rogerbarreto@users.noreply.github.com> |
||
|
|
03a96faf43 |
.NET: Add security information to harness features xml docs (#6933)
* Add security information to harness features xml docs * Address PR comments |
||
|
|
331d17c5a1 |
.NET: fix: Require explicit TokenCredential in AddFoundryToolboxes (#6877)
* fix: require explicit TokenCredential in AddFoundryToolboxes The AddFoundryToolboxes extension methods now require callers to pass a TokenCredential explicitly rather than relying on an internally-created default credential. This makes the credential choice intentional and avoids non-deterministic credential probing in production environments. Breaking change (experimental API): - AddFoundryToolboxes(IServiceCollection, params string[]) becomes AddFoundryToolboxes(IServiceCollection, TokenCredential, params string[]) - AddFoundryToolboxes(IServiceCollection, Action?, params string[]) becomes AddFoundryToolboxes(IServiceCollection, TokenCredential, Action?, params string[]) - Azure.Identity package dependency removed from Foundry.Hosting library. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * fix: simplify redundant generic type argument (IDE0001) Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * fix: avoid duplicate FoundryToolboxService registration Inject the AddFoundryToolboxes credential directly into the FoundryToolboxService factory and fail early if the service was already registered. This avoids registering TokenCredential in the host DI container while preserving a single toolbox service instance for both request handling and hosted startup. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --------- Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> |
||
|
|
db80926f31 |
.NET: Improving DotNet samples (#6869)
* fix: resolve CA1873 in GitHubCopilotAgent by using LoggerMessage source generator Replace the direct logger.LogWarning() call (which eagerly evaluates string.Join()) with a [LoggerMessage]-generated extension method in GitHubCopilotAgentLogMessages.cs. Fixes build error: GitHubCopilotAgent.cs(580,13): error CA1873: Evaluation of this argument may be expensive and unnecessary if logging is disabled Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * Fixing more dotnet samples --------- Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Co-authored-by: Ben Thomas <25218250+alliscode@users.noreply.github.com> |
||
|
|
551b44f04f |
.NET: Bump Azure.AI.Projects to 2.1.0-beta.4 (#6795)
* .NET: Bump Azure.AI.Projects to 2.1.0-alpha.20260629.1 Bumps Azure.AI.Projects beta.3 to alpha.20260629.1 and aligns transitive deps (System.ClientModel 1.14.0, Azure.Core 1.59.0, Msal 4.84.2). Adapts to renamed AgentSessionFiles APIs (Upload/GetAll/Delete, scoped GetAgentSessionFiles, SizeInBytes), AgentToolboxes (CreateVersion/Delete), and strongly typed toolbox tools (WebSearchToolboxTool, MCPToolboxTool). Adds azure-sdk public dev feed for prerelease restore. * Use positional arg for AgentSessionFiles.DeleteAsync cleanup * Move to Azure.AI.Projects 2.1.0-beta.4 (released beta) Swaps the alpha daily build for the published 2.1.0-beta.4. Drops the azure-sdk public dev feed since beta.4 and its deps are on nuget.org. Beta.4 requires Azure.Core 1.60.0, which cascades the 10.0.8 servicing packages (Microsoft.Bcl.AsyncInterfaces, System.Diagnostics.DiagnosticSource, System.Text.Json, System.Threading.Channels, Microsoft.Extensions.DependencyInjection.Abstractions, Microsoft.Extensions.Logging.Abstractions) to 10.0.9. * Reconcile Azure.Core 1.60.0 bump with merged main Reverts the over-eager System.Threading.Channels 10.0.9 bump back to 10.0.8 (it was not part of the Azure.Core 1.60.0 cascade and caused a net472 MSB3277 conflict against the 10.0.8 that Microsoft.Extensions.AI pulls). Drops the now-obsolete Azure.Core VersionOverride=1.59.0 in HostedWorkflowHandoff (added on main to satisfy AgentServer while the central pin was lower); the central pin is now 1.60.0 which already satisfies the >=1.59.0 floor, and the override was downgrading this project below sibling projects (CS1705). |
||
|
|
62f0024707 |
.NET: Foundry Hosting gracefully tolerates lacking user identity when run locally (#6870)
* .NET: Make Foundry Hosting resilient to missing user identity in local runs AgentFrameworkResponseHandler threw InvalidOperationException (surfaced as a 500 on every request) when the isolation-key provider returned null, which always happens locally because the platform x-agent-user-id header is absent. Running a hosted image outside Foundry therefore failed out of the box. The handler now branches on FoundryEnvironment.IsHosted: hosted stays strict (null identity is still a hard error), but non-hosted (local docker run / dotnet run) tolerates a null identity - per-user isolation is simply not triggered, the request proceeds with userId null (no partition), and no hosted context is stamped or validated. Because local runs no longer need a fallback, the sample-side DevTemporaryLocalUserIdProvider and AddDevTemporaryLocalContributorSetup are removed from Hosted_Shared_Contributor_Setup and all sample Program.cs files. To simulate distinct users locally, send an x-agent-user-id request header; the default provider reads it exactly as it reads the platform-injected value. The Memory sample smoke script now drives alice/bob against one container via that header. AGENT_NAME defaults added to Hosted-ChatClientAgent and Hosted-MemoryAgent so a hosted deploy (where AGENT_* is a reserved env var) does not crash at startup. Updates the two affected unit tests to assert the local-success path and amends ADR 0031. * Address review: correct isolation-guarantee and Memory-sample local docs - AgentFrameworkResponseHandler: note the null/local case is unscoped/shared, not fully partitioned per user. - HostedSessionIsolationKeyProvider XML docs: phrase the non-null UserId rule as a constraint on the returned-context case, since null is now allowed locally. - Hosted-MemoryAgent: the PerUser() memory scope requires a resolved user, so a local run needs an x-agent-user-id header; corrected the Program.cs comment and README (removed the inaccurate "shared bucket locally" claim). - Test: assert absence of any u-* per-user directory via a wildcard search rather than checking for a literal "u-" directory. |
||
|
|
c1e20632f7 |
.NET: Remove Experimental attribute from Skills API in Microsoft.Agents.AI (#6861)
* .NET: Remove Experimental attribute from Skills API in Microsoft.Agents.AI Closes microsoft/agent-framework#6835 Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> * Restore MAAI001 suppression for Step07 sample (still uses ToolApproval experimental APIs) Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> * Keep bare NoWarn placeholder in Step01 and Step02 samples Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> --------- Co-authored-by: SergeyMenshykh <SergeMenshikh@outlook.com> Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> |
||
|
|
e56f34c521 |
.NET: [BREAKING] Add file editing tools and align FileAccess/FileMemory store API (#6807)
* Add support for editing to file access and memory plus renames * Address PR comments * Address PR comments |
||
|
|
f9b2fbb676 |
.NET: Foundry Hosting per-user session isolation and Responses v2 protocol fast-fail (#6832)
* Add per-agent and per-user session storage isolation for Foundry Hosting
Partitions hosted session and checkpoint files as {root}/a-{agentName}/u-{userId}/c-{contextId}.json so a container that serves multiple agents and multiple users cannot leak state across tenants. The user layer collapses to a-{agent}/c-{conv}.json when no x-agent-user-id is present (raw local). Adds a reject-style path-traversal guard (CWE-22) for the untrusted user id plus a resolve-and-assert-under-root containment check, and keeps the strict-resume 403 identity check as a second defense layer.
AgentSessionStore.GetSessionAsync/SaveSessionAsync take a required (nullable) userId so a caller can never silently persist a session unscoped; the handler resolves the user id before loading the session and threads it to both. Tool approvals ride in the session checkpoint (ToolApprovalIdMap to AgentSessionStateBag), so the partitioned path covers them and no separate approval store is needed. Renames the sample HOSTED_USER_ISOLATION_KEY env var to HOSTED_USER_ID and DevTemporaryLocalSessionIsolationKeyProvider to DevTemporaryLocalUserIdProvider. Documents the design in ADR 0031. Adds handler-driven multi-agent/multi-user file-system tests and store-level traversal/isolation tests.
* Fail fast with a clear 501 when hosted container is served responses protocol 1.0.0
A 2.0.0-only hosted image served container protocol 1.0.0 (no x-agent-foundry-call-id
header) previously threw and surfaced an opaque 500 on every request. It now returns a
clear 501 "unsupported_container_protocol_version" naming the required protocol.
* HostedProtocolCompatibility gate keyed on FoundryEnvironment.IsHosted plus
PlatformContext.CallId (the 2.0.0 exclusive marker); invoked before isolation resolution
* HostedProtocolCompatibilityTests unit coverage; AgentFrameworkResponseHandlerTests note
clarifies the non-hosted path
* UnsupportedProtocolHostedAgentTests integration test deploys a dedicated
it-unsupported-protocol agent as 1.0.0 and asserts the 501 (validated live on cace)
* TestContainer recognizes the unsupported-protocol scenario
* it-bootstrap-agents.ps1 placeholder default raised to responses 2.0.0 and adds the
it-unsupported-protocol agent; HostedAgentFixture protocol version is overridable
* Address PR review: whitespace protocol gate and InMemory store agent keying
* HostedProtocolCompatibility treats a whitespace-only x-agent-foundry-call-id as
absent (IsNullOrWhiteSpace) so a proxy injecting whitespace cannot bypass the gate;
unit test covers empty, spaces and tab
* InMemoryAgentSessionStore keys sessions by agent.Name (omitting the agent segment
when Name is unset), mirroring FileSystemAgentSessionStore, so session continuity
survives a recreated or transient agent rather than keying on the per-instance agent.Id
|
||
|
|
0d53d11bc6 |
.NET: [BREAKING] Bump Azure.AI.AgentServer to 2.0.0 protocol and migrate Foundry.Hosting (#6800)
* .NET: Bump Azure.AI.AgentServer to 2.0.0 protocol and migrate Foundry.Hosting Bumps Core .25->.26, Invocations .4->.5, Responses .5->.6 and adopts the 2.0.0 container protocol. Breaking change: IsolationContext (UserIsolationKey + ChatIsolationKey) is replaced by PlatformContext (UserIdKey from x-agent-user-id, CallId from x-agent-foundry-call-id). The per-chat key is gone; HostedSessionContext is now user-only and the per-request CallId is forwarded outbound to Foundry first-party services (toolbox/MCP). Also fixes a real call-id egress bug: AsyncLocal writes inside the streaming response iterator are reverted across yield boundaries, so the call id was dropped before the toolbox/MCP egress ran. The handler now re-applies HostedCallContext.CallId before each egress point. Adds HostedConversationKey to map a request to a stable MAF AgentSession via conversation_id, else the partition key embedded in previous_response_id, else the minted response id. This keeps store=false previous_response_id chains and conversation_id forks on a single hosted MAF session without using the container session id. Sample manifests bump the responses protocol to 2.0.0 (invocations stays 1.0.0). Integration tests split store/session semantics into HostedResponsesStoreConfigTests with its own scenario, read stored responses through the per-agent endpoint client, and inject the model deployment into the container. * Pin Azure.Core 1.59.0 for Hosted-Workflow-Handoff sample AgentServer 1.0.0-beta.26 (pulled transitively via Foundry.Hosting) requires Azure.Core 1.59.0. This sample disables transitive pinning and references Azure.Core directly, so override just this project to the SDK-required version without moving the solution-wide central pin. * Add guard test for request-scoped call-id cleanup Asserts HostedCallContext.CallId does not leak into the caller's execution context after CreateAsync's stream completes, while confirming the agent run still observed the call id. Documents the request-scoped contract and guards against stale-header leakage across requests handled on the same thread. * Refresh hosting READMEs for AgentServer 2.0 migration Updates stale docs to match the shipped code: the MemoryAgent README now describes the x-agent-user-id user-identity header (chat isolation key removed) feeding HostedSessionContext.UserId; the IntegrationTests README corrects the scenario count (six to eleven), adds the missing memory scenario row, and stops claiming all scenarios are skipped now that several are validated and active. * Add ADR 0030 superseding 0026 for AgentServer 2.0 platform context Documents the migration from ResponseContext.Isolation (UserIsolationKey/ChatIsolationKey) to ResponseContext.PlatformContext (UserIdKey/CallId): user-only HostedSessionContext, the request-scoped HostedCallContext call-id forwarded on egress, HostedConversationKey session keying, and removal of the PerChat/PerUserAndChat memory scopes. Marks ADR 0026 as superseded. * Add breaking-change v2.0-only disclaimer to package metadata Augments the package Description and adds PackageReleaseNotes stating this release targets the Foundry Responses container protocol v2.0 only, is not compatible with v1, and directs consumers to a previous release for the v1 protocol definition. * Address review comments: dead chat-key surface and weak test assertions Fixes the automated review findings: the MemoryAgent/AgentSkills .env.example now say one variable (only HOSTED_USER_ISOLATION_KEY remains); the MemoryAgent smoke script drops the unused ChatKey parameter and its call-site arguments; HostedConversationKey null test now exercises a real null (and whitespace); and the reuse-one-session test asserts an exact SessionCount of 1 instead of <= 1. |
||
|
|
4272d90051 |
Python/.Net: Agent Harness blog post accompanying samples part 2 (#6692)
* Add samples for the harness blog part 2 * Address PR comments * Fix blog links. * Address PR comments * Fix bug where mode was incorrectly defaulted when reading the mode before the first run. * Add reference to new sample readme |
||
|
|
a1c37b69e0 |
[Generated by SRE Agent] Clarify identifier security guidance (#6510)
Co-authored-by: Azure SRE Agent <noreply@microsoft.com> Co-authored-by: Evan Mattson <35585003+moonbox3@users.noreply.github.com> |
||
|
|
d5c5fb9d3d |
.NET: Enforce ApprovalRequiredAIFunction in GitHub Copilot provider via OnPreToolUse hook (#6674)
* .NET: Enforce ApprovalRequiredAIFunction in GitHub Copilot provider The GitHub Copilot SDK owns the tool-calling loop and invokes registered custom functions directly, so the standard FunctionInvokingChatClient approval round-trip never runs for this provider. As a result a tool wrapped in ApprovalRequiredAIFunction (only a marker) could execute without any Agent Framework approval. Add an agent-level onFunctionApproval callback and wrap approval-required tools in an ApprovalGatedAIFunction that enforces approval before invoking the underlying function. Secure-by-default: with no callback, or when the callback denies or throws, execution is denied. The gate forwards tool metadata (including the Copilot skip_permission flag) so it stays transparent to the SDK. This mirrors the Python provider's behavior. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * .NET: Propagate cancellation from GitHub Copilot approval callback Let OperationCanceledException propagate from the approval callback instead of swallowing it into a denial, so cooperative cancellation is honored. Other callback failures still deny by default. Added a unit test. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * .NET: Enforce ApprovalRequiredAIFunction via Copilot SDK OnPreToolUse hook Replace the custom approval enforcement (ApprovalGatedAIFunction wrapper + onFunctionApproval callback) with the GitHub Copilot SDK's native OnPreToolUse hook, which the SDK already provides for pre-execution gating. When a tool wrapped in ApprovalRequiredAIFunction is registered and the caller hasn't supplied their own OnPreToolUse hook, the agent installs a default hook that returns "ask" for those tools (routing the decision to OnPermissionRequest) and defers (null) for all other tools, preserving today's behavior for non-approval tools. If the caller supplies their own OnPreToolUse hook, it takes precedence and they own approval handling; the agent logs a warning naming any approval-required tool that will not be auto-gated, and the behavior is documented. Adds an optional ILoggerFactory parameter for the warning. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * .NET: Address PR review feedback on GitHub Copilot approval hook - Build the approval-required tool-name HashSet directly instead of via an intermediate List. - Remove the redundant MEAI001 NoWarn suppression (tests already suppress it via .editorconfig and the source project builds clean without it). Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --------- Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> |
||
|
|
7749823393 |
.NET: Sample fix (#6773)
* Fixing some samples and sample verification. * Workaround for continuation token moved to sample. * Address PR review comments: reset _stdinEof on reuse, null-guard modelId, format - WorkflowRunner: reset _stdinEof=false at start of ExecuteAsync so reused instances don't exit immediately on the next external request - 04_memory: throw clear InvalidOperationException when DefaultModelId is null rather than silently sending null to the Foundry Responses API - dotnet format: no code changes, formatting only Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * Improving memory sample by not creating an agent just to get a chat client. --------- Co-authored-by: Ben Thomas <25218250+alliscode@users.noreply.github.com> Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> |
||
|
|
daac8c15f3 |
.NET: Prefer HTTPS backends in Aspire DevUI (#6772)
Prefer allocated HTTPS endpoints when resolving Aspire DevUI backends and fall back to HTTP for existing services. Update the DevUI Aspire sample so WriterAgent exercises HTTPS redirection. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> |
||
|
|
231b35da55 |
.NET: Foundry hosted-agent toolbox OAuth consent support (#6718)
* .NET: Foundry hosted-agent toolbox OAuth consent support Add per-user OAuth (MCP CONSENT_REQUIRED) support for Foundry hosted agents. * Defer hard toolbox startup failures so a per-user OAuth-gated toolbox no longer bricks the container at startup (new Degraded status, retried per request). The container stays routable and surfaces consent on the first user request. * Emit the platform-canonical oauth_consent_request output item (instead of mcp_approval_request) for toolbox OAuth consent, matching the Python implementation and how the Foundry platform heads render consent. * Parse the toolbox CONSENT_REQUIRED (-32006) error and surface the consent link; resume by re-sending the prompt with no reply item needed. * Add the Hosted-Toolbox-AuthPaths OAuth consent REPL client sample that detects oauth_consent_request, prints the consent link, and re-sends. * Add tests for the consent parser, startup deferral, and oauth_consent_request emission. Fixes #6562 * .NET: Address review feedback on toolbox OAuth consent * Make RecomputeStatus the single source that refreshes ConsentRequiredToolboxNames from the pending-consent set, so a per-request marker that records consent via GetToolboxToolsAsync no longer leaves ConsentRequiredToolboxNames stale (which made ResolvePendingConsentsAsync skip surfacing it). * Surface lazy / per-request marker consent in the same request: after resolving markers the handler now emits oauth_consent_request + incomplete when a marker hit CONSENT_REQUIRED, instead of silently running without that toolbox. * Add FoundryToolboxService.GetPendingConsents() snapshot accessor. * Fix stale ToolboxConsentParser doc comment (mcp_approval_request -> oauth_consent_request). * .NET: Harden toolbox consent paths from code review * Thread-safety: GetPendingConsents() now returns an immutable snapshot rebuilt in RecomputeStatus under the lock, instead of enumerating the live _pendingConsents dictionary off-lock (which could throw under concurrent requests). * Resource leak: OpenToolboxAsync builds the endpoint Uri before allocating the HttpClient and now disposes the HttpClient when McpClient.CreateAsync throws (the unreachable/deferred case retried per request), not only when ListToolsAsync fails. * StrictMode now gates on the pre-registered ToolboxNames set rather than the opened-toolbox cache, so a registered-but-deferred toolbox is no longer rejected as unknown. * Sample REPL: the legacy approval-args consent fallback only reads the explicit consent_url key, so a normal function-tool approval carrying a URL argument is not misread as an OAuth consent request. * .NET: Scope per-request toolbox marker consent to the request Addresses review feedback that a marker-originated toolbox could leak into global scope after consent. GetToolboxToolsAsync now returns a request-scoped ToolboxResolution (tools or consent requirements) instead of recording marker consent in the container-global _pendingConsents and appending resolved tools to the service-wide Tools list. * Marker consent is surfaced as oauth_consent_request for the requesting turn only and collected in the handler's marker loop; it no longer injects tools into, or raises a consent prompt on, a later request that did not reference the marker. * Marker resolution no longer flips the container StartupStatus to ConsentRequired (per-request markers must not affect readiness, per the StartupStatus contract). * Remove the now-unused GetPendingConsents()/snapshot path; _pendingConsents is once again exclusively the pre-registered/startup consent set. * .NET: Add consent request-scoping UTs and an OAuth consent integration test Unit tests (Microsoft.Agents.AI.Foundry.Hosting.UnitTests): * New FoundryToolboxMarkerScopingTests proves per-request marker resolution is request-scoped: a marker consent is returned to the caller without mutating ConsentRequiredToolboxNames, StartupStatus, or the service-wide Tools cache, and marker-resolved tools are returned to the caller rather than injected globally (so a request with no marker sees neither the tools nor the consent). * Adds a test-only ToolboxOpener seam on FoundryToolboxService so the consent/tools resolution can be exercised without a live MCP proxy. Makes ToolboxOpenResult and CachedToolbox internal (CachedToolbox.Client nullable, guarded at dispose). Integration test (Foundry.Hosting.IntegrationTests): * New toolbox-oauth-consent scenario wired into the TestContainer (pre-registers a Foundry toolbox via AddFoundryToolboxes from IT_TOOLBOX_NAME), a ToolboxOAuthConsentHostedAgentFixture, and a ToolboxOAuthConsentHostedAgentTests that invokes the deployed agent and asserts the consumer captures an oauth_consent_request consent link (container stays routable, no 424). Skipped by default per the IT convention; documents the consent-gated toolbox prerequisite. * Adds the scenario to it-bootstrap-agents.ps1 and the README scenario table. |
||
|
|
e3b64fdc47 |
.NET: [BREAKING] Make all AgentSkillsProvider tools require approval by default (#6729)
* Make all AgentSkillsProvider tools require approval by default - Wrap all tools (load_skill, read_skill_resource, run_skill_script) with ApprovalRequiredAIFunction unconditionally - Add ReadOnlyToolsAutoApprovalRule and AllToolsAutoApprovalRule static properties following the FileAccessProvider pattern - Remove ScriptApproval from AgentSkillsProviderOptions and UseScriptApproval from AgentSkillsProviderBuilder - Add Agent_Step07_SkillsAutoApproval sample Closes #6727 Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * Add UseToolApproval to hosted AgentSkills scenarios Wire AllToolsAutoApprovalRule into the integration test container and the Hosted-AgentSkills sample so skill tools execute without blocking on approval when no interactive approval handler is configured. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * Add API compatibility suppressions for removed ScriptApproval members Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --------- Co-authored-by: SergeyMenshykh <SergeMenshikh@outlook.com> Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> |
||
|
|
3a5bbb5f8e |
.NET: Add DeclarativeWorkflowJsonOptions for AOT-safe declarative workflow checkpointing (#6745)
* Add experimental DeclarativeWorkflowJsonOptions for AOT-safe declarative workflow checkpointing * Address PR comments |
||
|
|
336a19fd32 |
.NET: .NET samples: migrate coding samples to Foundry-first AIProjectClient (#6557)
* Migrate 02-agents/Agents samples to AIProjectClient (Foundry) Replace AzureOpenAIClient with AIProjectClient as the AI provider in all 02-agents/Agents samples, aligning with the Foundry-first approach. Changes: - 19 Program.cs files migrated to use AIProjectClient.AsAIAgent() - 19 .csproj files updated (Azure.AI.OpenAI -> Microsoft.Agents.AI.Foundry) - Environment variables: AZURE_OPENAI_* -> FOUNDRY_PROJECT_ENDPOINT/FOUNDRY_MODEL - Updated description comments to reflect Foundry backend - Provider-specific samples in AgentsWithFoundry/ intentionally unchanged Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * Migrate 02-agents/AgentSkills, AgentWithMemory, AgentWithRAG, AgentOpenTelemetry to AIProjectClient Replace AzureOpenAIClient with AIProjectClient as the AI provider. Environment variables: AZURE_OPENAI_* -> FOUNDRY_PROJECT_ENDPOINT/FOUNDRY_MODEL. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * Migrate 03-workflows samples to AIProjectClient (Foundry) Replace AzureOpenAIClient with AIProjectClient as the AI provider in all 03-workflows samples that use an AI model. Environment variables: AZURE_OPENAI_* -> FOUNDRY_PROJECT_ENDPOINT/FOUNDRY_MODEL. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * Fix PR 6557 build breaks and align Foundry client usage - Add explicit Azure.Identity package references to migrated sample projects that use DefaultAzureCredential - Fix AgentWithRAG_Step05_Neo4jGraphRAG to use AIProjectClient.AsAIAgent() with ChatOptions.ModelId instead of AIProjectClient.AsIChatClient() - Keep migrated samples on AIProjectClient pattern (no FoundryAgent/AzureOpenAIClient) Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * Address PR 6557 Foundry review follow-ups Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * Fix post-rebase sample build and format regressions Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * Updates to fix issues from switching to Responses. * Fixing more tests and deleting checkpoint directories created for samples. * Fixing formatting * Restore DefaultAzureCredential warnings in agents samples Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --------- Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> |
||
|
|
a9e5f6d798 |
.NET: .NET Foundry: add CreateMcpTool projectConnectionId overload (#6703)
* .NET Foundry: add CreateMcpTool projectConnectionId overload Adds FoundryAITool.CreateMcpTool(serverLabel, serverUri, projectConnectionId, ...) so hosted MCP tools can authenticate through a Foundry project connection, matching the Python FoundryChatClient.get_mcp_tool(..., project_connection_id=...) factory. The connection id is applied via the McpTool.ProjectConnectionId extension that ships in Azure.AI.Projects.Agents (patches project_connection_id), already referenced by the Foundry package. Includes unit tests and sample/README guidance plus the existing FromResponseTool workaround. * Fold projectConnectionId into existing CreateMcpTool overload Replaces the separate project-connection overload with an optional projectConnectionId parameter on the existing serverUri CreateMcpTool, so all settings (authorizationToken, headers, allowedTools, ...) stay available and there is no positional overload ambiguity. Adds tests for the default (no connection) path and for preserving other settings. Sample/README now show only the supported overload. |
||
|
|
15df1152fc |
.NET: Add sample for per-run refreshable MCP authentication headers (#6624)
* Add sample for per-run refreshable MCP authentication headers Adds a Foundry RAPI sample that attaches per-run, refreshable authentication headers to MCP requests using existing primitives: a DelegatingHandler on the MCP transport's HttpClient plus an AsyncLocal run scope. The same agent runs under two contexts, each minting a fresh token, proving the header is per run rather than bound at agent or connection creation time. The handler attaches the bearer only over HTTPS to the MCP server's own origin, logs the non-secret label only, disables cookies, and checks certificate revocation. The README covers security considerations and production notes. Fixes #1631 * Address PR review: harden redirect handling, nest-safe scope, README env vars Disable AllowAutoRedirect on the shared handler so a redirect cannot carry the bearer past the origin check. Save and restore the prior run scope instead of clearing to null so the helper is safe under nesting. Note the Foundry env vars in the samples folder README row and update the sample README security notes. |
||
|
|
88f0b23fb0 |
.NET: Change A2A default session store to NoopAgentSessionStore (#6635)
* Change A2A default session store to NoopAgentSessionStore Align the A2A hosting layer default session store with the AG-UI sibling by using NoopAgentSessionStore, making persistence an explicit opt-in choice. Update samples to document how to register a persistent session store for multi-turn conversations. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * Clarify test name to specify session store default Rename test to FallsBackToNoopSessionStoreDefaultAsync to avoid implying all stores default to noop (task store still uses InMemory). Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --------- Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> |
||
|
|
7b6f582b13 |
Python: Agent Harness blog post accompanying samples part 1 (#6605)
* Add samples for harness blog post part 1 * Add readme for python samples * Update python instructions to match dotnet instructions * Address PR comments * Add link to blog posts * Fix blog post naming. * Add more blog post links |
||
|
|
098e521586 |
.NET: Bring Hosted-Toolbox sample to parity with sibling hosting samples (#6633)
* Bring Hosted-Toolbox sample to parity with sibling hosting samples Adds the standard scaffolding files (.env.example, agent.yaml, agent.manifest.yaml, Dockerfile, Dockerfile.contributor) that every other 04-hosting Foundry sample ships but Hosted-Toolbox lacked. Fixes the toolbox name environment variable: reads TOOLBOX_NAME instead of the platform reserved FOUNDRY_TOOLBOX_NAME so it survives agent create, and aligns the default to my-toolset. Rewrites the README to the standard section layout with PowerShell fenced commands, and adds Using-Samples READMEs documenting why the client REPLs exist. Renames Azure AI Foundry to Foundry across the 04-hosting sample READMEs and comments for consistent product naming. * Address PR review: accurate docs and TOOLBOX_NAME in ToolboxMcpSkills - SimpleAgent README: correct the demo banner to the real per-agent URL the client prints (https scheme and the /api/projects/<project> segment). - Hosted-Toolbox Program.cs: move FOUNDRY_MODEL out of the Required block into Optional since it has a gpt-4o default and an AZURE_AI_MODEL_DEPLOYMENT_NAME fallback. - Hosted-ToolboxMcpSkills: switch the toolbox name from the reserved FOUNDRY_TOOLBOX_NAME to TOOLBOX_NAME across Program.cs, .env.example, agent.yaml, agent.manifest.yaml and README so it is deployable via the manifest, matching the other toolbox samples. |
||
|
|
89d19a2370 |
.NET: Migrate 01-get-started samples to Foundry as canonical default (#6555)
* Migrate 01-get-started samples to Foundry as canonical default Change canonical provider from Azure OpenAI to Microsoft Foundry Responses API: Code changes: - Updated all 01-get-started samples (01_hello_agent, 02_add_tools, 03_multi_turn, 04_memory, 06_host_your_agent) to use FoundryAgent or AIProjectClient.AsAIAgent() - Updated environment variables: AZURE_OPENAI_* → FOUNDRY_PROJECT_ENDPOINT/FOUNDRY_MODEL - Updated .csproj files to reference Microsoft.Agents.AI.Foundry instead of Azure.AI.OpenAI - Added warning comments about DefaultAzureCredential production usage - 05_first_workflow unchanged (workflow pattern only, no AI model) Documentation changes: - Updated AGENTS.md Default provider section to reflect Foundry as canonical - Updated code example to use FoundryAgent constructor pattern - Updated env var documentation Note: 04_memory (AIContextProvider sample) extracts IChatClient from FoundryAgent to maintain the memory pattern while using Foundry backend. All samples verified to build successfully. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * Address PR 6555 review feedback and format failures - Add Microsoft.Agents.AI.Foundry using to AGENTS.md Foundry snippet - Update verify-samples GetStarted env vars to FOUNDRY_PROJECT_ENDPOINT/FOUNDRY_MODEL - Remove unnecessary usings flagged by dotnet format in 01_get_started samples Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * Switch 01-get-started samples from FoundryAgent to AIProjectClient.AsAIAgent() Use AIProjectClient.AsAIAgent() as the canonical pattern for all 01-get-started samples. Reserve FoundryAgent only for samples that specifically demonstrate the Foundry-managed (prompt) agent — i.e. 02-agents/AgentsWithFoundry/. Changes: - 01_hello_agent, 02_add_tools, 03_multi_turn, 06_host_your_agent: swap FoundryAgent constructor for AIProjectClient.AsAIAgent(model, instructions) - 04_memory: get IChatClient via AIProjectClient.AsAIAgent(options).GetService() instead of extracting from a throwaway FoundryAgent - AGENTS.md: update default-provider snippet and note on when to use FoundryAgent Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --------- Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> |