Restore hosted agent ATS compatibility - #18980
Conversation
Keep the original asHostedAgent export with Responses 2.0.0 defaults and expose explicit protocol selection through a distinct capability. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: c8bf16f9-3a59-4062-bd20-818fb4e70df9
|
🚀 Dogfood this PR with:
curl -fsSL https://raw.githubusercontent.com/microsoft/aspire/main/eng/scripts/get-aspire-cli-pr.sh | bash -s -- 18980Or
iex "& { $(irm https://raw.githubusercontent.com/microsoft/aspire/main/eng/scripts/get-aspire-cli-pr.ps1) } 18980" |
This comment has been minimized.
This comment has been minimized.
There was a problem hiding this comment.
Pull request overview
Restores ATS compatibility for Foundry hosted agents while retaining explicit protocol selection.
Changes:
- Restores default Responses 2.0.0 polyglot calls.
- Adds
asHostedAgentWithProtocol. - Exercises both APIs across four polyglot AppHosts.
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
src/Aspire.Hosting.Foundry/HostedAgent/HostedAgentBuilderExtension.cs |
Adds distinct compatibility and explicit-protocol ATS adapters. |
tests/Aspire.Hosting.Foundry.Tests/HostedAgentExtensionTests.cs |
Updates adapter tests; restored path needs focused regression coverage. |
tests/PolyglotAppHosts/Aspire.Hosting.Foundry/TypeScript/apphost.mts |
Validates both generated TypeScript methods. |
tests/PolyglotAppHosts/Aspire.Hosting.Foundry/Python/apphost.py |
Validates both generated Python methods. |
tests/PolyglotAppHosts/Aspire.Hosting.Foundry/Go/apphost.go |
Validates both generated Go methods. |
tests/PolyglotAppHosts/Aspire.Hosting.Foundry/Java/AppHost.java |
Validates both generated Java methods. |
Add direct behavior coverage for legacy defaults and option application. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: c8bf16f9-3a59-4062-bd20-818fb4e70df9
This comment has been minimized.
This comment has been minimized.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 6 out of 6 changed files in this pull request and generated 4 comments.
Suppressed comments (2)
src/Aspire.Hosting.Foundry/HostedAgent/HostedAgentBuilderExtension.cs:134
- Restoring the defaulted polyglot entry point makes the existing public overload documentation at lines 80–83 inaccurate: it still says polyglot hosts must declare the protocol and version explicitly. Update those remarks and the
AspireExportIgnorereason to describeasHostedAgentas the defaulted form andasHostedAgentWithProtocolas the explicit form.
this IResourceBuilder<T> builder,
IResourceBuilder<AzureCognitiveServicesProjectResource> project,
HostedAgentOptions? options = null)
src/Aspire.Hosting.Foundry/HostedAgent/HostedAgentBuilderExtension.cs:160
- This export adds a new user-facing generated-SDK capability, but the PR checklist says no public API was added. Mark the public-API item as Yes and record the ATS API review for this additive method so the PR metadata matches the change.
[AspireExport("asHostedAgentWithProtocol")]
Give the explicit-protocol hosted agent a distinct HTTP target port in every polyglot validation AppHost. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: c8bf16f9-3a59-4062-bd20-818fb4e70df9
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 6 out of 6 changed files in this pull request and generated no new comments.
Suppressed comments (1)
src/Aspire.Hosting.Foundry/HostedAgent/HostedAgentBuilderExtension.cs:134
- Restoring this defaulted ATS adapter makes the public
AsHostedAgent(project, configure)documentation at lines 80–83 stale: it still says polyglot hosts must supply protocol and version explicitly, and theAspireExportIgnorereason repeats that claim. Update those remarks/reason to explain that the callback overload is replaced by the options DTO for polyglot callers, whileasHostedAgentWithProtocolis the explicit-protocol alternative.
this IResourceBuilder<T> builder,
IResourceBuilder<AzureCognitiveServicesProjectResource> project,
HostedAgentOptions? options = null)
This comment has been minimized.
This comment has been minimized.
|
Retrying the failed CI jobs for this pull request from the CI run attempt. The rerun is being tracked in the rerun attempt. |
James Newton-King (JamesNK)
left a comment
There was a problem hiding this comment.
1 documentation accuracy issue found. The implementation and regression coverage otherwise look correct; local Aspire.Hosting.Foundry.Tests passed 118/118 and the relevant CI checks are passing.
Document the defaulted and explicit protocol ATS entry points consistently. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: c8bf16f9-3a59-4062-bd20-818fb4e70df9
Tests selector (audit mode)The full test matrix and all jobs still run in audit mode. The tests and jobs below are what selective CI would run under enforcement. 3 / 100 test projects · 3 jobs, from 6 changed files. Selected test projects (3 / 100)
Selected jobs (3)
How these were chosen — grouped by what changed🔧 🧪 Job reasons
Selection computed for commit |
|
Retrying the failed CI jobs for this pull request from the CI run attempt. The rerun is being tracked in the rerun attempt. |
|
Documentation was required (signal: See the workflow run for details: https://github.com/microsoft/aspire/actions/runs/30932312207 |
Description
Restores the shipped polyglot
asHostedAgent(project, options?)capability so existing AppHosts continue to use the Responses protocol version 2.0.0 defaults. The explicit protocol form is now exposed as the additiveasHostedAgentWithProtocolcapability instead of replacing the existing signature.The two ATS adapters use distinct internal CLR names and capability IDs, preserving the existing public C# overloads without introducing overload ambiguity. TypeScript, Python, Go, and Java validation AppHosts exercise both generated methods.
Related reviews:
User-facing usage
C# callers continue to use the existing overloads:
Polyglot callers can retain the existing defaulted form or opt into explicit protocol selection:
Validation:
Aspire.Hosting.Foundrywith integration analyzers enabled.Aspire.Hosting.Foundry.Tests.Fixes # (issue)
Checklist
<remarks />and<code />elements on your triple slash comments?