Skip to content

Python: Emit tool call events in GitHubCopilotAgent streaming#4711

Open
jsturtevant wants to merge 3 commits intomicrosoft:mainfrom
jsturtevant:copilot-tools
Open

Python: Emit tool call events in GitHubCopilotAgent streaming#4711
jsturtevant wants to merge 3 commits intomicrosoft:mainfrom
jsturtevant:copilot-tools

Conversation

@jsturtevant
Copy link

_stream_updates now yields FunctionCallContent for TOOL_EXECUTION_START and FunctionResultContent for TOOL_EXECUTION_COMPLETE events from the Copilot SDK session. This enables DevUI and other consumers to display tool calls during streaming agent execution. Previously only ASSISTANT_MESSAGE_DELTA, SESSION_IDLE, and SESSION_ERROR were handled — tool execution events were silently dropped.

Motivation and Context

Description

Contribution Checklist

  • The code builds clean without any errors or warnings
  • The PR follows the Contribution Guidelines
  • All unit tests pass, and I have added new tests where possible
  • Is this a breaking change? If yes, add "[BREAKING]" prefix to the title of the PR.

_stream_updates now yields FunctionCallContent for TOOL_EXECUTION_START
and FunctionResultContent for TOOL_EXECUTION_COMPLETE events from the
Copilot SDK session. This enables DevUI and other consumers to display
tool calls during streaming agent execution. Previously only ASSISTANT_MESSAGE_DELTA, SESSION_IDLE, and SESSION_ERROR
were handled — tool execution events were silently dropped.

Signed-off-by: James Sturtevant <jsturtevant@gmail.com>
Copilot AI review requested due to automatic review settings March 15, 2026 20:07
@github-actions github-actions bot changed the title Emit tool call events in GitHubCopilotAgent streaming Python: Emit tool call events in GitHubCopilotAgent streaming Mar 15, 2026
@markwallace-microsoft
Copy link
Member

markwallace-microsoft commented Mar 15, 2026

Python Test Coverage

Python Test Coverage Report •
FileStmtsMissCoverMissing
TOTAL23998264288% 
report-only-changed-files is enabled. No files were changed during this commit :)

Python Unit Test Overview

Tests Skipped Failures Errors Time
5227 20 💤 0 ❌ 0 🔥 1m 24s ⏱️

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR extends the GitHub Copilot Python agent’s streaming event handling to surface tool execution start/complete events as AgentResponseUpdate chunks, enabling downstream consumers to observe tool calls/results during a streamed run.

Changes:

  • Convert SessionEventType.TOOL_EXECUTION_START into Content.from_function_call(...) streaming updates.
  • Convert SessionEventType.TOOL_EXECUTION_COMPLETE into Content.from_function_result(...) streaming updates.

Signed-off-by: James Sturtevant <jsturtevant@gmail.com>
Signed-off-by: James Sturtevant <jsturtevant@gmail.com>
@moonbox3
Copy link
Contributor

@jsturtevant please link an issue to this PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants