Remove Foundry-Features V1Preview headers for GA#8866
Conversation
Foundry APIs are now GA and no longer require the preview opt-in header. Remove all Foundry-Features header lines containing V1Preview values across extensions: - azure.ai.agents: HostedAgents=V1Preview, CodeAgents=V1Preview, Toolboxes=V1Preview - azure.ai.routines: Routines=V1Preview - azure.ai.skills: Skills=V1Preview - azure.ai.toolboxes: Toolboxes=V1Preview The AgentsOptimization=V2Preview header in optimize_api is intentionally left in place as it uses a different preview version. Fixes #8186 Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
📋 Prioritization NoteThanks for the contribution! The linked issue isn't in the current milestone yet. |
There was a problem hiding this comment.
Pull request overview
This PR removes the Foundry-Features: *=V1Preview opt-in headers from multiple Foundry data-plane clients across azd’s first-party Azure AI extensions now that the corresponding Foundry APIs are GA (Fixes #8186).
Changes:
- Removed
Foundry-FeaturesV1Preview header injection from the Toolboxes, Skills, Routines, and Agents extension clients. - Removed related preview constants/helpers and updated inline comments accordingly.
- Updated unit tests to stop asserting presence of the removed preview headers.
Reviewed changes
Copilot reviewed 11 out of 11 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| cli/azd/extensions/azure.ai.toolboxes/internal/pkg/azure/foundry_toolsets_client.go | Stops sending the Toolboxes V1Preview opt-in header on requests. |
| cli/azd/extensions/azure.ai.skills/internal/pkg/skill_api/client.go | Removes Skills preview header constants and no longer sets the preview opt-in header. |
| cli/azd/extensions/azure.ai.skills/internal/pkg/skill_api/client_test.go | Updates tests to stop asserting the removed Skills preview header. |
| cli/azd/extensions/azure.ai.routines/internal/pkg/routines/client.go | Removes Routines preview header constants/helper and no longer sends the preview header. |
| cli/azd/extensions/azure.ai.routines/internal/pkg/routines/client_test.go | Updates tests to stop asserting the removed Routines preview header. |
| cli/azd/extensions/azure.ai.agents/internal/pkg/azure/foundry_toolsets_client.go | Stops sending the Toolboxes V1Preview opt-in header in agents toolbox client calls. |
| cli/azd/extensions/azure.ai.agents/internal/pkg/azure/foundry_toolsets_client_test.go | Updates tests to stop asserting the removed Toolboxes preview header. |
| cli/azd/extensions/azure.ai.agents/internal/pkg/agents/agent_api/operations.go | Removes HostedAgents/CodeAgents V1Preview header usage across agent operations. |
| cli/azd/extensions/azure.ai.agents/internal/pkg/agents/agent_api/operations_test.go | Updates tests to stop asserting preview header behavior for agent operations. |
| cli/azd/extensions/azure.ai.agents/internal/cmd/invoke.go | Stops sending HostedAgents V1Preview opt-in header in remote invoke flows. |
| cli/azd/extensions/azure.ai.agents/internal/cmd/invoke_test.go | Updates tests to stop asserting the removed preview header in invoke-related requests. |
jongio
left a comment
There was a problem hiding this comment.
Clean removal of the V1Preview feature headers. The scope is well-defined, the AgentsOptimization=V2Preview exclusion is correctly justified, and the test assertions tracking these headers are removed alongside the production code.
One issue worth addressing: TestDownloadAgentCode_SetsFeatureHeader in operations_test.go is now an empty test body (just calls the function + NoError + Close). Its raison d'etre was the assertion you removed. Either delete it or repurpose it to verify something else about DownloadAgentCode that isn't already covered by TestDownloadAgentCode_ReturnsResponseHeaders.
Minor nit: the mechanical removal left a few double blank lines in operations.go (~line 364, ~975), oundry_toolsets_client.go (agents extension, ~lines 114, 160, 199), and client.go (routines, ~line 116). A quick goimports pass or manual cleanup would tidy those up.
- Run gofmt to fix extra blank lines left by mechanical removal - Delete TestDownloadAgentCode_SetsFeatureHeader (now empty after header assertion was removed; already covered by TestDownloadAgentCode_ReturnsResponseHeaders) Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Why
Foundry APIs are now GA and no longer require the
Foundry-Features: *=V1Previewopt-in header. These headers were added during preview to gate access to features like hosted agents, code agents, toolboxes, routines, and skills. With GA, they are unnecessary and should be cleaned up.What changed
Removed all
Foundry-Featuresheader lines containing V1Preview values across 4 extensions (11 files total):HostedAgents=V1Preview,CodeAgents=V1Preview,HostedAgents=V1Preview, andToolboxes=V1Previewfromoperations.go,invoke.go, andfoundry_toolsets_client.goRoutines=V1Previewfromclient.goSkills=V1Previewfromclient.goToolboxes=V1Previewfromfoundry_toolsets_client.goAssociated constants, helper functions (
addPreviewHeader, updatedaddStandardHeaders), and test assertions were also removed or updated.Not in scope
AgentsOptimization=V2Previewinoptimize_api/client.gois intentionally left in place -- it uses a different preview version for a feature that is not yet GA.Fixes: #8186