Skip to content

Support hosted voice conversation engine - #9948

Merged
JianW (v1212) merged 11 commits into
Azure:mainfrom
v1212:users/wujia/hosted-voice-conversation-engine
Sep 11, 2026
Merged

Support hosted voice conversation engine#9948
JianW (v1212) merged 11 commits into
Azure:mainfrom
v1212:users/wujia/hosted-voice-conversation-engine

Conversation

@v1212

@v1212 JianW (v1212) commented Sep 10, 2026

Copy link
Copy Markdown
Contributor

Context

This PR adapts azd to a service-side Hosted Voice breaking change: hosted Voice wrappers now use conversationEngine / conversation_engine instead of the previous modelType: hosted_agent / targetAgent contract.

Summary

Closes #9949.

  • add conversationEngine authoring for hosted Voice wrappers
  • map conversationEngine.type=hosted_agent to the service conversation_engine payload
  • resolve conversationEngine.name through the existing hosted target service and pin the deployed target version
  • fail fast for the older modelType: hosted_agent / targetAgent hosted Voice authoring shape because the service no longer supports that wire contract

Validation

  • go test ./...
  • go vet ./...
  • cspell over the agents extension
  • deployed latest foundry-samples-pr/main Hosted Voice Python sample using conversationEngine
  • verified persisted wrapper definition contains conversation_engine and does not send model_type=hosted_agent
  • wrapper typed /help E2E returned target-owned Commands: after greeting
  • wrapper audio E2E returned STT Hello. and response text after greeting

Related

@azure-pipelines

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

@azure-pipelines

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

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

The schema rejects the new authoring shape, runtime validation permits ambiguous mixed forms, and added lines violate enforced lint limits.

Once you've addressed the issues Copilot identified, you can request another Copilot review.

Pull request overview

Adds hosted Voice wrapper support using the new conversationEngine authoring and service payload while retaining the legacy format.

Changes:

  • Adds schema and model types for conversation engines.
  • Resolves hosted targets and emits conversation_engine.
  • Adds round-trip and wire-format tests.
File summaries
File Description
schemas/azure.ai.agent.json Defines the new authoring schema.
internal/project/service_target_agent.go Resolves hosted conversation targets.
internal/project/service_target_agent_test.go Tests inline round-tripping.
internal/project/agent_definition.go Preserves the field in service definitions.
internal/pkg/agents/agent_yaml/yaml.go Adds authoring model types.
internal/pkg/agents/agent_yaml/parse.go Validates hosted wrapper configuration.
internal/pkg/agents/agent_yaml/map.go Maps to the service wire format.
internal/pkg/agents/agent_yaml/map_voice_test.go Tests the emitted payload.
internal/pkg/agents/agent_api/models.go Adds the data-plane model.
Review details

Suppressed comments (1)

cli/azd/extensions/azure.ai.agents/internal/pkg/agents/agent_yaml/parse.go:559

  • This fallback also handles a legacy target_agent supplied without model_type, but the error now only names conversation_engine. That sends users toward a field they did not configure; report each invalid shape separately.
						if agent.TargetAgent != nil || agent.ConversationEngine != nil {
							errors = append(errors,
								"template.conversation_engine is only valid for hosted voice wrappers")
  • Files reviewed: 9/9 changed files
  • Comments generated: 8
  • Review effort level: Balanced

💡 Configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread cli/azd/extensions/azure.ai.agents/schemas/azure.ai.agent.json
Comment thread cli/azd/extensions/azure.ai.agents/schemas/azure.ai.agent.json
Comment thread cli/azd/extensions/azure.ai.agents/internal/pkg/agents/agent_yaml/map.go Outdated
Comment thread cli/azd/extensions/azure.ai.agents/internal/pkg/agents/agent_yaml/parse.go Outdated
Comment thread cli/azd/extensions/azure.ai.agents/internal/pkg/agents/agent_yaml/parse.go Outdated
Comment thread cli/azd/extensions/azure.ai.agents/schemas/azure.ai.agent.json
Copilot AI review requested due to automatic review settings September 10, 2026 05:48

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

Two lines still violate enforced lint limits, and one validation diagnostic is misleading.

Once you've addressed the issues Copilot identified, you can request another Copilot review.

Review details

Suppressed comments (2)

Previously missed (1) — in code that hasn't changed since the last review.

cli/azd/extensions/azure.ai.agents/internal/pkg/agents/agent_yaml/parse.go:534

  • This line is still 128 columns with tabs counted as width 4, exceeding the enforced 125-column limit in cli/azd/AGENTS.md:115-126; split the message so lll can pass.

This issue also appears on line 595 of the same file.

cli/azd/extensions/azure.ai.agents/internal/pkg/agents/agent_yaml/parse.go:595

  • This line is still 128 columns with tabs counted as width 4, exceeding the enforced 125-column limit in cli/azd/AGENTS.md:115-126; wrap the condition so lll can pass.
		(agent.ConversationEngine != nil && strings.EqualFold(strings.TrimSpace(agent.ConversationEngine.Type), "hosted_agent"))
  • Files reviewed: 10/10 changed files
  • Comments generated: 2
  • Review effort level: Balanced

Comment thread cli/azd/extensions/azure.ai.agents/internal/pkg/agents/agent_yaml/parse.go Outdated
Comment thread cli/azd/extensions/azure.ai.agents/internal/pkg/agents/agent_yaml/parse.go Outdated
Copilot AI review requested due to automatic review settings September 10, 2026 06:04

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

Standalone initialization remains incomplete, and two changed Go lines violate the enforced line-length limit.

Once you've addressed the issues Copilot identified, you can request another Copilot review.

Review details

Suppressed comments (2)

cli/azd/extensions/azure.ai.agents/internal/pkg/agents/agent_yaml/parse.go:534

  • This added error string is 128 columns with tabs counted as width 4, so it fails the enforced 125-column lll limit in cli/azd/AGENTS.md:115-126. Split the literal across lines.
								"template.conversation_engine.name is required when conversation_engine.type is 'hosted_agent'")

cli/azd/extensions/azure.ai.agents/internal/pkg/agents/agent_yaml/parse.go:599

  • This condition is 128 columns with tabs counted as width 4, so it fails the enforced 125-column lll limit in cli/azd/AGENTS.md:115-126. Wrap the EqualFold call onto a continuation line.
		(agent.ConversationEngine != nil && strings.EqualFold(strings.TrimSpace(agent.ConversationEngine.Type), "hosted_agent"))
  • Files reviewed: 11/11 changed files
  • Comments generated: 2
  • Review effort level: Balanced

Comment thread cli/azd/extensions/azure.ai.agents/internal/pkg/agents/agent_yaml/parse.go Outdated
Comment thread cli/azd/extensions/azure.ai.agents/internal/project/agent_definition.go Outdated
Copilot AI review requested due to automatic review settings September 10, 2026 06: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.

🔵 Needs a closer look

Two changed Go lines still exceed the repository’s enforced 125-column limit.

Review details

Suppressed comments (2)

cli/azd/extensions/azure.ai.agents/internal/pkg/agents/agent_yaml/parse.go:534

  • This line is still 128 columns with tabs counted as width 4, exceeding the enforced 125-column limit in cli/azd/AGENTS.md:115-126. Split the message again so the lll check can pass.
								"template.conversation_engine.name is required when conversation_engine.type is 'hosted_agent'")

cli/azd/extensions/azure.ai.agents/internal/pkg/agents/agent_yaml/parse.go:599

  • This condition remains 128 columns with tabs counted as width 4, exceeding the enforced 125-column limit in cli/azd/AGENTS.md:115-126. Wrap the second operand onto its own line so lll accepts it.
		(agent.ConversationEngine != nil && strings.EqualFold(strings.TrimSpace(agent.ConversationEngine.Type), "hosted_agent"))
  • Files reviewed: 12/12 changed files
  • Comments generated: 0 new
  • Review effort level: Balanced

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

Legacy mapping remains active, validation and schema behavior diverge, and two added lines violate the enforced line-length limit.

Once you've addressed the issues Copilot identified, you can request another Copilot review.

Review details

Suppressed comments (3)

cli/azd/extensions/azure.ai.agents/schemas/azure.ai.agent.json:297

  • The published schema still accepts the legacy modelType: hosted_agent plus targetAgent branch above, while runtime validation now always rejects that shape. This makes editor/schema validation advertise a configuration that deterministically fails deployment; remove the legacy acceptance branch or add an explicit schema rejection for those fields.
            { "required": ["toolChoice"] },

cli/azd/extensions/azure.ai.agents/internal/pkg/agents/agent_yaml/parse.go:529

  • This line is 128 columns with tabs counted as width 4, exceeding the repository's enforced 125-column Go limit (cli/azd/AGENTS.md:115-126). Split the message so the lll check passes.
								"template.conversation_engine.name is required when conversation_engine.type is 'hosted_agent'")

cli/azd/extensions/azure.ai.agents/internal/pkg/agents/agent_yaml/parse.go:590

  • This line remains 128 columns with tabs counted as width 4, exceeding the repository's enforced 125-column Go limit (cli/azd/AGENTS.md:115-126). Wrap the condition so the lll check passes.
		(agent.ConversationEngine != nil && strings.EqualFold(strings.TrimSpace(agent.ConversationEngine.Type), "hosted_agent"))
  • Files reviewed: 12/12 changed files
  • Comments generated: 2
  • Review effort level: Balanced

Comment thread cli/azd/extensions/azure.ai.agents/internal/pkg/agents/agent_yaml/map.go Outdated
Copilot AI review requested due to automatic review settings September 11, 2026 02:13

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

The legacy authoring rejection conflicts with the linked issue’s compatibility requirement, and its migration error references the wrong field spelling for azure.yaml.

Once you've addressed the issues Copilot identified, you can request another Copilot review.

Review details

Suppressed comments (1)

Previously missed (1) — in code that hasn't changed since the last review.

cli/azd/extensions/azure.ai.agents/internal/pkg/agents/agent_yaml/parse.go:523

  • This validation is also used for inline azure.yaml services, where the accepted property is camelCase conversationEngine; telling those users to add conversation_engine sends them to a field that the inline decoder does not bind. Mention the azure.yaml spelling as well so the fail-fast remediation is actionable in both authoring formats.
  • Files reviewed: 12/12 changed files
  • Comments generated: 1
  • Review effort level: Balanced

Comment thread cli/azd/extensions/azure.ai.agents/internal/pkg/agents/agent_yaml/map.go Outdated
Copilot AI review requested due to automatic review settings September 11, 2026 02:21

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

Two added lines violate the enforced line limit, and schema and error guidance still advertise the rejected legacy contract.

Once you've addressed the issues Copilot identified, you can request another Copilot review.

Review details

Suppressed comments (3)

Previously missed (1) — in code that hasn't changed since the last review.

cli/azd/extensions/azure.ai.agents/schemas/azure.ai.agent.json:223

  • The schema now rejects the legacy shape, but its modelType description/enum still advertises hosted_agent, and targetAgent still appears as an ordinary completion. Editors will suggest configurations that this branch makes invalid. Remove hosted_agent from the supported modelType metadata and mark targetAgent as deprecated/unsupported while retaining the explicit rejection needed with additionalProperties: true.

cli/azd/extensions/azure.ai.agents/internal/pkg/agents/agent_yaml/parse.go:534

  • This line is still 128 columns with tabs counted as width 4, exceeding the repository's 125-column lll limit (cli/azd/AGENTS.md:115-126). Split the message across two literals so preflight can pass.
								"template.conversation_engine.name is required when conversation_engine.type is 'hosted_agent'")

cli/azd/extensions/azure.ai.agents/internal/pkg/agents/agent_yaml/parse.go:595

  • This condition remains 128 columns with tabs counted as width 4, exceeding the repository's 125-column lll limit (cli/azd/AGENTS.md:115-126). Wrap the EqualFold call onto a continuation line.
		(agent.ConversationEngine != nil && strings.EqualFold(strings.TrimSpace(agent.ConversationEngine.Type), "hosted_agent"))
  • Files reviewed: 12/12 changed files
  • Comments generated: 1
  • Review effort level: Balanced

Copilot AI review requested due to automatic review settings September 11, 2026 02:32

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

Two changed Go lines violate the enforced line limit, and the schema and diagnostics still advertise obsolete authoring guidance.

Review details

Suppressed comments (5)

Previously missed (3) — in code that hasn't changed since the last review.

cli/azd/extensions/azure.ai.agents/schemas/azure.ai.agent.json:222

  • This rejection conflicts with the public schema surface: modelType still documents and enumerates hosted_agent, so editor completion advertises a value that this rule always rejects. Remove hosted_agent from that property's enum/description while keeping conversationEngine as the supported hosted option.
    cli/azd/extensions/azure.ai.agents/internal/pkg/agents/agent_yaml/parse.go:560
  • This diagnostic directs users to model_type: hosted_agent, but that value is now rejected. Tell users that target_agent is unsupported and to use conversation_engine instead.
    cli/azd/extensions/azure.ai.agents/internal/project/service_target_agent.go:2651
  • The new authoring-to-deployment bridge is not covered by an automated test: the round-trip tests stop before this helper, while the wire test injects an already resolved target. Add cases proving that conversationEngine.name becomes the resolver's service name, an omitted version defaults to deployed, and non-hosted engines return nil; otherwise this deployment-critical handoff can regress while the added tests still pass.

cli/azd/extensions/azure.ai.agents/internal/pkg/agents/agent_yaml/parse.go:596

  • This condition is still 128 columns with tabs counted as width 4, so it exceeds the enforced 125-column Go limit (cli/azd/AGENTS.md:115-126) and will fail lll. Break the second condition across lines.
		(agent.ConversationEngine != nil && strings.EqualFold(strings.TrimSpace(agent.ConversationEngine.Type), "hosted_agent"))

cli/azd/extensions/azure.ai.agents/internal/pkg/agents/agent_yaml/parse.go:534

  • This line is still 128 columns when tabs count as width 4, exceeding the repository's enforced 125-column Go limit (cli/azd/AGENTS.md:115-126). Split the message so the lll check can pass.
								"template.conversation_engine.name is required when conversation_engine.type is 'hosted_agent'")
  • Files reviewed: 12/12 changed files
  • Comments generated: 0 new
  • Review effort level: Balanced

Copilot AI review requested due to automatic review settings September 11, 2026 06: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

Standalone validation still directs target_agent users to the newly unsupported legacy contract.

Once you've addressed the issues Copilot identified, you can request another Copilot review.

Review details
  • Files reviewed: 12/12 changed files
  • Comments generated: 1
  • Review effort level: Balanced

Comment thread cli/azd/extensions/azure.ai.agents/internal/pkg/agents/agent_yaml/parse.go Outdated
Copilot AI review requested due to automatic review settings September 11, 2026 06:44

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

Two changed Go lines exceed the enforced 125-column limit and will fail linting.

Review details

Suppressed comments (2)

cli/azd/extensions/azure.ai.agents/internal/pkg/agents/agent_yaml/parse.go:575

  • This line is still 128 columns with tabs counted as width 4, so it exceeds the enforced 125-column limit and will fail the lll check (cli/azd/AGENTS.md:118-129). Split the message across concatenated strings.
								"template.conversation_engine.name is required when conversation_engine.type is 'hosted_agent'")

cli/azd/extensions/azure.ai.agents/internal/pkg/agents/agent_yaml/parse.go:637

  • This condition is still 128 columns with tabs counted as width 4, so it exceeds the enforced 125-column limit and will fail the lll check (cli/azd/AGENTS.md:118-129). Reuse the package helper to keep this within the limit and avoid duplicating the predicate.
		(agent.ConversationEngine != nil && strings.EqualFold(strings.TrimSpace(agent.ConversationEngine.Type), "hosted_agent"))
  • Files reviewed: 12/12 changed files
  • Comments generated: 0 new
  • Review effort level: Balanced

Copilot AI review requested due to automatic review settings September 11, 2026 07:12

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.

🟢 Approval recommended

The implementation consistently updates authoring, validation, deployment mapping, documentation, and tests for the new contract.

Review details
  • Files reviewed: 12/12 changed files
  • Comments generated: 0 new
  • Review effort level: Balanced

@v1212
JianW (v1212) enabled auto-merge (squash) September 11, 2026 08:54
@v1212
JianW (v1212) merged commit 5111390 into Azure:main Sep 11, 2026
36 checks passed
@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/9948/azure-ai-agents.zip"
  • Version: 1.0.0-beta.14.pr.9948.6824449
  • Merge commit: eca0c19

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Support Hosted Voice conversationEngine contract

5 participants