.NET: Add Anthropic-backed live tests for the OpenAI Responses hosting helpers - #7362
Merged
rogerbarreto merged 2 commits intoJul 28, 2026
Merged
Conversation
…lpers Mirrors OpenAIResponsesHostingLiveTests with the hosted agent backed by an Anthropic chat client, confirming the app-owned hosting helper surface (OpenAIResponses + AgentSessionStore) is provider-agnostic end to end. Skipped unless ANTHROPIC_API_KEY is configured. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Contributor
Author
|
@microsoft-github-policy-service agree |
rogerbarreto
approved these changes
Jul 28, 2026
SergeyMenshykh
approved these changes
Jul 28, 2026
peibekwe
approved these changes
Jul 28, 2026
ANcpLua
added a commit
to ANcpLua/DotNetTests
that referenced
this pull request
Jul 28, 2026
The Anthropic-backed Responses-hosting live tests existed in three places at once. Two of them are better than this one: - microsoft/agent-framework#7362 folds the same two tests into the existing Microsoft.Agents.AI.Hosting.OpenAI.IntegrationTests project, next to the OpenAI variant they mirror, using upstream's injected TestSettings and the cheap claude-haiku-4-5 default. Approved, CI green. - ANcpLua/TUnit-1.61.38 carries the TUnit port, which is the live .NET testing reference for the workspace. This copy was the weakest of the three: xUnit v3 on a parked repo, with TestSettings vendored as a trimmed subset of upstream's shared file, and four package references carried solely for it. DotNetTests keeps its value as the six-way framework comparison; it does not need a third copy of these tests. Suite is 10/10 green after the removal. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
ANcpLua
added a commit
to ANcpLua/TUnit-1.61.38
that referenced
this pull request
Jul 28, 2026
…onical copy These two live tests (non-streaming Responses render, multi-turn session continuity over AgentSessionStore, both Anthropic-backed) existed in three places at once. The upstream one is better than either local copy: - It sits in Microsoft.Agents.AI.Hosting.OpenAI.IntegrationTests, directly beside the OpenAI variant it mirrors, so the provider-agnostic claim about the Responses hosting surface is visible as a pair rather than asserted in a fork. - It uses upstream's MSBuild-injected TestSettings instead of a vendored trim of it, and defaults to claude-haiku-4-5 rather than claude-opus-5. - It is a two-file diff against upstream, approved with CI green. This copy carried the whole Microsoft.Agents.AI + Anthropic + Hosting + Hosting.OpenAI package set into a test-patterns playground for one folder, and the vendored TestSettings could only ever drift from the real one. AdvancedPatterns keeps the five deterministic pattern folders it is actually for; the live-service exception belongs upstream. Suite is 10/10 green after the removal. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
rogerbarreto
enabled auto-merge
July 28, 2026 20:53
ANcpLua
added a commit
to ANcpLua/TUnit-1.61.38
that referenced
this pull request
Jul 30, 2026
…contained copy Alex restored the two Anthropic-backed live tests (Responses render, session continuity) alongside the upstream microsoft/agent-framework#7362 copy. Build clean; suite 12 tests: 10 pass, 2 live tests skip without ANTHROPIC_API_KEY. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This was referenced Jul 30, 2026
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Motivation & Context
#7000 introduced the app-owned hosting helper surface (
OpenAIResponsesplusAgentSessionStore) and covered it with an OpenAI-backed live test (OpenAIResponsesHostingLiveTests). The helper surface is provider-agnostic by design, but no test currently exercises it with a non-OpenAI backend. This PR adds the Anthropic-backed variant so the same consumption paths are confirmed end to end against a second provider.Description & Review Guide
AnthropicResponsesHostingLiveTeststo the existingMicrosoft.Agents.AI.Hosting.OpenAI.IntegrationTestsproject, mirroringOpenAIResponsesHostingLiveTests: request conversion, an agent run, Responses-shaped rendering, and multi-turn session continuity. The hosted agent is built withAnthropicClient.AsAIAgent(...)fromMicrosoft.Agents.AI.Anthropic.ProjectReference(Microsoft.Agents.AI.Anthropic) added to the test project. No production code or public API changes.Assert.SkipWhenunlessANTHROPIC_API_KEYis configured — the same pattern as the OpenAI-backed variant andAnthropicChatCompletion.IntegrationTests— so CI runs without the secret stay green. Verified locally against the live API: 2/2 pass on net10.0. The default model isclaude-haiku-4-5(matching the Anthropic samples), overridable viaANTHROPIC_CHAT_MODEL_NAME.Related Issue
N/A — small test-only addition; no new APIs or behavior changes.
Contribution Checklist
🤖 Generated with Claude Code