Skip to content

Conversation

@sr-anam
Copy link
Contributor

@sr-anam sr-anam commented Jan 5, 2026

Adds an event to handle reasoning responses from thinking/reasoning models via the REASONING_TEXT event sent over the webrtc datachannel.

These are forwarded to the user via a new AnamEvent REASONING_STREAM_EVENT_RECEIVED / REASONING_HISTORY_UPDATED


Summary by cubic

Adds WebRTC reasoning text handling and a reasoning stream so clients can display live reasoning and receive final reasoning history.

  • New Features
    • Handle DataChannelMessage.REASONING_TEXT in StreamingClient and emit InternalEvent.WEBRTC_REASONING_TEXT_MESSAGE_RECEIVED.
    • Add ReasoningHistoryClient (initialized in AnamClient) to emit REASONING_STREAM_EVENT_RECEIVED and REASONING_HISTORY_UPDATED.
    • Add types and callbacks for WebRtcReasoningTextMessageEvent, ReasoningMessage, and ReasoningStreamEvent.

Written for commit ce0f26e. Summary will update on new commits.

Copilot AI review requested due to automatic review settings January 5, 2026 17:15
Copy link

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 adds support for handling reasoning events from thinking/reasoning models by introducing a new REASONING_TEXT event type for WebRTC data channel communication. When reasoning responses are received via the data channel, they are forwarded to users through a new REASONING_TEXT_MESSAGE_RECEIVED event.

  • Adds REASONING_TEXT data channel message type
  • Creates WebRtcReasoningTextMessageEvent interface to type reasoning event data
  • Implements event handling logic to emit reasoning events to users

Reviewed changes

Copilot reviewed 7 out of 7 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
src/types/streaming/index.ts Exports the new WebRtcReasoningTextMessageEvent type
src/types/streaming/WebRtcReasoningTextMessageEvent.ts Defines the interface for reasoning text message events
src/types/streaming/DataChannelMessage.ts Adds REASONING_TEXT enum value for the new message type
src/types/events/public/EventCallbacks.ts Adds callback signature for the new reasoning event
src/types/events/public/AnamEvent.ts Adds REASONING_TEXT_MESSAGE_RECEIVED event enum
src/types/AgentAudioInputStream.ts Reformats arrow function for consistency
src/modules/StreamingClient.ts Implements reasoning event handling in the data channel message switch

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copy link

@cubic-dev-ai cubic-dev-ai bot left a comment

Choose a reason for hiding this comment

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

No issues found across 7 files

@sr-anam sr-anam force-pushed the sam/thinking_models branch from b9389de to 9d70a1c Compare January 5, 2026 17:21
ao-anam
ao-anam previously approved these changes Jan 5, 2026
Copy link
Contributor

@ao-anam ao-anam left a comment

Choose a reason for hiding this comment

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

@sr-anam sr-anam force-pushed the sam/thinking_models branch from 5c268b8 to ce0f26e Compare January 6, 2026 15:05
Copy link
Contributor

@ao-anam ao-anam left a comment

Choose a reason for hiding this comment

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

@sr-anam sr-anam merged commit 26d85af into main Jan 7, 2026
3 checks passed
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.

3 participants