deerflow2/web/tests
Willem Jiang e179fb1632
fix(web): handle incomplete JSON in MCP tool call arguments (#528) (#727)
* fix(web): handle incomplete JSON in MCP tool call arguments (#528)

When using stream_mode=["messages", "updates"] with MCP tools, tool call
arguments arrive in chunks that may be incomplete JSON (missing closing
braces). This caused JSON.parse() to throw errors in the frontend.

Changes:
- Add safeParseToolArgs() function using best-effort-json-parser to
  gracefully handle incomplete JSON from streaming
- Replace direct JSON.parse() with safe parser in mergeMessage()
- Add comprehensive tests for tool call argument parsing scenarios

* Address the code review comments
2025-11-29 16:38:29 +08:00
..
__mocks__ fix: react key warnings from duplicate message IDs + establish jest testing framework (#655) 2025-10-25 20:46:43 +08:00
json.test.ts fix: parsed json with extra tokens issue (#656) 2025-10-26 07:24:25 +08:00
markdown-katex.test.ts fix: react key warnings from duplicate message IDs + establish jest testing framework (#655) 2025-10-25 20:46:43 +08:00
markdown-math-editor.test.ts fix: handle escaped curly braces in LaTeX formulas (#608) (#660) 2025-10-26 10:15:35 +08:00
merge-message.test.ts fix(web): handle incomplete JSON in MCP tool call arguments (#528) (#727) 2025-11-29 16:38:29 +08:00
message-list-view.test.tsx fix: react key warnings from duplicate message IDs + establish jest testing framework (#655) 2025-10-25 20:46:43 +08:00
store.test.ts fix: react key warnings from duplicate message IDs + establish jest testing framework (#655) 2025-10-25 20:46:43 +08:00