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, +3 -1Ignore whitespace
src/prompt-converters.js+3 -1
@@ -1425,7 +1425,9 @@ export function addOpenRouterSignatures(messages, model) {
1425 details.push(detail);1425 details.push(detail);
1426 };1426 };
1427 if (typeof message.signature === 'string') {1427 if (typeof message.signature === 'string') {
1428 addDetail(message.signature);1428 if (enableThoughtSignatures) {
1429 addDetail(message.signature);
1430 }
1429 delete message.signature;1431 delete message.signature;
1430 }1432 }
1431 if (Array.isArray(message.tool_calls)) {1433 if (Array.isArray(message.tool_calls)) {