diff --git a/js/core/src/reflection.ts b/js/core/src/reflection.ts index a63959bf13..5d9dbe8aee 100644 --- a/js/core/src/reflection.ts +++ b/js/core/src/reflection.ts @@ -263,7 +263,7 @@ export class ReflectionServer { response.write(JSON.stringify(chunk) + '\n'); }; const result = await action.run(input, { - context, + context: context || {}, onChunk: callback, telemetryLabels, onTraceStart: onTraceStartCallback, @@ -304,7 +304,7 @@ export class ReflectionServer { } else { // Non-streaming: send JSON response const result = await action.run(input, { - context, + context: context || {}, telemetryLabels, onTraceStart: onTraceStartCallback, abortSignal: abortController.signal,