Skip to content

Python: [Bug]: oauth_consent_request produces error within same session #7166

Description

@cecheta

Description

Following the sample https://github.com/microsoft/agent-framework/tree/main/python/samples/04-hosting/foundry-hosted-agents/responses/04_foundry_toolbox, using the ghmcpoauth auth, I found that after accepting the oauth_consent_request by clicking the consent link, then sending a follow-up request using the previous response ID (as explained here), all subsequent requests failed with the following:

"error": {
  "code": "server_error",
  "message": "MCP server failed to initialize: Cancelled via cancel scope 7f3360511e50"
},

If you try again with a new conversation, then it works.

Code Sample

Error Messages / Stack Traces

"error": {
  "code": "server_error",
  "message": "MCP server failed to initialize: Cancelled via cancel scope 7f3360511e50"
},

Package Versions

agent-framework-foundry-hosting: 1.0.0a260709

Python Version

Python 3.13.14

Additional Context

No response

Metadata

Metadata

Assignees

Labels

hostingUsage: [Issues, PRs], Target: all hosting related solutionspythonUsage: [Issues, PRs], Target: PythonreproducedUsage: [Issues], Target: all issues that can be reproduced by the triage workflow

Type

Projects

Status
Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions