fix(mcp): stringify plugin tool content safely · openclaw/openclaw@5fa0d28
vincentkoc
·
2026-04-29
·
via Recent Commits to openclaw:main
| Original file line number | Diff line number | Diff line change |
|---|
@@ -4,6 +4,7 @@ import {
|
4 | 4 | } from "../agents/pi-tools.before-tool-call.js"; |
5 | 5 | import type { AnyAgentTool } from "../agents/tools/common.js"; |
6 | 6 | import { formatErrorMessage } from "../infra/errors.js"; |
| 7 | +import { coerceChatContentText } from "../shared/chat-content.js"; |
7 | 8 | |
8 | 9 | type CallPluginToolParams = { |
9 | 10 | name: string; |
@@ -54,7 +55,7 @@ export function createPluginToolsMcpHandlers(tools: AnyAgentTool[]) {
|
54 | 55 | return { |
55 | 56 | content: Array.isArray(result.content) |
56 | 57 | ? result.content |
57 | | - : [{ type: "text", text: String(result.content) }], |
| 58 | + : [{ type: "text", text: coerceChatContentText(result.content) }], |
58 | 59 | }; |
59 | 60 | } catch (err) { |
60 | 61 | return { |
|
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。