Skip to content

[ai-agents] Handle replaced telephony roots during customization - #50980

Open
liangxu (21eutidyt9d67r1) wants to merge 3 commits into
Azure:mainfrom
21eutidyt9d67r1:codex/telephony-spec-sdk-ci-20261026
Open

liangxu (21eutidyt9d67r1) wants to merge 3 commits into
Azure:mainfrom
21eutidyt9d67r1:codex/telephony-spec-sdk-ci-20261026

Conversation

@21eutidyt9d67r1

@21eutidyt9d67r1 liangxu (21eutidyt9d67r1) commented Oct 26, 2026 •

Copy link
Copy Markdown

Summary

Fix the first generation failure in azure-rest-api-specs PR #46465 (Java SDK Validation build 6998400): constructor customization assumes CreateTelephonyBindingInput and TelephonyTransferDestination are still emitted after their shared-contract replacements.

Apply constructor protection only to emitted members of the known polymorphic-root allowlist, including TelephonyBinding and TelephonyAddress. Legacy roots remain protected when emitted, and unrelated models retain public constructors. This does not restore obsolete public models, change wire contracts, or suppress other generation failures.

Scope

  • Retain the implementation fix in AgentsCustomizations.java.
  • Put constructor checks alongside the existing SDK tests in src/test/java/com/azure/ai/agents/models/PolymorphicModelConstructorTests.java, using the existing JUnit/Surefire setup.
  • No changes to any package POM or to CHANGELOG.md. Remove the standalone customization test configuration.

Validation - 2026-10-27

  • SDK and test sources compiled for Java 8 and Java 17 using JDK 17.
  • PolymorphicModelConstructorTests: 6 passed, 0 failures/errors/skips.
  • Existing offline VoiceAgentTelephonyTests: 12 passed, 0 failures/errors/skips.
  • Combined targeted run: 18 passed, Maven BUILD SUCCESS.
  • Spotless passed. Targeted Checkstyle audited the new test file and reported 0 violations.
  • Used the repository's existing generate_from_source_pom.py / From Source reactor to build same-checkout unreleased Azure Core dependencies; no dependency versions or package POMs were edited.

Targeted command, after generating the local From Source reactor:

mvn -B -ntp -s eng/settings.xml -f ClientFromSourcePom.xml \
  -Dtest=PolymorphicModelConstructorTests,VoiceAgentTelephonyTests \
  -Dsurefire.failIfNoSpecifiedTests=false \
  '-DspotlessFiles=.*PolymorphicModelConstructorTests.java' test

The no-matching-tests setting applies to dependency reactor modules; the Agents module actually executed all 18 selected tests with no skips. These are deterministic model/API and mocked HTTP checks, with no live Azure or telephone operations.

This run validates the checked-in SDK models. The constructor tests follow the typed binding-creation input and transfer-destination getter, so they check the corresponding shared roots after regeneration without conditionally skipping missing classes. A fresh generation from TypeSpec PR #46465 and its independent Java/JS SDK gates remain separate validation requirements.

Historical remote CI

Azure Pipelines build 6998804 succeeded for source 337fc5a768e132185a6f9410e9f943c20b496547, tested merge 589d683076e5aed0c5def03641b23d147aee47fc against main d8ce65bdb9b5c9b0ce41adb43098eb779bde0f83. This is historical evidence for the earlier revision, not CI approval of the latest test-layout update.

Related: Azure/azure-rest-api-specs#46465

@github-actions github-actions Bot added AI Agents Community Contribution Community members are working on the issue customer-reported Issues that are reported by GitHub users external to the Azure organization. labels Oct 26, 2026
@github-actions

Copy link
Copy Markdown
Contributor

Thank you for your contribution liangxu (@21eutidyt9d67r1)! We will review the pull request and get back to you soon.

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
Successfully started running 1 pipeline(s).
31 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.

🟢 Approval recommended

The scoped change preserves allowlist behavior and has focused regression coverage, with no identified blocking issues.

No open issues 🎉

What changed in this PR

This PR makes Azure AI Agents constructor customization tolerate replaced telephony models while preserving protection for known polymorphic roots that are still emitted.

Changes:

  • Adds the replacement telephony roots to the allowlist and skips absent models.
  • Adds regression tests for replacement and legacy roots, plus preservation of unrelated public constructors.
  • Configures JUnit and the nested module’s formatter path, and documents the generation fix.
File Description
sdk/​ai/​azure-ai-agents/​customizations/​src/​test/​java/​AgentsCustomizationsConstructorTests.java Tests root protection and unrelated constructor preservation.
sdk/​ai/​azure-ai-agents/​customizations/​src/​main/​java/​AgentsCustomizations.java Applies constructor protection only to emitted, allowlisted models.
sdk/​ai/​azure-ai-agents/​customizations/​pom.xml Adds JUnit and configures the formatter path.
sdk/​ai/​azure-ai-agents/​CHANGELOG.md Records the telephony customization fix.

Review effort: Balanced

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

AI Agents Community Contribution Community members are working on the issue customer-reported Issues that are reported by GitHub users external to the Azure organization.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants