Skip to content

feat: gate Foundry agent previews independently - #10640

Merged
Hui Miao (huimiu) merged 30 commits into
mainfrom
hui/foundry-feature-flags-hosted-agent
Oct 23, 2026
Merged

Hui Miao (huimiu) merged 30 commits into
mainfrom
hui/foundry-feature-flags-hosted-agent

Conversation

@huimiu

@huimiu Hui Miao (huimiu) commented Oct 20, 2026 •

Copy link
Copy Markdown
Member

Summary

Require separate opt-ins for managed harness, voice, and long-running invocation in the Foundry agents extension. All three previews are off by default. Ordinary hosted and plain prompt agents work without an opt-in.

The checks use the process-only flags from #10683 and stay inside the agents extension, without SDK or core API changes.

Fixes #10659

Changes

Feature ID Gated capability Process environment variable
agents.managed_harness Prompt agents using microsoft_copilot_preview or legacy github_copilot_preview AZD_ALPHA_ENABLE_AGENTS_MANAGED_HARNESS
agents.voice Voice / prompt-voice agents and hosted voice bridges advertising invocations_ws AZD_ALPHA_ENABLE_AGENTS_VOICE
agents.long_running Starting background Responses invocations with --long-running / --no-wait AZD_ALPHA_ENABLE_AGENTS_LONG_RUNNING
  • Check explicit inputs and selected agent definitions in init, invocation, optimization, endpoint updates, and package/publish/deploy. Apply the same checks to inline definitions, $ref files, staged templates, and lifecycle hooks.
  • Reject disabled explicit inputs before avoidable authentication or project writes. Keep argument validation first and use Responses as the --no-prompt default.
  • Hide disabled preview options in help and init pickers. Root help still lists all switches; metadata and shell completion keep the full command tree.
  • Keep show, endpoint discovery, invocation show/follow/cancel, delete, and down available with flags off.
  • Add regression coverage for independent opt-ins, early validation, init, and read/cleanup paths. Update help snapshots, docs, and five scenario definitions.

Compatibility

Set the matching variable to true before running azd. The evaluator uses strconv.ParseBool; false, missing, empty, and invalid values leave the feature off. The old AZD_FOUNDRY_EXT_ENABLE_* variables and config keys such as alpha.<ID> and alpha.all do not enable these previews. Core alpha behavior is unchanged.

The evaluator reads only the process environment. Values azd injects from the selected environment count and can override the same variable inherited from the shell. The evaluator does not load config or environment files itself.

Validation

Passed with Go 1.26.4:

  • go test ./internal/featureflags ./internal/project ./internal/cmd -count=1
  • go build ./... in the agents module
  • go vet ./internal/featureflags ./internal/project ./internal/cmd

Scoped golangci-lint, formatting, whitespace, and spelling checks also passed. The five scenario files passed parsing and structural checks. The scenario runner was unavailable, so those scenarios were not run.

E2E

Scenario Expected Result
azd ai agent init --help with all preview flags off Hides --voice, prompt-voice, and harness surfaces Pass
azd ai agent invoke --help with all preview flags off Hides --long-running, --no-wait, and voice sections Pass
azd ai agent init --kind prompt-voice or init --voice with flags off Refuses with agents.voice Pass
azd ai agent init --kind prompt --harness microsoft_copilot_preview with flags off Refuses with agents.managed_harness Pass
azd ai agent invoke --long-running with flags off Refuses with agents.long_running Pass
AZD_ALPHA_ENABLE_AGENTS_VOICE=true alone, then init --help Voice surfaces return. Harness and long-running still refuse Pass
AZD_ALPHA_ENABLE_AGENTS_MANAGED_HARNESS=true alone, then harness init Passes the harness gate. Voice and long-running still refuse Pass
AZD_ALPHA_ENABLE_AGENTS_LONG_RUNNING=true alone, then invoke --help Shows --long-running and --no-wait. Voice stays hidden Pass
azd ai agent --help Still lists Preview Feature Switches and the three AZD_ALPHA_ENABLE_* keys Pass
Agents list-alpha Not present on this head N/A
Image Image Image Image

Enforcement limits

  • Calls using an explicit HTTP --agent-endpoint do not look up the remote definition, so they cannot enforce the managed-harness flag. The long-running check still applies. Text invoke does not accept voice WebSocket endpoints.
  • Template catalogs do not include capability metadata. Templates remain visible, but their staged definitions are checked before adoption.
  • These checks do not intercept generic requests from evaluations or routines, and do not migrate saved state.

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
Successfully started running 1 pipeline(s).
25 pipeline(s) were filtered out due to trigger conditions.
There may be pipelines that require an authorized user to comment /azp run to run.

@github-actions github-actions Bot added ext-agents azure.ai.agents extension ext-foundry microsoft.foundry meta package or Foundry/AI extensions overall. Not individual extension issues. labels Oct 20, 2026
@huimiu
Hui Miao (huimiu) added this pull request to stack #10646 October 21, 2026 02:27
@huimiu
Hui Miao (huimiu) force-pushed the hui/foundry-feature-flags-hosted-agent branch from 2643837 to 5b8acda Compare October 21, 2026 03:12
@huimiu
Hui Miao (huimiu) removed this pull request from stack #10646 October 21, 2026 03:12
@huimiu
Hui Miao (huimiu) changed the base branch from hui/foundry-feature-flags-core to hui/foundry-shared-feature-access October 21, 2026 03:12
@huimiu
Hui Miao (huimiu) added this pull request to stack #10647 October 21, 2026 03:12
@huimiu Hui Miao (huimiu) changed the title feat: gate Hosted Agent path with IsFeatureEnabled feat: gate Hosted Agent path with extension feature flags Oct 21, 2026
@huimiu Hui Miao (huimiu) changed the title feat: gate Hosted Agent path with extension feature flags feat: gate Foundry agent previews independently Oct 21, 2026
@huimiu
Hui Miao (huimiu) removed this pull request from stack #10647 October 21, 2026 12:36
@huimiu
Hui Miao (huimiu) added this pull request to stack #10658 October 21, 2026 12:36
@huimiu
Hui Miao (huimiu) marked this pull request as ready for review October 21, 2026 14:16
Copilot AI lite review requested due to automatic review settings October 21, 2026 14:16

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔵 Needs a closer look

One or more issues must be addressed before approval.

No open issues 🎉

What changed in this PR

Adds independent opt-ins for managed harness, voice, and long-running Foundry agent features, including centralized enforcement and help visibility controls.

Changes:

  • Adds command, service, lifecycle, and definition-level feature gates.
  • Updates help output, README/spec documentation, and interactive scenarios.
  • Adds extensive unit, integration, and snapshot coverage.
File Description
cli/​azd/​extensions/​azure.ai.agents/​tests/​cli-interactive-tester-scenarios/​tier1/​1.10-init-harness-region-restrictions.yaml Updated as part of this pull request.
cli/​azd/​extensions/​azure.ai.agents/​tests/​cli-interactive-tester-scenarios/​tier0/​0.31-preview-help-visibility.yaml Updated as part of this pull request.
cli/​azd/​extensions/​azure.ai.agents/​tests/​cli-interactive-tester-scenarios/​tier0/​0.18-invoke-long-running-validation.yaml Updated as part of this pull request.
cli/​azd/​extensions/​azure.ai.agents/​tests/​cli-interactive-tester-scenarios/​tier0/​0.10-init-picker-navigation.yaml Updated as part of this pull request.
cli/​azd/​extensions/​azure.ai.agents/​tests/​cli-interactive-tester-scenarios/​tier0/​0.02-help-root.yaml Updated as part of this pull request.
cli/​azd/​extensions/​azure.ai.agents/​README.md Updated as part of this pull request.
cli/​azd/​extensions/​azure.ai.agents/​internal/​project/​service_target_agent.go Updated as part of this pull request.
cli/​azd/​extensions/​azure.ai.agents/​internal/​project/​service_target_agent_test.go Updated as part of this pull request.
cli/​azd/​extensions/​azure.ai.agents/​internal/​project/​preview_features.go Updated as part of this pull request.
cli/​azd/​extensions/​azure.ai.agents/​internal/​project/​preview_features_test.go Updated as part of this pull request.
cli/​azd/​extensions/​azure.ai.agents/​internal/​project/​deploy_precheck_test.go Updated as part of this pull request.
cli/​azd/​extensions/​azure.ai.agents/​internal/​featureflags/​agents.go Updated as part of this pull request.
cli/​azd/​extensions/​azure.ai.agents/​internal/​featureflags/​agents_test.go Updated as part of this pull request.
cli/​azd/​extensions/​azure.ai.agents/​internal/​exterrors/​codes.go Updated as part of this pull request.
cli/​azd/​extensions/​azure.ai.agents/​internal/​cmd/​testdata/​TestAgentHelpPreviewsOff-root.snap Updated as part of this pull request.
cli/​azd/​extensions/​azure.ai.agents/​internal/​cmd/​testdata/​TestAgentHelpPreviewsOff-invoke.snap Updated as part of this pull request.
cli/​azd/​extensions/​azure.ai.agents/​internal/​cmd/​testdata/​TestAgentHelpPreviewsOff-init.snap Updated as part of this pull request.
cli/​azd/​extensions/​azure.ai.agents/​internal/​cmd/​run.go Updated as part of this pull request.
cli/​azd/​extensions/​azure.ai.agents/​internal/​cmd/​root.go Updated as part of this pull request.
cli/​azd/​extensions/​azure.ai.agents/​internal/​cmd/​root_test.go Updated as part of this pull request.
cli/​azd/​extensions/​azure.ai.agents/​internal/​cmd/​preview_features.go Updated as part of this pull request.
cli/​azd/​extensions/​azure.ai.agents/​internal/​cmd/​preview_features_test.go Updated as part of this pull request.
cli/​azd/​extensions/​azure.ai.agents/​internal/​cmd/​preview_central_test.go Updated as part of this pull request.
cli/​azd/​extensions/​azure.ai.agents/​internal/​cmd/​optimize.go Updated as part of this pull request.
cli/​azd/​extensions/​azure.ai.agents/​internal/​cmd/​optimize_deploy.go Updated as part of this pull request.
cli/​azd/​extensions/​azure.ai.agents/​internal/​cmd/​listen.go Updated as part of this pull request.
cli/​azd/​extensions/​azure.ai.agents/​internal/​cmd/​invoke.go Updated as part of this pull request.
cli/​azd/​extensions/​azure.ai.agents/​internal/​cmd/​invoke_voice_test.go Updated as part of this pull request.
cli/​azd/​extensions/​azure.ai.agents/​internal/​cmd/​invoke_usage_test.go Updated as part of this pull request.
cli/​azd/​extensions/​azure.ai.agents/​internal/​cmd/​invoke_usage_grpc_test.go Updated as part of this pull request.
cli/​azd/​extensions/​azure.ai.agents/​internal/​cmd/​invoke_latency_test.go Updated as part of this pull request.
cli/​azd/​extensions/​azure.ai.agents/​internal/​cmd/​invocations.go Updated as part of this pull request.
cli/​azd/​extensions/​azure.ai.agents/​internal/​cmd/​init.go Updated as part of this pull request.
cli/​azd/​extensions/​azure.ai.agents/​internal/​cmd/​init_voice_flag_test.go Updated as part of this pull request.
cli/​azd/​extensions/​azure.ai.agents/​internal/​cmd/​init_from_templates_helpers.go Updated as part of this pull request.
cli/​azd/​extensions/​azure.ai.agents/​internal/​cmd/​init_from_templates_helpers_test.go Updated as part of this pull request.
cli/​azd/​extensions/​azure.ai.agents/​internal/​cmd/​init_foundry_resources_helpers_test.go Updated as part of this pull request.
cli/​azd/​extensions/​azure.ai.agents/​internal/​cmd/​init_adopt.go Updated as part of this pull request.
cli/​azd/​extensions/​azure.ai.agents/​internal/​cmd/​helpers.go Updated as part of this pull request.
cli/​azd/​extensions/​azure.ai.agents/​internal/​cmd/​helpers_test.go Updated as part of this pull request.
cli/​azd/​extensions/​azure.ai.agents/​internal/​cmd/​help_test.go Updated as part of this pull request.
cli/​azd/​extensions/​azure.ai.agents/​internal/​cmd/​agent_service_add.go Updated as part of this pull request.
cli/​azd/​extensions/​azure.ai.agents/​go.sum Updated as part of this pull request.
cli/​azd/​extensions/​azure.ai.agents/​docs/​specs/​preview-feature-flags.md Updated as part of this pull request.
cli/​azd/​extensions/​azure.ai.agents/​cspell.yaml Updated as part of this pull request.

Review effort: Lite

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

Unresolved gating gaps affect optimization submission, structured error propagation, avoidable remote side effects, and the documented read/show behavior.

2 open issues

Review effort: Lite

Comment thread cli/azd/extensions/azure.ai.agents/internal/cmd/optimize.go
Base automatically changed from hui/agents-env-only-flags to main October 23, 2026 05:40
Copilot AI lite review requested due to automatic review settings October 23, 2026 06:19

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

internal/cmd/optimize.go can dereference a nil project/service for config-backed standalone optimization, causing a panic.

1 open issue
2 resolved since last review

Review effort: Lite

Comment thread cli/azd/extensions/azure.ai.agents/internal/cmd/optimize.go
Copilot AI lite review requested due to automatic review settings October 23, 2026 06:58

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

Unresolved critical and moderate issues affect preview-gate enforcement, authentication ordering, optimization safety, and test reliability.

2 open issues
1 resolved since last review

Review effort: Lite

Comment thread cli/azd/extensions/azure.ai.agents/internal/cmd/init_adopt.go
Comment thread cli/azd/extensions/azure.ai.agents/internal/cmd/optimize.go
Copilot AI lite review requested due to automatic review settings October 23, 2026 07:28

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔵 Needs a closer look

Unresolved moderate issues remain in remote-template validation and test assertions executed from server goroutines.

2 open issues

Review effort: Lite

Comment thread cli/azd/extensions/azure.ai.agents/internal/cmd/invoke.go Outdated
Copilot AI lite review requested due to automatic review settings October 23, 2026 08:19

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔵 Needs a closer look

Unresolved moderate issues remain in remote-template early rejection and long-running protocol validation; a test assertion also needs correction.

No open issues 🎉

2 resolved since last review

Review effort: Lite

Copilot AI lite review requested due to automatic review settings October 23, 2026 08:34

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

Unresolved critical gating gaps and standalone optimization failures prevent safe approval.

2 open issues
1 previously missed issue

In code that hasn't changed since last review

Low severity Move HTTP handler assertions to the test goroutine

cli/​azd/​extensions/​azure.ai.agents/​internal/​cmd/​preview_features_test.go:110

The httptest handler runs on the server goroutine, so require.* calls here invoke FailNow off the test goroutine and can terminate the handler without reliably failing the test (or leave the client with an EOF). Record the request method/path/body in the handler and assert those values after executeRoot returns on the test goroutine.

Review effort: Lite

Comment thread cli/azd/extensions/azure.ai.agents/internal/cmd/init.go
Comment thread cli/azd/extensions/azure.ai.agents/internal/cmd/listen.go
@azure-sdk-automation

Copy link
Copy Markdown
Contributor

azure.ai.agents PR build

Note

This is an unsigned development build. Install it only if you trust this PR.

Install the extension:

azd ext install "https://azuresdkartifacts.z5.web.core.windows.net/azd/extensions/pr/10640/azure-ai-agents.zip"
  • Version: 1.0.0-beta.21.pr.10640.6993184
  • Merge commit: 2ee345e

@huimiu
Hui Miao (huimiu) merged commit 80573bb into main Oct 23, 2026
39 checks passed
@huimiu
Hui Miao (huimiu) deleted the hui/foundry-feature-flags-hosted-agent branch October 23, 2026 12:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ext-agents azure.ai.agents extension ext-foundry microsoft.foundry meta package or Foundry/AI extensions overall. Not individual extension issues.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add preview feature flags to the agents extension

5 participants