microsoft / microsoft/agent-framework
.NET: [Bug]: Surface Foundry OAuth consent response items as typed agent content
@javiercn is already working on this.
Since Aug 19, 2026.
- Dominant language
- Python
- Stars
- 13.6k
- Forks
- 2.3k
- Avg merge
- 2d 45m
- Merged PRs (30d)
- 358
Description
### Description
Foundry Agent Service emits an OAuth consent request as a `response.output_item.done` event whose nested item has `type: "oauth_consent_request"`. In the current .NET `FoundryChatClient` streaming path, the event reaches consumers only through:
```text
AgentResponseUpdate.RawRepresentation
-> ChatResponseUpdate.RawRepresentation
-> UnknownResponseStreamEvent
```
The complete provider payload is preserved and can be recovered with `ModelReaderWriter.Write()`, but consumers must inspect provider-specific JSON to obtain `id`, `consent_link`, and `server_label`.
The Foundry adapter should recognize this service item and surface it as typed agent content or a typed public raw representation. The representation should preserve the consent-request ID, consent link, server label, and response ID so hosting integrations can map it without parsing provider JSON.
This issue is provider adaptation only. It should not introduce an AG-UI-specific event; AG-UI applications can map the typed content through existing custom-event extensibility.
### Code Sample
```csharp
await foreach (AgentResponseUpdate update in agent.RunStreamingAsync(prompt))
{
// Expected: typed OAuth consent content or typed raw representation.
}
```
### Error Messages / Stack Traces
N/A
### Package Versions
Current agent-framework main; OpenAI 2.10.0.
### .NET Version
.NET 10
### Additional Context
Foundry OAuth flow: https://learn.microsoft.com/azure/foundry/agents/how-to/mcp-authentication#oauth-identity-passthrough
Supersedes the provider-adaptation portion of #6032.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.