@blockrun/clawrouter 0.12.83 → 0.12.84

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -50264,6 +50264,19 @@ data: [DONE]
50264
50264
  }
50265
50265
  }
50266
50266
  let responseBody = Buffer.concat(bodyParts);
50267
+ if (responseBody.length > 0) {
50268
+ try {
50269
+ const parsed = JSON.parse(responseBody.toString());
50270
+ if (parsed.choices?.[0]?.message?.content) {
50271
+ const stripped = stripThinkingTokens(parsed.choices[0].message.content);
50272
+ if (stripped !== parsed.choices[0].message.content) {
50273
+ parsed.choices[0].message.content = stripped;
50274
+ responseBody = Buffer.from(JSON.stringify(parsed));
50275
+ }
50276
+ }
50277
+ } catch {
50278
+ }
50279
+ }
50267
50280
  if (balanceFallbackNotice && responseBody.length > 0) {
50268
50281
  try {
50269
50282
  const parsed = JSON.parse(responseBody.toString());