From 01d2185495c27af6fe25eca7ad8ccbc4f7c29954 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=B0=8F=E6=A9=98?= Date: Thu, 23 Apr 2026 11:48:05 +0000 Subject: [PATCH] fix(daemon): accept string triggerPayload in workflow thread MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The original code only accepted object-type triggerPayload, silently discarding string values by replacing them with {}. This meant `nerve workflow trigger --payload '"some string"'` would lose the payload entirely. Changed to `triggerPayload ?? {}` so strings (and other non-null values) pass through correctly. 小橘 🍊(NEKO Team) --- packages/daemon/src/workflow-worker.ts | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/packages/daemon/src/workflow-worker.ts b/packages/daemon/src/workflow-worker.ts index cee6354..69af343 100644 --- a/packages/daemon/src/workflow-worker.ts +++ b/packages/daemon/src/workflow-worker.ts @@ -120,8 +120,7 @@ async function runThread( const initialEvent: CommandEvent = { type: "thread_start", - triggerPayload: - triggerPayload != null && typeof triggerPayload === "object" ? triggerPayload : {}, + triggerPayload: triggerPayload ?? {}, }; // On resume: replay persisted events, run the next un-executed role, then continue.