mirror of
https://github.com/vxcontrol/pentagi.git
synced 2026-07-21 08:15:23 -04:00
[PR #190] [CLOSED] fix: enable reasoning content preservation for OpenAI, GLM, and Qwen providers #225
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/vxcontrol/pentagi/pull/190
Author: @mason5052
Created: 3/10/2026
Status: ❌ Closed
Base:
master← Head:fix/glm-qwen-preserve-reasoning📝 Commits (2)
a7180dafix: enable reasoning content preservation for GLM and Qwen providers6fb3873fix: also enable reasoning content preservation for OpenAI provider📊 Changes
3 files changed (+3 additions, -0 deletions)
View changed files
📝
backend/pkg/providers/glm/glm.go(+1 -0)📝
backend/pkg/providers/openai/openai.go(+1 -0)📝
backend/pkg/providers/qwen/qwen.go(+1 -0)📄 Description
Summary
OpenAI, GLM, and Qwen providers have models that support thinking/reasoning mode but their OpenAI client initialization was missing the
WithPreserveReasoningContent()option. DeepSeek and Kimi providers already have this option enabled. This inconsistency could cause reasoning content to be silently dropped during inference when using thinking-capable models.Changes
openai.WithPreserveReasoningContent()toopenai.New()call inbackend/pkg/providers/openai/openai.goopenai.WithPreserveReasoningContent()toopenai.New()call inbackend/pkg/providers/glm/glm.goopenai.WithPreserveReasoningContent()toopenai.New()call inbackend/pkg/providers/qwen/qwen.goThis makes all
openai.New()-based providers consistent with DeepSeek and Kimi.Provider Comparison (Before / After)
Test plan
go build ./pkg/providers/openai/ ./pkg/providers/glm/ ./pkg/providers/qwen/🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.