Skip to content

Conversation

@roomote
Copy link

@roomote roomote bot commented Oct 25, 2025

Per request to create a new PR that only adds extra_body for DeepSeek V3.1 Terminus (no integration test changes). Implementation: in OpenRouterHandler, add extra_body with chat_template_kwargs.thinking for DeepSeek-V3.1-Terminus and avoid passing the OpenRouter reasoning param for this model. Relevant unit tests pass locally.


Important

Add extra_body for DeepSeek V3.1 Terminus in OpenRouterHandler to control reasoning, replacing reasoning param for this model.

  • Behavior:
    • Add extra_body parameter in OpenRouterHandler for DeepSeek V3.1 Terminus to control reasoning.
    • extra_body uses chat_template_kwargs.thinking based on reasoning settings.
    • Skip reasoning param for DeepSeek V3.1 Terminus; use extra_body instead.
  • Implementation:
    • Modify createMessage and completePrompt methods in openrouter.ts to include extra_body for DeepSeek V3.1 Terminus.
    • Check modelId for "DeepSeek-V3.1-Terminus" to conditionally apply extra_body.

This description was created by Ellipsis for 8bcbaf5. You can customize this summary. It will automatically update as commits are pushed.

@roomote roomote bot requested review from cte, jr and mrubens as code owners October 25, 2025 04:07
@dosubot dosubot bot added size:M This PR changes 30-99 lines, ignoring generated files. bug Something isn't working labels Oct 25, 2025
@roomote
Copy link
Author

roomote bot commented Oct 25, 2025

Review Summary

I've reviewed the changes in this PR. Found 2 code quality improvements:

  • Remove unnecessary type assertion at line 151 - use reasoning?.exclude instead of (reasoning as any)?.exclude
  • Remove unnecessary type assertion at line 270 - use reasoning?.exclude instead of (reasoning as any)?.exclude

The implementation correctly adds extra_body support for DeepSeek V3.1 Terminus and properly conditionally includes the OpenRouter reasoning parameter. The logic appears sound, but the type assertions can be simplified since OpenRouterReasoningParams already defines the exclude property.

Follow Along on Roo Code Cloud

? {
chat_template_kwargs: {
// Default OFF unless explicitly requested via reasoning settings
thinking: Boolean(reasoning) && !(reasoning as any)?.exclude,
Copy link
Author

Choose a reason for hiding this comment

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

The type assertion (reasoning as any)?.exclude is unnecessary. Since reasoning is of type OpenRouterReasoningParams | undefined and OpenRouterReasoningParams already has exclude?: boolean as a property, you can safely use reasoning?.exclude instead. Removing the as any cast improves type safety and maintainability.

Suggested change
thinking: Boolean(reasoning) && !(reasoning as any)?.exclude,
thinking: Boolean(reasoning) && !reasoning?.exclude,

? {
chat_template_kwargs: {
// Default OFF unless explicitly requested via reasoning settings
thinking: Boolean(reasoning) && !(reasoning as any)?.exclude,
Copy link
Author

Choose a reason for hiding this comment

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

The type assertion (reasoning as any)?.exclude is unnecessary here as well. Since reasoning is of type OpenRouterReasoningParams | undefined and OpenRouterReasoningParams already has exclude?: boolean as a property, you can safely use reasoning?.exclude instead.

Suggested change
thinking: Boolean(reasoning) && !(reasoning as any)?.exclude,
thinking: Boolean(reasoning) && !reasoning?.exclude,

@hannesrudolph hannesrudolph added the Issue/PR - Triage New issue. Needs quick review to confirm validity and assign labels. label Oct 25, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working Issue/PR - Triage New issue. Needs quick review to confirm validity and assign labels. size:M This PR changes 30-99 lines, ignoring generated files.

Projects

Status: Triage

Development

Successfully merging this pull request may close these issues.

2 participants