Xiangzhe b89293418d fix: return Error objects from invokeFunctionTool and create error invocations (#5351)
* fix: return Error objects from invokeFunctionTool and create error invocations

invokeFunctionTool previously called .toString() on caught errors,
converting them to plain strings. This made the instanceof Error
check in invokeFunctionTools dead code.

Changes:
- Return Error objects directly from invokeFunctionTool
- Create error invocations with error: true flag when tools fail
- Record failed stealth tools in stealthCalls
- Preserve signature/reasoning on error invocations
- Add error field to ToolInvocation typedef

* fix: use Error.toString to avoid behavioral changes

---------

Co-authored-by: Cohee <18619528+Cohee1207@users.noreply.github.com>
2026-03-30 23:26:48 +03:00
2025-07-22 23:34:41 +03:00
2024-01-10 21:41:12 +02:00
2026-03-28 19:59:42 +02:00
2026-03-15 23:35:22 +02:00
2026-03-15 23:35:22 +02:00
2024-02-12 15:56:14 +02:00
2025-07-19 21:02:16 +03:00
2023-07-20 20:32:15 +03:00
2023-07-20 20:32:15 +03:00
2026-03-28 00:14:45 +02:00
2026-03-28 00:06:34 +02:00
2025-07-27 14:13:53 +03:00
2025-07-17 13:49:15 +00:00
2023-11-25 23:45:33 +02:00
2023-07-20 20:32:15 +03:00
2023-08-30 17:03:54 +03:00
2025-07-21 00:24:49 +03:00
2025-12-02 10:45:59 +00:00
S
Description
No description provided
Readme AGPL-3.0 117 MiB
Languages
JavaScript 88.5%
HTML 8.2%
CSS 2.8%
Less 0.3%