fix(daemon): accept string triggerPayload in workflow thread

The original code only accepted object-type triggerPayload, silently
discarding string values by replacing them with {}. This meant
`nerve workflow trigger <name> --payload '"some string"'` would
lose the payload entirely.

Changed to `triggerPayload ?? {}` so strings (and other non-null
values) pass through correctly.

小橘 🍊(NEKO Team)
This commit is contained in:
2026-04-23 11:48:05 +00:00
parent 5cedc6a33d
commit 01d2185495
+1 -2
View File
@@ -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.