fix: format object-type tool input correctly in formatToolJson

This commit is contained in:
Liu
2026-03-24 17:05:44 +08:00
parent db86ff4ce3
commit b7c81965a1
@@ -1125,6 +1125,9 @@ function chatPage() {
formatToolJson: function(text) {
if (!text) return '';
if (typeof text === 'object') {
return JSON.stringify(text, null, 2);
}
try { return JSON.stringify(JSON.parse(text), null, 2); }
catch(e) { return text; }
},