microsoft / microsoft/agent-framework
.NET: [Feature]: Support resumable GitHubCopilotAgent permission requests across turns
@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
GitHubCopilotAgent exposes unhandled Copilot SDK session events through AIContent.RawRepresentation, including PermissionRequestedEvent. This is sufficient for applications and protocol adapters to define their own mapping.
The remaining provider-level gap is the permission lifecycle. The Copilot SDK callback model waits inside one active session, while an Agent Framework interaction may need to expose the permission request, end the current agent turn, receive a response in a later turn, and then continue the pending Copilot work.
GitHubCopilotAgent currently disposes its CopilotSession when its streaming enumeration ends. A delegating agent can map the raw permission event to ToolApprovalRequestContent or another request representation, but it cannot safely end the turn unless the provider preserves the pending permission and supports resumption.
The Copilot SDK already exposes the required primitives:
PermissionRequestedEvent.Data.RequestId;session.Rpc.Permissions.PendingRequestsAsync();session.Rpc.Permissions.HandlePendingPermissionRequestAsync(...);ResumeSessionConfig.ContinuePendingWork.
Expected behavior:
- When a permission is requested,
GitHubCopilotAgentpreserves the Copilot session ID, pending permission request ID, and relevant metadata in theAgentSession. - The current Agent Framework turn can end without losing or denying the pending request.
- On a later turn, the agent accepts a response correlated by request ID.
- The provider resumes the Copilot session with
ContinuePendingWork = true. - The provider calls
HandlePendingPermissionRequestAsync(...)with the approved or denied decision. - Tool execution and assistant output continue normally after the decision.
- Stale, duplicate, expired, or mismatched responses are rejected, and a permission request can be completed only once.
- The raw
PermissionRequestedEventremains available so applications can map it through a delegate orDelegatingAIAgentwithout introducing transport-specific behavior into the provider.
For tool permissions, applications can map the raw event to existing MEAI approval content:
PermissionRequestedEvent? permission = update.Contents
.Select(content => content.RawRepresentation)
.OfType<PermissionRequestedEvent>()
.FirstOrDefault();
if (permission is not null)
{
var toolCall = new FunctionCallContent(
permission.Data.RequestId,
GetToolName(permission.Data.PermissionRequest),
GetArguments(permission.Data.PermissionRequest))
{
RawRepresentation = permission,
};
yield return new AgentResponseUpdate(
ChatRole.Assistant,
[new ToolApprovalRequestContent(permission.Data.RequestId, toolCall)
{
RawRepresentation = permission,
}]);
yield break;
}
The provider owns preserving and resuming the pending Copilot permission; the mapping layer owns how the request is represented to a caller or transport.
Code Sample
See the proposed flow above.
Language/SDK
.NET
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.