diff --git a/src/agent/codeGenAgentRunner.ts b/src/agent/codeGenAgentRunner.ts index 655577e..d827bc8 100644 --- a/src/agent/codeGenAgentRunner.ts +++ b/src/agent/codeGenAgentRunner.ts @@ -165,8 +165,8 @@ export async function runCodeGenAgent(agent: AgentContext): Promise { - // // Un-proxy any JsProxy objects. https://pyodide.org/en/stable/usage/type-conversions.html - // args = args.map(arg => typeof arg.toJs === 'function' ? arg.toJs() : arg) + // Un-proxy any JsProxy objects. https://pyodide.org/en/stable/usage/type-conversions.html + args = args.map((arg) => (typeof arg?.toJs === 'function' ? arg.toJs() : arg)); // Convert arg array to parameters name/value map const parameters: { [key: string]: any } = {};