Skip to content

Conversation

@roomote
Copy link

@roomote roomote bot commented Nov 8, 2025

Summary

This PR attempts to address Issue #9125 by implementing support for preserving reasoning details between conversation turns for OpenRouter models.

Problem

OpenRouter reasoning details weren't being preserved between conversation turns, breaking reasoning continuity for models like MiniMax-M2. This impacted the quality of responses in complex tasks that require the model to build upon previous reasoning.

Solution

  • Added preserveReasoning flag to ModelInfo type for reasoning-capable models
  • Set preserveReasoning=true for OpenRouter models that support reasoning (via reasoning or include_reasoning parameters)
  • Ensured reasoning content is included in conversation history when preserveReasoning is enabled
  • Added comprehensive tests to verify the functionality

Changes

  • Modified src/api/providers/fetchers/openrouter.ts to detect reasoning support and set the flag
  • Updated tests in src/api/providers/fetchers/__tests__/openrouter.spec.ts to verify the behavior

Testing

  • All existing tests pass
  • Added new test cases specifically for preserveReasoning functionality
  • Verified that reasoning-capable models have the flag set correctly

Fixes #9125

Feedback and guidance are welcome!


Important

Adds preserveReasoning flag to ModelInfo for OpenRouter models to maintain reasoning continuity between conversation turns.

  • Behavior:
    • Adds preserveReasoning flag to ModelInfo for reasoning-capable models in openrouter.ts.
    • Sets preserveReasoning=true for models supporting reasoning or include_reasoning parameters.
    • Ensures reasoning content is included in conversation history when preserveReasoning is enabled.
  • Testing:
    • Updates openrouter.spec.ts to test preserveReasoning functionality for models with and without reasoning support.
    • Verifies preserveReasoning is correctly set for specific models like claude-3.7-sonnet:thinking and claude-haiku-4.5.

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

…sation turns

- Add preserveReasoning flag to ModelInfo for reasoning-capable models
- Set preserveReasoning=true for OpenRouter models that support reasoning
- Ensure reasoning content is included in conversation history for continuity
- Add comprehensive tests for preserveReasoning functionality

Fixes #9125
@roomote roomote bot requested review from cte, jr and mrubens as code owners November 8, 2025 12:04
@dosubot dosubot bot added size:L This PR changes 100-499 lines, ignoring generated files. bug Something isn't working labels Nov 8, 2025
@roomote
Copy link
Author

roomote bot commented Nov 8, 2025

Rooviewer Clock   See task on Roo Cloud

Review completed - no issues found. The implementation correctly adds preserveReasoning flag support for OpenRouter models with comprehensive test coverage.

Mention @roomote in a comment to request specific changes to this pull request or fix all unresolved issues.

@hannesrudolph hannesrudolph added the Issue/PR - Triage New issue. Needs quick review to confirm validity and assign labels. label Nov 8, 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:L This PR changes 100-499 lines, ignoring generated files.

Projects

Status: Triage

Development

Successfully merging this pull request may close these issues.

[ENHANCEMENT] Openrouter provider supports reasoning_details

3 participants