From 542f72d449bbc653ac1bbf8a9d590d6b9fa312b7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=91=D0=BE=D1=80=D0=BE=D0=B4=D0=B8=D0=BD=20=D0=A0=D0=BE?= =?UTF-8?q?=D0=BC=D0=B0=D0=BD?= Date: Sun, 27 Sep 2026 13:43:00 +0300 Subject: [PATCH] fix: skip execute tool entirely when script has child tools MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Результат execute уже в step.text (после ---), не дублируем спойлером. Если в скрипте есть инструменты — показываем только их спойлеры. Если инструментов нет — execute как обычный инструмент. --- index.ts | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/index.ts b/index.ts index e9f9201..aa085c8 100644 --- a/index.ts +++ b/index.ts @@ -579,7 +579,8 @@ async function runPlugin(ctx: any, options: any, dataDir: string) { : [] if (childTools.length > 0) { - // Execute has child tool calls — show children, then execute result separately + // Execute has child tool calls — show only children, skip execute entirely + // (execute result is in step.text, shown after "---") for (const child of childTools) { parts.push(`
\n🔧 ${child.name}\n\n`) parts.push(`Args:\n\`\`\`\n${child.args}\n\`\`\`\n\n`) @@ -590,12 +591,6 @@ async function runPlugin(ctx: any, options: any, dataDir: string) { } parts.push(`
`) } - // Show execute result as a separate spoiler after all child tools - if (executeTool?.result) { - parts.push(`
\n🔧 execute\n\n`) - parts.push(`Result:\n\`\`\`\n${executeTool.result}\n\`\`\`\n\n`) - parts.push(`
`) - } } else { // No child tool calls — show tools normally (including execute as-is) for (const tool of step.tools) {