Skip to content

Conversation

@devcrocod
Copy link
Contributor

KG-432
KG-297

Motivation and Context

A new message type has been added: Reasoning

Breaking Changes

Yes,
The implementation of Anthropic messages has been modified for future support and schema compliance


Type of the changes

  • New feature (non-breaking change which adds functionality)
  • Bug fix (non-breaking change which fixes an issue)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Documentation update
  • Tests improvement
  • Refactoring

Checklist

  • The pull request has a description of the proposed change
  • I read the Contributing Guidelines before opening the pull request
  • The pull request uses develop as the base branch
  • Tests for the changes have been added
  • All new and existing tests passed
Additional steps for pull requests adding a new feature
  • An issue describing the proposed change exists
  • The pull request includes a link to the issue
  • The change was discussed and approved in the issue
  • Docs have been added / updated

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 pull request introduces support for Message.Reasoning interactions across multiple LLM clients to implement a new reasoning capability. The feature enables AI models to expose their internal thinking processes as structured messages.

  • Adds a new Message.Reasoning message type with associated Thinking interface
  • Updates all client implementations to handle reasoning messages appropriately
  • Modifies serialization classes to use sealed interfaces with proper role discrimination

Reviewed Changes

Copilot reviewed 21 out of 21 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
Message.kt Adds new Reasoning message type and Thinking interface
StreamFrameExt.kt Extends stream frame handling to support reasoning content
OpenAI clients Implements reasoning support with proper conversion between internal types
Google client Adds reasoning handling for thought-enabled parts
Anthropic clients Updates message structure to sealed interfaces and adds reasoning support
Bedrock clients Implements reasoning for Anthropic models, throws NotImplementedError for others
Ollama client Throws NotImplementedError for reasoning (not supported)
OpenTelemetry features Updates event handling to include reasoning messages
Memory features Adds reasoning message formatting in conversation history

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@devcrocod devcrocod marked this pull request as ready for review October 9, 2025 14:29
@github-actions
Copy link

github-actions bot commented Oct 9, 2025

Qodana for JVM

17424 new problems were found

Inspection name Severity Problems
Unused import directive 🔶 Warning 16213
Check Kotlin and Java source code coverage 🔶 Warning 1198
Missing KDoc for public API declaration 🔶 Warning 11
If-Null return/break/... foldable to '?:' ◽️ Notice 2
@@ Code coverage @@
+ 70% total lines covered
15921 lines analyzed, 11209 lines covered
# Calculated according to the filters of your coverage tool

☁️ View the detailed Qodana report

Contact Qodana team

Contact us at [email protected]

@EugeneTheDev EugeneTheDev self-requested a review October 10, 2025 18:16
@devcrocod devcrocod force-pushed the devcrocod/reasoning-message branch from f95cf54 to d704f74 Compare October 22, 2025 19:22
Copy link
Contributor

@sdubov sdubov left a comment

Choose a reason for hiding this comment

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

Looks good for me. Open Telemetry does not have any special handling for such cases. The rest looks good from my side as well.

Copy link
Collaborator

@EugeneTheDev EugeneTheDev left a comment

Choose a reason for hiding this comment

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

Looks good now, thank you. A couple of small comments

@devcrocod devcrocod force-pushed the devcrocod/reasoning-message branch from 022356d to 1b0eef1 Compare October 28, 2025 12:45
@devcrocod devcrocod force-pushed the devcrocod/reasoning-message branch from 1b0eef1 to fcc8c4c Compare October 28, 2025 13:43
public data class Reasoning(
public val id: String? = null,
public val encrypted: String? = null,
override val parts: List<ContentPart>,
Copy link
Collaborator

Choose a reason for hiding this comment

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

Let's limit it to the List<ContentPart.Text> since only text content is supported here

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.

4 participants