-
Notifications
You must be signed in to change notification settings - Fork 27
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Introduce failing test to recreate openai shim issue #113
base: main
Are you sure you want to change the base?
Conversation
Seems like other people are running into this issue in the wild, as seen in this issue here: openai/openai-node#903 |
I'm looking into this! Thanks for the test case. |
@ericallam do you happen to have the openai code that causes |
@timfish full reproduction with OpenAI SDK here: https://github.com/ericallam/iitm-openai This is the bit of code I copied from them in the test case: https://github.com/openai/openai-node/blob/master/src/_shims/index.mjs |
Any update? this makes Datadog unusable in any node project that uses the openai sdk... |
The issue with I have no idea how DataDog initialises |
Using iitm 1.8.1 in an ESM project that imports the
openai
package leads to the following exception:getDefaultAgent
is part of the openai shims system, which automatically sets certain platform/runtime specific values using module side-effects. I've recreated a simplified version of this issue in a test file (I may have put the test file in the wrong place, please advise and I can move it if needed). You can see the test pass with the following:And fail with the loader added:
I'm not exactly sure what the issue is, but it does look like possibly the second import of
registry.mjs
in the shims file maybe just uses a module cache, instead of re-importing the module: