Update Foundry hosted agent builder APIs#17545
Open
tommasodotNET wants to merge 5 commits into
Open
Conversation
Contributor
|
🚀 Dogfood this PR with:
curl -fsSL https://raw.githubusercontent.com/microsoft/aspire/main/eng/scripts/get-aspire-cli-pr.sh | bash -s -- 17545Or
iex "& { $(irm https://raw.githubusercontent.com/microsoft/aspire/main/eng/scripts/get-aspire-cli-pr.ps1) } 17545" |
Contributor
There was a problem hiding this comment.
Pull request overview
Splits the Foundry hosted-agent builder API so that run-mode endpoint/command/OTEL wiring is opted into via a new AsHostedAgent() method, while WithComputeEnvironment(...) is reduced to publish-mode Foundry compute environment setup only. Updates polyglot exports, tests, and playgrounds to use the new shape.
Changes:
- Introduces
AsHostedAgent<T>()containing the prior run-mode wiring (HTTP endpoint, Responses URL, Send Message command, OTEL env vars); removes the liveness/readiness probe URLs andWithHttpHealthCheck("/liveness")it previously added. - Limits both
WithComputeEnvironment<T>overloads to publish-mode behavior only (creates/locates the Foundry project, wiresAzureHostedAgentResource+DeploymentTargetAnnotation). - Updates API surface (
Aspire.Hosting.Foundry.cs,*.ats.txt), polyglot apphosts, playgrounds, deployment E2E test, and unit tests to chain.AsHostedAgent()before.WithComputeEnvironment(...).
Reviewed changes
Copilot reviewed 10 out of 10 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| src/Aspire.Hosting.Foundry/HostedAgent/HostedAgentBuilderExtension.cs | Splits previous combined extension into publish-only WithComputeEnvironment and new run-only AsHostedAgent; drops liveness/readiness URL annotations and health check. |
| src/Aspire.Hosting.Foundry/api/Aspire.Hosting.Foundry.cs | Adds AsHostedAgent<T> to public API ref. |
| src/Aspire.Hosting.Foundry/api/Aspire.Hosting.Foundry.ats.txt | Adds asHostedAgent() and withComputeEnvironmentExecutable(...) polyglot export entries. |
| tests/Aspire.Hosting.Foundry.Tests/HostedAgentExtensionTests.cs | Renames/updates run-mode tests to call AsHostedAgent(); replaces health-check assertion with Send Message command assertion. |
| tests/Aspire.Deployment.EndToEnd.Tests/FoundryHostedAgentDeploymentTests.cs | Chains .AsHostedAgent() before .WithComputeEnvironment(...). |
| tests/PolyglotAppHosts/Aspire.Hosting.Foundry/TypeScript/apphost.mts | Adds await hostedAgent.asHostedAgent(); in the polyglot scenario. |
| tests/PolyglotAppHosts/Aspire.Hosting.Foundry/Java/AppHost.java | Adds hostedAgent.asHostedAgent(); call. |
| tests/PolyglotAppHosts/Aspire.Hosting.Foundry/Go/apphost.go | Adds hostedAgent.AsHostedAgent() call. |
| playground/FoundryAgents/FoundryAgents.AppHost/AppHost.cs | Inserts .AsHostedAgent() before .WithComputeEnvironment(project) on both hosted agents. |
| playground/FoundryAgentEnterprise/FoundryAgentEnterprise.AppHost/AppHost.cs | Inserts .AsHostedAgent() in the enterprise playground apphost. |
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.
Description
Updates the Foundry hosted agent builder APIs so run-mode hosted agent endpoint and command configuration can be applied separately from publish-mode compute environment setup.
User-facing usage
Consumers now opt a compute resource into the local run-mode hosted agent experience with
AsHostedAgent()and configure the publish-mode Foundry deployment withWithComputeEnvironment(...):WithComputeEnvironment(...)keeps the publish-mode hosted agent deployment wiring focused on Azure Foundry compute environment setup.Validation:
Focused polyglot validation with the repo CLI:
Java compile validation was not run locally because the available JDK is 17 and the validation script requires
javac --source 25.Fixes # (issue)
Checklist
<remarks />and<code />elements on your triple slash comments?