Skip to content

Commit 1f99feb

Browse files
committed
.
1 parent eeec5f6 commit 1f99feb

File tree

2 files changed

+9
-47
lines changed

2 files changed

+9
-47
lines changed

packages/core/src/observability.ts

Lines changed: 6 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -48,42 +48,20 @@ const hydrateStepIO = <
4848
>(
4949
step: T
5050
): T => {
51-
// Handle both old format (array) and new format (object with args and closureVars)
52-
let hydratedInput = step.input;
53-
54-
if (step.input) {
55-
if (Array.isArray(step.input) && step.input.length) {
56-
// Old format: input is an array of arguments
57-
hydratedInput = hydrateStepArguments(
51+
const hydratedInput = step.input
52+
? hydrateStepArguments(
5853
step.input,
5954
[],
6055
step.runId as string,
6156
globalThis,
6257
streamPrintRevivers
63-
);
64-
} else if (
65-
typeof step.input === 'object' &&
66-
'args' in step.input &&
67-
Array.isArray(step.input.args) &&
68-
step.input.args.length
69-
) {
70-
// New format: input is { args: [...], closureVars: {...} }
71-
hydratedInput = {
72-
...step.input,
73-
args: hydrateStepArguments(
74-
step.input.args,
75-
[],
76-
step.runId as string,
77-
globalThis,
78-
streamPrintRevivers
79-
),
80-
};
81-
}
82-
}
58+
)
59+
: step.input;
8360

8461
return {
8562
...step,
86-
input: hydratedInput,
63+
input: 'args' in hydratedInput ? hydratedInput.args : hydratedInput,
64+
// TODO: should we also render the closure vars for o11y?
8765
output: step.output
8866
? hydrateStepReturnValue(step.output, globalThis, streamPrintRevivers)
8967
: step.output,

packages/core/src/runtime.ts

Lines changed: 3 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -680,23 +680,7 @@ export const stepEntrypoint =
680680
workflowRunId
681681
);
682682

683-
// Handle both new format { args, closureVars } and legacy format (just args array)
684-
let args: any[];
685-
let closureVars: Record<string, any>;
686-
687-
if (
688-
hydratedInput &&
689-
typeof hydratedInput === 'object' &&
690-
'args' in hydratedInput
691-
) {
692-
// New format: { args, closureVars }
693-
args = hydratedInput.args;
694-
closureVars = hydratedInput.closureVars || {};
695-
} else {
696-
// Legacy format: just args array
697-
args = hydratedInput;
698-
closureVars = {};
699-
}
683+
const args = hydratedInput.args;
700684

701685
span?.setAttributes({
702686
...Attribute.StepArgumentsCount(args.length),
@@ -719,9 +703,9 @@ export const stepEntrypoint =
719703
: `http://localhost:${port ?? 3000}`,
720704
},
721705
ops,
722-
closureVars,
706+
closureVars: hydratedInput.closureVars,
723707
},
724-
() => stepFn(...args)
708+
() => stepFn.apply(null, args)
725709
);
726710

727711
result = dehydrateStepReturnValue(result, ops, workflowRunId);

0 commit comments

Comments
 (0)