You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
feat: scope preview feature flags to the agents extension - #10636
Keep preview opt-in handling inside the Microsoft Foundry agents extension instead of a shared package in azd core. This PR adds the flag check, a small feature registry, and a design doc. It doesn't gate any commands yet. Each agents preview needs its own alpha.<ID> key, and alpha.all is ignored. Core azd's global alpha behavior is unchanged.
Changes
Add azureaiagent/internal/featureflags with Feature{ID, EnvVar, Description} and IsEnabled(ctx, client, feature, environmentName). Remove the root extensions/featureflags package and its README.
registry.go lists every agents preview: ManagedHarness, Voice, and LongRunning, each with a short optional description. All() returns a copy of the list and Lookup(id) finds one by ID. Tests check the agents. prefix, env var naming, unique IDs and vars, and descriptions.
A feature is on if alpha.<ID> is on in config (case-insensitive), or its declared env var is true per strconv.ParseBool in the process env or the selected environment's .env. Opt-ins are additive. Global, unrelated, or non-enabling values can't cancel an explicit opt-in.
An explicitly selected environment is passed through as is. A missing optional scope is skipped only when no environment was selected. Real source errors are returned even if another source enables the feature. Reads aren't cached and don't print, write, or call auth.
Add docs/specs/preview-feature-flags.md in the agents extension: ownership, dependency direction, API, registry, error handling, discovery vs runtime checks, and trade-offs. Planned use is limited to managed harness agents, voice agents, and long-running invocation. General hosted agents and plain prompts stay ungated. These checks don't apply to evaluations or routines requests sent to existing agents.
Add CheckEnvironmentFlag(flags). It rejects an --environment flag that was set to an empty value before any source is read. A missing or unset flag still means the default environment. The spec lists the caller contract.
The spec has a new section on azd alpha features. alpha.all and AZD_ALPHA_ENABLE_<NAME> variables don't turn these previews on. Each one needs its own opt-in. The agents README notes the same carve out in the stacked feat: gate Foundry agent previews independently #10640.
Keep the existing source combination, scope, error, and snapshot tests. New tests check that alpha.all and AZD_ALPHA_ENABLE_<NAME> values are ignored for every registered feature, that an explicit empty --environment is rejected and that global or unrelated values can't override an explicit opt-in.
Add three indirect dependencies (heredoc/v2, azblob, azfile) needed by the host-sentinel compatibility tests in this module. azd stays at v1.37.0, the same pin as main. No root module replace, dependency upgrade, core or RPC change, release bump, or changelog entry.
Validation
Go 1.26.4 in cli/azd/extensions/azure.ai.agents: go build ./..., go vet ./..., and go test ./... pass. gofmt is clean.
golangci-lint with the repo config reports 0 issues. cSpell passes on touched files.
E2E
Built azd and the extension from this PR (ef8a606dc) and swapped the extension binary into the local install. Real Azure runs used a temporary Foundry project in eastus2 with gpt-4.1-mini. The resource group was deleted and the account purged afterwards.
The last five rows ran after the review fixes. This PR gates no command, so they used azd and the extension built from the #10657 head (7cf859518), which contains this PR at 35ac9bd34. Each used an isolated azd config.
Scenario
Expected
Result
Root, init, and invoke help with every flag off
no gating yet, previews still listed
previews listed
azd package of a prompt-voice project, flag off
no gate in this PR
packaged
Prompt agent azd deploy, real Azure
deployed
deployed
azd config set alpha.all on, then config list-alpha and init --kind prompt-voice
all Off, init refused
all Off, refused
AZD_ALPHA_ENABLE_AGENTS_VOICE=true
voice stays Off
Off
alpha.agents.voice on or process AZD_FOUNDRY_EXT_ENABLE_AGENTS_VOICE=true
voice On
On
invoke --long-running -e "" and --environment "", opt-in only in the default env
rejected as an empty environment, default env not used
rejected
invoke -e "" with no preview flag on a deployed prompt agent, real Azure
unchanged, reply
reply "pong"
Compatibility
Agents code imports azureaiagent/internal/featureflags. IsEnabled keeps its signature and Feature only gains the optional Description field. Opt-in is per-feature config or the exact env var. An explicit empty --environment is now an error for preview checks. alpha.all no longer turns on agents previews. Runtime OR semantics are unchanged. Downstream agents changes don't need replace github.com/azure/azure-dev/cli/azd => ../../ just to import featureflags.
Azure Pipelines:
Successfully started running 2 pipeline(s).
24 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-actionsBot
added
the
ext-foundry
microsoft.foundry meta package or Foundry/AI extensions overall. Not individual extension issues.
label
Oct 20, 2026
Hui Miao (huimiu)
changed the title
feat: add shared Foundry extension feature access
feat: scope preview feature flags to the agents extension
Oct 21, 2026
Thanks for the contribution! The linked issue isn't in the current milestone yet.
Thank you for logging this issue; our team is reviewing it. If you need urgent prioritization, tag Rick Winter (@RickWinter) and Kristen Womack (@kristenwomack) to let us know.
Add a self-contained featureflags package for first-party Foundry
extensions. A feature is enabled when any layer opts in: user config
alpha.<id> or alpha.all set to on, the process env var, the selected
azd environment .env, or any azure.yaml services[].env map. It reads
only through existing azd gRPC services and needs no core change.
Document that agents previews need their own opt-in and are not turned on by alpha.all or AZD_ALPHA_ENABLE_* variables. Add CheckEnvironmentFlag so callers reject an explicit empty --environment before reading any source.
The enablement table is incomplete: IsEnabled also treats AZD_FOUNDRY_EXT_ENABLE_* values from every persisted azure.yaml service's env map as opt-ins (featureflags.go:147-151), including unrelated services. Please document this source and its scope here, or remove that source if the supported contract is limited to process and selected-environment values; otherwise users cannot explain why a service configuration enables an agents preview.
This adds every service's azure.yamlenvironment map as an opt-in source, but the contract and the implementation above only allow process environment and the selected azd .env values. A project can therefore enable a preview merely by declaring AZD_FOUNDRY_EXT_ENABLE_*: "true" for any service, including when no default environment exists, and this also makes the documented alpha.all/unrelated-value isolation incomplete. Remove this loop and evaluate only the declared process and azd environment sources.
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
area/extensionsExtensions (general)ext-agentsazure.ai.agents extensionext-foundrymicrosoft.foundry meta package or Foundry/AI extensions overall. Not individual extension issues.
3 participants
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.
Fixes #10659
Summary
Keep preview opt-in handling inside the Microsoft Foundry agents extension instead of a shared package in azd core. This PR adds the flag check, a small feature registry, and a design doc. It doesn't gate any commands yet. Each agents preview needs its own
alpha.<ID>key, andalpha.allis ignored. Core azd's global alpha behavior is unchanged.Changes
azureaiagent/internal/featureflagswithFeature{ID, EnvVar, Description}andIsEnabled(ctx, client, feature, environmentName). Remove the rootextensions/featureflagspackage and its README.registry.golists every agents preview:ManagedHarness,Voice, andLongRunning, each with a short optional description.All()returns a copy of the list andLookup(id)finds one by ID. Tests check theagents.prefix, env var naming, unique IDs and vars, and descriptions.alpha.<ID>isonin config (case-insensitive), or its declared env var is true perstrconv.ParseBoolin the process env or the selected environment's .env. Opt-ins are additive. Global, unrelated, or non-enabling values can't cancel an explicit opt-in.docs/specs/preview-feature-flags.mdin the agents extension: ownership, dependency direction, API, registry, error handling, discovery vs runtime checks, and trade-offs. Planned use is limited to managed harness agents, voice agents, and long-running invocation. General hosted agents and plain prompts stay ungated. These checks don't apply to evaluations or routines requests sent to existing agents.CheckEnvironmentFlag(flags). It rejects an--environmentflag that was set to an empty value before any source is read. A missing or unset flag still means the default environment. The spec lists the caller contract.alpha.allandAZD_ALPHA_ENABLE_<NAME>variables don't turn these previews on. Each one needs its own opt-in. The agents README notes the same carve out in the stacked feat: gate Foundry agent previews independently #10640.alpha.allandAZD_ALPHA_ENABLE_<NAME>values are ignored for every registered feature, that an explicit empty--environmentis rejected and that global or unrelated values can't override an explicit opt-in.heredoc/v2,azblob,azfile) needed by the host-sentinel compatibility tests in this module. azd stays atv1.37.0, the same pin as main. No root module replace, dependency upgrade, core or RPC change, release bump, or changelog entry.Validation
cli/azd/extensions/azure.ai.agents:go build ./...,go vet ./..., andgo test ./...pass.gofmtis clean.golangci-lintwith the repo config reports 0 issues. cSpell passes on touched files.E2E
Built azd and the extension from this PR (
ef8a606dc) and swapped the extension binary into the local install. Real Azure runs used a temporary Foundry project ineastus2withgpt-4.1-mini. The resource group was deleted and the account purged afterwards.The last five rows ran after the review fixes. This PR gates no command, so they used azd and the extension built from the #10657 head (
7cf859518), which contains this PR at35ac9bd34. Each used an isolated azd config.init, andinvokehelp with every flag offazd packageof a prompt-voice project, flag offazd deploy, real Azureazd config set alpha.all on, thenconfig list-alphaandinit --kind prompt-voiceOff, init refusedOff, refusedAZD_ALPHA_ENABLE_AGENTS_VOICE=trueOffOffalpha.agents.voice onor processAZD_FOUNDRY_EXT_ENABLE_AGENTS_VOICE=trueOnOninvoke --long-running -e ""and--environment "", opt-in only in the default envinvoke -e ""with no preview flag on a deployed prompt agent, real AzureCompatibility
Agents code imports
azureaiagent/internal/featureflags.IsEnabledkeeps its signature andFeatureonly gains the optionalDescriptionfield. Opt-in is per-feature config or the exact env var. An explicit empty--environmentis now an error for preview checks.alpha.allno longer turns on agents previews. Runtime OR semantics are unchanged. Downstream agents changes don't needreplace github.com/azure/azure-dev/cli/azd => ../../just to import featureflags.