@ducci/jarvis 1.0.98 → 1.0.99
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/package.json +1 -1
- package/src/server/agent.js +2 -1
package/package.json
CHANGED
package/src/server/agent.js
CHANGED
|
@@ -22,7 +22,8 @@ function stripCodeFence(text) {
|
|
|
22
22
|
// JSON string values — models sometimes forget to escape \n as \\n
|
|
23
23
|
// 3. Remove trailing commas before } and ] (JS-valid but JSON-invalid)
|
|
24
24
|
function sanitizeJson(text) {
|
|
25
|
-
|
|
25
|
+
// Strip <think>...</think> blocks (e.g. MiniMax reasoning traces) before JSON parsing
|
|
26
|
+
let s = stripCodeFence(text).replace(/<think>[\s\S]*?<\/think>/g, '').trim();
|
|
26
27
|
|
|
27
28
|
// State machine: walk the string and fix unescaped control chars inside strings
|
|
28
29
|
let result = '';
|