From c3f36b2b9f124cf27fb06985e6a06a590d947103 Mon Sep 17 00:00:00 2001 From: DN2331 <92578034+DN2331@users.noreply.github.com> Date: Thu, 19 Mar 2026 00:20:40 +0800 Subject: [PATCH] fix(openrouter): respect enableThoughtSignatures setting for message signatures (#5318) The addOpenRouterSignatures function was previously converting and appending message.signature to reasoning_details unconditionally, ignoring the `enableThoughtSignatures` setting. This change adds a check for `enableThoughtSignatures` before converting message.signature, while still ensuring the original signature property is deleted to prevent API schema validation errors (HTTP 400). --- src/prompt-converters.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/prompt-converters.js b/src/prompt-converters.js index 5941569c7..5b87c1017 100644 --- a/src/prompt-converters.js +++ b/src/prompt-converters.js @@ -1425,7 +1425,9 @@ export function addOpenRouterSignatures(messages, model) { details.push(detail); }; if (typeof message.signature === 'string') { - addDetail(message.signature); + if (enableThoughtSignatures) { + addDetail(message.signature); + } delete message.signature; } if (Array.isArray(message.tool_calls)) {