Skip to content

.NET: Python: [Bug]: Issues facing in the AIFoundry Agents through Agent-Framework python SDK #3376

@Jagadeesh287

Description

@Jagadeesh287

Description

Im facing below issue while working with Agent-Framework

My Issue:

Currently, we are running these agents in our production environment, which have been developed using the .NET AI Foundry SDK (Persistent Agent). Now, we are trying to use the same agent functionality by using the Microsoft Agent Framework (Sequential Orchestration), but we are encountering JSON parsing issues and are not getting the expected results.
We have modified a couple of agent instructions, which is now allowing the functionality to run correctly.

Question 1:
What is the actual reason behind (root cause) the need to change the instructions of the agents when running through the Agent Framework? Is this because we are using the AI Foundry–Classic agent with the same deployment model, temperature, and top P values?
Earlier, we used the following instructions to invoke the tool in AI Foundry–Classic (Persistent Agent):

Call: myisp_save_solution_parameters(
solutionVersionId, solutionId, enterpriseId,
inputJson (from 2c),
onShoreCountry (from 2b or null),
offShoreCountry (from 2b or null),
nearShoreCountry (from 2b or null),
conversationID (from context),
messageID (from context)
)

The same instructions are not working when invoked through the Agent Framework. Therefore, we updated them as shown below, which resolved the problem. In both cases, we have used the GPT 4.1 deployment model.

** EXECUTE: myisp_save_solution_parameters**

{
  "tool": "myisp_save_solution_parameters",
  "parameters": {
    "solutionVersionId": <int from extraction>,
    "solutionId": <int from extraction>,
    "enterpriseId": "<string from extraction>",
    "inputJson": "<stringified JSON from Step 2c>",
    "onShoreCountry": "<string from 2b or omit>",
    "offShoreCountry": "<string from 2b or omit>",
    "nearShoreCountry": "<string from 2b or omit>"
    "conversationId": "<REQUIRED - string from session context>",
         "messageId": "<REQUIRED - string from session context>"

  }
}

Question2:
The input JSON formed in the thread logs for both the failed and successful scenarios is able to invoke the MCP tools successfully using Postman. Why does it fail intermittently only during agent invocation?

postman failure scenerio:
Input Json:
myisp_save_solution_parameters: {"request":{"solutionVersionId":"207475","solutionId":"52869","onShoreCountry":"Usa(100%)","offShoreCountry":null,"enterpriseId":"jagadeesh.madepalli","inputJson":"{"startdate":"09/01/2027","enddate":"08/31/2030","currency":null,"profiles":[{"country":"Usa(100%)","workCountry":"Usa(100%)","payrollCountry":"Usa(100%)","rateType":"GCP | Tier1 | ctyB","economicProfile":"INDUSTRIALIZED TECHNOLOGY SERVICES LONG TERM","city":"Anchorage","isCustomProfile":true,"isDefaultAndCustomProfile":false}],"isDefaultAndCustomProfile":false}","nearShoreCountry":null,"conversationID":"1723cab7-560c-484e-95bd-29cb10e5deec","messageID":"bb9b2e3b-cfbc-4cb8-b427-c65ee5914594"}}
Output:

Image Image

Postman Success Scenerio:
Input Json:
myisp_save_solution_parameters: {"request":{"solutionVersionId":"207482","solutionId":"52869","onShoreCountry":"Usa(100%)","enterpriseId":"jagadeesh.madepalli","inputJson":"{"startdate":"09/01/2027","enddate":"08/31/2030","currency":null,"profiles":[{"country":"Usa","workCountry":"Usa","payrollCountry":"Usa","rateType":"GCP | Tier1 | ctyB","economicProfile":"INDUSTRIALIZED TECHNOLOGY SERVICES LONG TERM","city":"Anchorage","isCustomProfile":true,"isDefaultAndCustomProfile":false}],"isDefaultAndCustomProfile":false}","conversationID":"1723cab7-560c-484e-95bd-29cb10e5deec","messageID":"afee35f5-a2ad-4462-a136-8e5683250431"}}
Output:

Image Image

Code Sample

Error Messages / Stack Traces

Package Versions

agent-framework==1.0.0b260116

Python Version

3.13.2

Additional Context

No response

Metadata

Metadata

Assignees

Labels

bugSomething isn't workingpythonv1.0Features being tracked for the version 1.0 GAworkflowsRelated to Workflows in agent-framework

Type

Projects

Status

No status

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions