Skip to content

Fix reasoning_content error in tool calls for kimi-k2.5 and other thi…#876

Open
jdhxyy wants to merge 1 commit intosipeed:mainfrom
jdhxyy:main
Open

Fix reasoning_content error in tool calls for kimi-k2.5 and other thi…#876
jdhxyy wants to merge 1 commit intosipeed:mainfrom
jdhxyy:main

Conversation

@jdhxyy
Copy link

@jdhxyy jdhxyy commented Feb 27, 2026

…nking models

📝 Description

🗣️ Type of Change

  • 🐞 Bug fix (non-breaking change which fixes an issue)
  • ✨ New feature (non-breaking change which adds functionality)
  • 📖 Documentation update
  • ⚡ Code refactoring (no functional changes, no api changes)

🤖 AI Code Generation

  • 🤖 Fully AI-generated (100% AI, 0% Human)
  • 🛠️ Mostly AI-generated (AI draft, Human verified/modified)
  • 👨‍💻 Mostly Human-written (Human lead, AI assisted or none)

🔗 Related Issue

Fixes #588

📚 Technical Context (Skip for Docs)

  • Reference URL:
  • Reasoning:

🧪 Test Environment

  • Hardware:
  • OS:
  • Model/Provider:
  • Channels:

📸 Evidence (Optional)

Click to view Logs/Screenshots

☑️ Checklist

  • My code/docs follow the style of this project.
  • I have performed a self-review of my own changes.
  • I have updated the documentation accordingly.

Copy link

@nikolasdehor nikolasdehor left a comment

Choose a reason for hiding this comment

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

Good targeted fix for #588. The field naming (ReasoningContent) is consistent with the existing Message struct. Two observations: (1) Incomplete fix? This PR preserves reasoning_content in the outbound serialization (stripSystemParts), but I don't see where response.ReasoningContent is copied into the assistant Message during tool loop execution. Without that, the ReasoningContent field will be empty for assistant messages created in toolloop.go. PR #889 addresses this in toolloop.go:109 — you may need to add that piece here too, or coordinate with that PR. (2) Unrelated .gitignore change: The __debug_bin patterns are fine but would be cleaner as a separate commit. (3) Test: Consider adding a test for stripSystemParts that verifies ReasoningContent is preserved. The core approach is correct — please verify the tool loop path is also covered.

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.

[Bug] Moonshot kimi-k2.5 reasoning_content missing in tool calls leads to API Error 400

2 participants