Repository: promptfoo/promptfoo
Issue: 0.57.0 update appears to break python script providers
Root cause: Validation Gap

Hello, after upgrading to 0.57.0, both myself and a colleague with a completely different setup are seeing the following error when running test files which contain an external python provider:

```
 property 'parent' closes the circle
Stack Trace: TypeError: Converting circular structure to JSON
    --> starting at object with constructor 'DerivedLogger'
    |     property '_readableState' -> object with constructor 'ReadableState'
    |     property 'pipes' -> object with constructor 'Console'
    --- property 'parent' closes the circle
    at JSON.stringify (<anonymous>)
    at runPython (/Users/alexclaydon/.nvm/versions/node/v21.7.3/lib/node_modules/promptfoo/dist/src/python/wrapper.js:29:58)
    at PythonProvider.callApi (/Users/alexclaydon/.nvm/versions/node/v21.7.3/lib/node_modules/promptfoo/dist/src/providers/pythonCompletion.js:40:59)
    at async Evaluator.runEval (/Users/alexclaydon/.nvm/versions/node/v21.7.3/lib/node_modules/promptfoo/dist/src/evaluator.js:277:28)
    at async processEvalStep (/Users/alexclaydon/.nvm/versions/node/v21.7.3/lib/node_modules/promptfoo/dist/src/evaluator.js:593:25)

Error: Error running Python script: Converting circular structure to JSON
    --> starting at object with constructor 'DerivedLogger'
    |     property '_readableState' -> object with constructor 'ReadableState'
    |     property 'pipes' -> object with constructor 'Console'
    --- property 'parent' closes the circle
Stack Trace: TypeError: Converting circular structure to JSON
    --> starting at object with constructor 'DerivedLogger'
    |     property '_readableState' -> object with constructor 'ReadableState'
    |     property 'pipes' -> object with constructor 'Console'
    --- property 'parent' closes the circle
    at JSON.stringify (<anonymous>)
    at runPython (/Users/alexclaydon/.nvm/versions/node/v21.7.3/lib/node_modules/promptfoo/dist/src/python/wrapper.js:29:58)
    at PythonProvider.callApi (/Users/alexclaydon/.nvm/versions/node/v21.7.3/lib/node_modules/promptfoo/dist/src/providers/pythonCompletion.js:40:59)
    at async Evaluator.runEval (/Users/alexclaydon/.nvm/versions/node/v21.7.3/lib/node_modules/promptfoo/dist/src/evaluator.js:277:28)
    at async processEvalStep (/Users/alexclaydon/.nvm/versions/node/v21.7.3/lib/node_modules/promptfoo/dist/src/evaluator.js:593:25)
    at runPython (/Users/alexclaydon/.nvm/versions/node/v21.7.3/lib/node_modules/promptfoo/dist/src/python/wrapper.js:47:15)
    at PythonProvider.callApi (/Users/alexclaydon/.nvm/versions/node/v21.7.3/lib/node_modules/promptfoo/dist/src/providers/pythonCompletion.js:40:59)
    at async Evaluator.runEval (/Users/alexclaydon/.nvm/versions/node/v21.7.3/lib/node_modules/promptfoo/dist/src/evaluator.js:277:28)
    at async processEvalStep (/Users/alexclaydon/.nvm/versions/node/v21.7.3/lib/node_modules/promptfoo/dist/src/evaluator.js:593:25)
---
```
We're both using v21 Node - myself 21.7.3 and him 21.5.

Confirmed that rolling back to 0.56.0 fixes it for both of us!

Please let me know if this is reproducible for you and, if so, whether there's any additional information I can provide?

Cheers

Thanks for flagging, I have an idea why this may be happening. Probably #748 

Fixed in [0.57.1](https://github.com/promptfoo/promptfoo/releases/tag/0.57.0)!

Amazing - thank you so much for the incredible pace!