From b4c4a1772bd343a6bc096cd8ea304af246a2aecf Mon Sep 17 00:00:00 2001 From: yiliang114 <1204183885@qq.com> Date: Fri, 5 Jun 2026 18:22:40 +0800 Subject: [PATCH] fix(core): handle error variant of ModelInvocableCommandExecutorResult in disabled skill path The disabled-skill command delegation (line 457) used the executor result directly as text content, but ModelInvocableCommandExecutorResult is `string | { error: string }`. Handle the error object case the same way the non-disabled path does (lines 494-506). Fixes build break introduced by #4532 merging after the type was widened. --- packages/core/src/tools/skill.ts | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/packages/core/src/tools/skill.ts b/packages/core/src/tools/skill.ts index ce716b98720..398f475ae85 100644 --- a/packages/core/src/tools/skill.ts +++ b/packages/core/src/tools/skill.ts @@ -461,6 +461,12 @@ class SkillToolInvocation extends BaseToolInvocation { // track via `onSkillLoaded` — no skill body was loaded, and // conflating the two would inflate skill telemetry / // `/context` skill-token attribution with command runs. + if (typeof content === 'object' && 'error' in content) { + return { + llmContent: content.error, + returnDisplay: content.error, + }; + } return { llmContent: [{ text: content }], returnDisplay: `Delegated to command: ${this.params.skill}`,