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:
@@ -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.
|
||||
|
||||
Reference in New Issue
Block a user