mirror of
https://github.com/open-webui/open-webui.git
synced 2026-08-27 07:54:55 -06:00
perf: replace JSON.parse(JSON.stringify()) with structuredClone in layout (#22104)
Replace JSON roundtrip with native structuredClone for tool execution result cloning. Also remove unnecessary JSON roundtrip on a static error object literal that is already a fresh value.
This commit is contained in:
@@ -343,17 +343,11 @@
|
||||
}
|
||||
|
||||
if (cb) {
|
||||
cb(JSON.parse(JSON.stringify(res)));
|
||||
cb(structuredClone(res));
|
||||
}
|
||||
} else {
|
||||
if (cb) {
|
||||
cb(
|
||||
JSON.parse(
|
||||
JSON.stringify({
|
||||
error: 'Tool Server Not Found'
|
||||
})
|
||||
)
|
||||
);
|
||||
cb({ error: 'Tool Server Not Found' });
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user