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