-
Notifications
You must be signed in to change notification settings - Fork 2.8k
fix: AI dialogue node calls MCP, AI's reply content is included in the code block of MCP call result, markdown parsing error #3846 #3894
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -297,7 +297,6 @@ function clickNodes(item: any) { | |
| x: anchorData.value?.x + width / 2 + 200, | ||
| y: anchorData.value?.y - item.height | ||
| }) | ||
| console.log(nodeModel) | ||
| props.nodeModel.graphModel.addEdge({ | ||
| type: 'app-edge', | ||
| sourceNodeId: props.nodeModel.id, | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There is no irregularity or issue in the provided code snippet. The function |
||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The provided code has a few issues and areas for improvement:
Redundancy: The
generate_tool_message_templatefunction is called twice within the_yield_mcp_responsemethod. This redundancy can be removed.Security Concerns: If user input (
reasoning_content) contains malicious JSON, it could lead to injection attacks. Consider sanitizing this input before converting it to JSON.Code Duplication: There are similar template string constructions in both places where you're creating tool messages. Can these be combined into a single function?
Here's an optimized version of the code:
Key Changes:
format_tool_messagefunction has been introduced to handle the formatting of Tool Message data.This should help resolve the redundancies and improve security while keeping the code concise.