Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Jan 31, 2026

Motivation and Context

GitHub Copilot SDK emits AssistantReasoningEvent and AssistantReasoningDeltaEvent for model reasoning/thinking output. GitHubCopilotAgent was not handling these events, causing reasoning content to be lost or stored as generic AIContent instead of the semantically correct TextReasoningContent.

Description

C# Implementation (GitHubCopilotAgent.cs)

  • Added case handlers for AssistantReasoningDeltaEvent and AssistantReasoningEvent
  • Map AssistantReasoningDeltaEvent.Data.DeltaContentTextReasoningContent (streaming)
  • Map AssistantReasoningEvent.Data.ContentTextReasoningContent (complete)
  • Handle null data/content gracefully

Python Implementation (_agent.py)

  • Added handlers for SessionEventType.ASSISTANT_REASONING_DELTA and SessionEventType.ASSISTANT_REASONING
  • Create AgentResponseUpdate with Content.from_text_reasoning()

Tests

  • C#: 6 unit tests covering event conversion and null handling
  • Python: 2 streaming tests with reasoning event fixtures

Follows existing event handling patterns (e.g., AssistantMessageDeltaEventTextContent).

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.
Original prompt

Teach the GitHubCopilotAgent about AssistentReasoningEvent and AssistantReasoningDeltaEvent, mapping them to TextReasoningContent.


💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

Copilot AI changed the title [WIP] Add mapping for AssistentReasoningEvent and AssistantReasoningDeltaEvent Add AssistantReasoningEvent and AssistantReasoningDeltaEvent support to GitHubCopilotAgent Jan 31, 2026
Copilot AI requested a review from stephentoub January 31, 2026 21:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants