Fixes Foundry Hosted Agents HTTP endpoints#16130
Conversation
|
🚀 Dogfood this PR with:
curl -fsSL https://raw.githubusercontent.com/microsoft/aspire/main/eng/scripts/get-aspire-cli-pr.sh | bash -s -- 16130Or
iex "& { $(irm https://raw.githubusercontent.com/microsoft/aspire/main/eng/scripts/get-aspire-cli-pr.ps1) } 16130" |
There was a problem hiding this comment.
Pull request overview
Updates the Foundry hosted-agent run-mode behavior to avoid endpoint conflicts when PublishAsHostedAgent is applied to resources that already define HTTP endpoints, and adds a new playground sample for hosted agents.
Changes:
- In run mode, removes existing HTTP/HTTPS endpoint annotations before adding the hosted-agent HTTP endpoint.
- Refactors publish-mode containerization to explicitly handle
ProjectResourcevsExecutableResource. - Adds a
playground/FoundryHostedAgentssample (AppHost + Python agent app scaffolding).
Reviewed changes
Copilot reviewed 11 out of 11 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| tests/Aspire.Hosting.Foundry.Tests/HostedAgentExtensionTests.cs | Adds tests asserting hosted-agent run-mode endpoint overwrite behavior and non-hardcoded port behavior. |
| src/Aspire.Hosting.Foundry/HostedAgent/HostedAgentBuilderExtension.cs | Implements endpoint removal in run mode and adjusts publish-mode containerization logic. |
| playground/FoundryHostedAgents/aspire.config.json | Adds Aspire config pointing to the new playground AppHost. |
| playground/FoundryHostedAgents/app/pyproject.toml | Adds Python agent sample dependencies/config. |
| playground/FoundryHostedAgents/app/main.py | Adds Python agent sample implementation. |
| playground/FoundryHostedAgents/app/.dockerignore | Adds Docker ignore rules for the Python sample. |
| playground/FoundryHostedAgents/FoundryHostedAgents.AppHost/appsettings.json | Adds logging configuration for the new AppHost sample. |
| playground/FoundryHostedAgents/FoundryHostedAgents.AppHost/appsettings.Development.json | Adds development Azure settings for the sample (currently includes specific identifiers). |
| playground/FoundryHostedAgents/FoundryHostedAgents.AppHost/Properties/launchSettings.json | Adds launch profiles for the new AppHost sample. |
| playground/FoundryHostedAgents/FoundryHostedAgents.AppHost/FoundryHostedAgents.AppHost.csproj | Adds a new AppHost project file for the playground sample. |
| playground/FoundryHostedAgents/FoundryHostedAgents.AppHost/AppHost.cs | Adds the new playground AppHost wiring for Foundry + Python hosted agent. |
…settings.Development.json Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
…m:tommasodotNET/aspire into fix/hosted-agent-overwrite-http-endpoints
…sion.cs Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
…m:tommasodotNET/aspire into fix/hosted-agent-overwrite-http-endpoints
|
UPDATE: instead of removing the existing endpoints, we can overwrite them. looks like a better solution. The fix still enables use with dotnet hosted agents (sample added). |
|
UPDATE: i've realized there are internal dependency issue when working with Foundry Hosted Agents on Microsoft Agent Framework packages. Looks like I found a sweet spot, so you may see strange MAF pckgs versions in the playground. |
…nclude IComputeResource
… ExecutableResource and ProjectResource
…m:tommasodotNET/aspire into fix/hosted-agent-overwrite-http-endpoints
…erwrite-http-endpoints
Description
Closes #16115. Overwrites existing http/https endpoints on resource to allow the creation of dedicated hosted agent endpoint. Does not hard code http port (letting aspire handle port assignment).
PublishAsHostedAgentaccepts generic resource with endpoint (e.g. ProjectResource) allowing hosted agents in dotnet (see also #15968).Allows for custom targetPorts to allow locally run multiple hosted agents
Adds a playground sample for hosted agents in python
Fixes # (issue)
Checklist
<remarks />and<code />elements on your triple slash comments?aspire.devissue: