Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -1087,11 +1087,11 @@ export const ParameterSection = ({
const selectedModelId = value?.length ? value[0]?.value : undefined;
const currentModelType = findFoundryParam(nodeInputs.parameterGroups, group.id, agentModelTypeParameterKey)?.value?.[0]?.value;

// Only populate deploymentModelProperties for MicrosoftFoundry.
// For AzureOpenAI the backend derives model info from the deployment itself.
if (currentModelType === 'MicrosoftFoundry' && selectedModelId) {
// Populate deploymentModelProperties for both AzureOpenAI and MicrosoftFoundry.
// The backend requires name/format/version for AzureOpenAI model type.
if ((currentModelType === 'MicrosoftFoundry' || currentModelType === 'AzureOpenAI') && selectedModelId) {
const deploymentInfo = deploymentsForCognitiveServiceAccount?.find((deployment: any) => deployment.name === selectedModelId);
const modelName = deploymentInfo?.properties?.model?.name;
const modelName = deploymentInfo?.properties?.model?.name ?? selectedModelId;
Comment on lines +1090 to +1094
Copy link

Copilot AI Apr 23, 2026

Choose a reason for hiding this comment

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

Same issue as designer v1: deploymentModelProperties are now populated for AzureOpenAI here, but the earlier agentModelType-change handler still clears deploymentModelProperties whenever newValue !== 'MicrosoftFoundry'. Because this block only runs on a user change to deploymentId, those cleared values may not be repopulated (e.g., if deploymentId stays the same or is updated via dispatch). Adjust the clearing condition to exclude AzureOpenAI, and/or add a repopulation step when model type changes and a deployment is already selected.

Copilot uses AI. Check for mistakes.
let modelFormat = deploymentInfo?.properties?.model?.format;
let modelVersion = deploymentInfo?.properties?.model?.version;
if (!modelFormat || !modelVersion) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1096,11 +1096,11 @@ export const ParameterSection = ({
const selectedModelId = value?.length ? value[0]?.value : undefined;
const currentModelType = findFoundryParam(nodeInputs.parameterGroups, group.id, agentModelTypeParameterKey)?.value?.[0]?.value;

// Only populate deploymentModelProperties for MicrosoftFoundry.
// For AzureOpenAI the backend derives model info from the deployment itself.
if (currentModelType === 'MicrosoftFoundry' && selectedModelId) {
// Populate deploymentModelProperties for both AzureOpenAI and MicrosoftFoundry.
// The backend requires name/format/version for AzureOpenAI model type.
if ((currentModelType === 'MicrosoftFoundry' || currentModelType === 'AzureOpenAI') && selectedModelId) {
const deploymentInfo = deploymentsForCognitiveServiceAccount?.find((deployment: any) => deployment.name === selectedModelId);
const modelName = deploymentInfo?.properties?.model?.name;
const modelName = deploymentInfo?.properties?.model?.name ?? selectedModelId;
Comment on lines +1099 to +1103
Copy link

Copilot AI Apr 23, 2026

Choose a reason for hiding this comment

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

Since deploymentModelProperties are now required/populated for AzureOpenAI too, this handler can still end up with empty deploymentModelProperties when agentModelType switches away from MicrosoftFoundry (the earlier logic clears these fields whenever newValue !== 'MicrosoftFoundry'). Because this populate logic only runs when the deploymentId field changes, the cleared values may never be repopulated (e.g., if deploymentId remains unchanged / is set programmatically). Update the clearing condition to keep these fields for AzureOpenAI as well, or trigger repopulation based on the currently-selected deploymentId after model type changes.

Copilot uses AI. Check for mistakes.
let modelFormat = deploymentInfo?.properties?.model?.format;
let modelVersion = deploymentInfo?.properties?.model?.version;
if (!modelFormat || !modelVersion) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -116,4 +116,20 @@ describe('agentloop – Foundry V2 regression', () => {
expect(field.type).toBe('string');
});
});

describe('deploymentModelProperties visibility', () => {
const agentModelSettings = inputs.agentModelSettings?.properties as Record<string, any>;
const deploymentModelProps = agentModelSettings?.deploymentModelProperties?.properties as Record<string, any>;

it.each(['name', 'format', 'version'])('%s should be visible for both AzureOpenAI and MicrosoftFoundry', (field) => {
const visValues = deploymentModelProps[field]['x-ms-input-dependencies'].parameters[0].values as string[];
expect(visValues).toContain('AzureOpenAI');
expect(visValues).toContain('MicrosoftFoundry');
});

it.each(['name', 'format', 'version'])('%s should NOT be visible for FoundryAgentServiceV2', (field) => {
const visValues = deploymentModelProps[field]['x-ms-input-dependencies'].parameters[0].values as string[];
expect(visValues).not.toContain('FoundryAgentServiceV2');
});
});
});
Original file line number Diff line number Diff line change
Expand Up @@ -476,7 +476,7 @@ export default {
parameters: [
{
name: 'agentModelType',
values: ['MicrosoftFoundry'],
values: ['AzureOpenAI', 'MicrosoftFoundry'],
},
],
},
Expand All @@ -490,7 +490,7 @@ export default {
parameters: [
{
name: 'agentModelType',
values: ['MicrosoftFoundry'],
values: ['AzureOpenAI', 'MicrosoftFoundry'],
},
],
},
Expand All @@ -504,7 +504,7 @@ export default {
parameters: [
{
name: 'agentModelType',
values: ['MicrosoftFoundry'],
values: ['AzureOpenAI', 'MicrosoftFoundry'],
},
],
},
Expand Down
Loading