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).

c3f36b2b9f124cf27fb06985e6a06a590d947103

DN2331 <92578034+DN2331@users.noreply.github.com>

Signed
1 files changed, +2 -0Showing whitespace changes
src/prompt-converters.js+2 -0
@@ -1425,7 +1425,9 @@ export function addOpenRouterSignatures(messages, model) {
14251425 details.push(detail);
14261426 };
14271427 if (typeof message.signature === 'string') {
1428+ if (enableThoughtSignatures) {
14281429 addDetail(message.signature);
1430+ }
14291431 delete message.signature;
14301432 }
14311433 if (Array.isArray(message.tool_calls)) {