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>
jongio
left a comment
There was a problem hiding this comment.
Prior findings addressed. Looks good.
|
jongio
left a comment
There was a problem hiding this comment.
Based on @huimiu's testing, the Skills and Routines services still require their V1Preview headers. Removing them causes 403 responses:
"This operation requires the following opt-in preview feature(s): Skills=V1Preview / Routines=V1Preview."
Agents and toolboxes are confirmed working without headers.
Action needed: Restore the Foundry-Features headers for azure.ai.skills and azure.ai.routines. Only the agents and toolboxes header removals should ship in this PR.
Skills and Routines APIs are still in preview, so keep their Foundry-Features V1Preview opt-in headers in place. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
jongio
left a comment
There was a problem hiding this comment.
Skills and routines preview headers restored correctly. Tests verify the header presence. Agents and toolboxes remain header-free as intended.
RickWinter
left a comment
There was a problem hiding this comment.
This removes the Foundry-Features: *=V1Preview opt-in headers (and their constants, helpers, and test assertions) from the agents and toolboxes extensions now that the hosted-agents, code-agents, and toolboxes APIs are GA. The change is a straightforward, mechanical deletion and the shape is correct: it drops the header set calls and the tests that asserted them, and the scope note correctly leaves the still-preview surfaces alone (AgentsOptimization=V2Preview, Skills=V1Preview, Routines=V1Preview).
The only correctness dependency is external: this is safe exactly when every endpoint these clients hit no longer gates on the header. That is an assertion about the deployed Foundry service that the diff itself can't prove, so it rests on the linked GA rollout. Nothing in the code needs to change. No inline comments, and nothing blocks.
Why
Foundry APIs for hosted agents, code agents, and toolboxes are now GA and no longer require the
Foundry-Features: *=V1Previewopt-in header. These headers were added during preview to gate access to those features. With GA, they are unnecessary and should be cleaned up.What changed
Removed all
Foundry-Featuresheader lines containing V1Preview values across 2 extensions (7 files total):HostedAgents=V1Preview,CodeAgents=V1Preview,HostedAgents=V1Preview, andToolboxes=V1Previewfromoperations.go,invoke.go, andfoundry_toolsets_client.goToolboxes=V1Previewfromfoundry_toolsets_client.goAssociated constants, helper functions, comments, and test assertions were also removed or updated.
Not in scope
AgentsOptimization=V2Previewinoptimize_api/client.go-- different preview version for a feature that is not yet GA.Skills=V1Previewinazure.ai.skills-- Skills API is still in preview.Routines=V1Previewinazure.ai.routines-- Routines API is still in preview.Fixes: #8186