fix: diagnose unified connection services - #9680
Open
Hui Miao (huimiu) wants to merge 4 commits into
Open
Conversation
|
Azure Pipelines: Successfully started running 1 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. |
Hui Miao (huimiu)
marked this pull request as ready for review
August 21, 2026 14:14
Hui Miao (huimiu)
requested review from
JeffreyCA,
Glenn Harper (glharper),
John Miller (therealjohn) and
Travis Angevine (trangevi)
as code owners
August 21, 2026 14:14
Hui Miao (huimiu)
requested review from
Zhijie Huang (hund030),
Wei Meng (m5i-work) and
JianW (v1212)
as code owners
August 21, 2026 14:14
|
Azure Pipelines: Successfully started running 1 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. |
📋 Prioritization NoteThanks for the contribution! The linked issue isn't in the current milestone yet. |
Contributor
There was a problem hiding this comment.
Pull request overview
Adds unified Foundry connection diagnostics across Doctor and next-step state assembly.
Changes:
- Merges enabled unified, bundled, and legacy connections with precedence and sorting.
- Reports configuration errors before connection probing.
- Updates Doctor messaging, resource-ID validation, and tests.
Reviewed changes
Copilot reviewed 10 out of 10 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
nextstep/types.go |
Adds connection load errors to state. |
nextstep/state.go |
Invokes unified connection collection. |
nextstep/manifest.go |
Moves connection collection out of manifest traversal. |
nextstep/evaluate.go |
Adds condition evaluation helpers. |
nextstep/connections.go |
Collects and merges connection sources. |
nextstep/connections_test.go |
Tests collection, conditions, and precedence. |
nextstep/condition.go |
Uses shared condition evaluation. |
doctor/checks_remote_test.go |
Updates check-name assertion. |
doctor/checks_connections.go |
Updates connection diagnostics and validation. |
doctor/checks_connections_test.go |
Expands Doctor behavior coverage. |
💡 Configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Comment on lines
+160
to
+164
| if _, exists := collected[serviceName]; exists { | ||
| continue | ||
| } | ||
| collected[serviceName] = ResourceRef{ | ||
| Name: serviceName, |
Travis Angevine (trangevi)
approved these changes
Aug 21, 2026
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Why this is needed
Issue #8710 needs Doctor and next step to diagnose configured Foundry connections consistently. Right now, unified
azure.ai.connectionservices are not merged with bundled agent connections and legacy manifest resources, so enabled connections can be skipped or reported with the wrong remote result. Configuration errors also need to stopremote.connectionsbefore any Foundry probe runs.Why this approach
The collector now reads unified, bundled, and legacy sources, with standalone unified services taking precedence over bundled data and bundled data taking precedence over legacy manifests. It deduplicates and sorts results, while keeping credentials and metadata out of diagnostics. Doctor reports connection load errors before probing, skips when there are no enabled connections, and recommends
azd provisionfor missing remote connections.A connection
conditionbelongs at the root ofazure.yaml, next tohost. A rootfalsecondition still wins and short-circuits$refloading. For an enabled service, or one without a root condition, aconditionthat comes from resolved$refcontent is treated as a configuration error, with guidance to move it besidehost. Payload conditions do not override the root field. Whitespace-only conditions count as false.Malformed legacy manifest strictness and target, credentials, and metadata variable validation are out of scope for this diagnostics-only change.
E2E validation
azd ai agent doctor --local-onlypassed; remote checks remained excluded.azd ai agent doctorpassed with an enabled unified connection on the Foundry project;remote.connectionspassed.azd ai agent doctorwith a resolved$refcondition failed as expected, with guidance to placeconditionbesidehostinazure.yaml.azd ai agent doctorwith rootcondition: falseand whitespace-only conditions passed; connection checks skipped without resolving broken$refvalues.Closes: #9684