chore(sanitizer): remove explanatory reasoning comments

Keep the tool/function-call preservation logic intact while removing noisy implementation comments from the PR diff.

Co-Authored-By: OpenClaude (dmassoneto) <openclaude@gitlawb.com>
This commit is contained in:
DavyMassoneto
2026-05-10 21:12:30 -03:00
parent 9e7cb90a01
commit 82a5bb3778
2 changed files with 0 additions and 6 deletions

View File

@@ -285,10 +285,6 @@ function sanitizeMessage(msg: unknown): unknown {
// Non-streaming responses should not expose both visible content and reasoning_content.
// Some clients drop the visible assistant text or render duplicated panels when both fields
// are present in the final payload. Keep reasoning_content only for reasoning-only messages.
// EXCEPTION: When tool_calls (or legacy function_call) are present, reasoning_content
// must be preserved because thinking-enabled providers (e.g., Kimi) require it on
// assistant tool call messages. Without it, subsequent requests fail with:
// "thinking is enabled but reasoning_content is missing in assistant tool call message"
if (
sanitized.reasoning_content !== undefined &&
hasVisibleMessageContent(sanitized.content) &&

View File

@@ -58,8 +58,6 @@ test("sanitizeOpenAIResponse extracts thinking, collapses newlines, preserves re
assert.equal((sanitized as any).choices[0].index, 2);
assert.equal((sanitized as any).choices[0].finish_reason, "tool_calls");
(assert as any).equal((sanitized as any).choices[0].message.content, "Hello\n\nworld");
// reasoning_content extracted from <think> tags is preserved when tool_calls exist
// because thinking-enabled providers require it on assistant tool call messages
assert.equal((sanitized as any).choices[0].message.reasoning_content, "internal chain");
(assert as any).deepEqual((sanitized as any).choices[0].message.tool_calls, [{ id: "call_1" }]);
assert.deepEqual((sanitized as any).choices[0].message.function_call, { name: "legacy" });