Skip to content

fix: Prevent MCP tool failure from terminating chat flow#468

Open
fengjunhui31 wants to merge 1 commit intoChevey339:masterfrom
fengjunhui31:fix/mcp-tool-failure
Open

fix: Prevent MCP tool failure from terminating chat flow#468
fengjunhui31 wants to merge 1 commit intoChevey339:masterfrom
fengjunhui31:fix/mcp-tool-failure

Conversation

@fengjunhui31
Copy link
Copy Markdown

Summary

  • tool_handler_service.dartbuildToolCallHandler 添加顶层 try-catch
  • 工具执行异常返回错误 JSON 给 LLM,而非终止对话流程
  • LLM 可根据错误信息重试或通知用户

Fixes #465: MCP 工具失败不再导致流程意外终止

Test plan

  • 工具异常 → 返回错误 JSON → 流程继续
  • LLM 收到错误可重试

🤖 Generated with Claude Code

Fixes Chevey339#465: Tool execution errors now return error JSON to LLM
instead of crashing the conversation.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feature mcp tool有工具使用失败时会终止整个流程,希望可以交回llm自行决策

2 participants