feat(deno): add openai integration#22467
Open
isaacs wants to merge 1 commit into
Open
Conversation
isaacs
requested review from
JPeer264 and
andreiborza
and removed request for
a team
July 21, 2026 20:21
isaacs
force-pushed
the
isaacs/deno-orchestrion-integrations-openai
branch
from
July 21, 2026 20:55
9ea3b80 to
247a3be
Compare
isaacs
force-pushed
the
isaacs/deno-orchestrion-integrations-firebase
branch
from
July 21, 2026 20:55
4a7b537 to
4fa1a42
Compare
isaacs
force-pushed
the
isaacs/deno-orchestrion-integrations-openai
branch
from
July 21, 2026 21:31
247a3be to
166b082
Compare
isaacs
force-pushed
the
isaacs/deno-orchestrion-integrations-firebase
branch
from
July 21, 2026 21:31
4fa1a42 to
932c59a
Compare
isaacs
force-pushed
the
isaacs/deno-orchestrion-integrations-openai
branch
from
July 21, 2026 21:43
166b082 to
1b4d06d
Compare
isaacs
force-pushed
the
isaacs/deno-orchestrion-integrations-firebase
branch
from
July 21, 2026 21:43
932c59a to
2c24656
Compare
Comment on lines
+68
to
+71
| Deno.test('openai instrumentation: orchestrion:openai:chat channel produces a nested gen_ai span', async () => { | ||
| resetGlobals(); | ||
| const sink = transactionSink(); | ||
| init({ |
Contributor
There was a problem hiding this comment.
Bug: The global installedIntegrations array is not reset between tests, causing setupOnce() to be skipped in the second test, which prevents channel subscribers from being registered and leads to test failure.
Severity: MEDIUM
Suggested Fix
The global state needs to be reset between test runs. The installedIntegrations array should be cleared as part of the test teardown or setup process. For example, the resetGlobals() function could be modified to also clear this array, ensuring each test runs in an isolated environment and setupOnce() is called correctly.
Prompt for AI Agent
Review the code at the location below. A potential bug has been identified by an AI
agent. Verify if this is a real issue. If it is, propose a fix; if not, explain why it's
not valid.
Location: dev-packages/deno-integration-tests/suites/orchestrion-openai/test.ts#L68-L71
Potential issue: The integration test suite contains two separate tests that both call
`init()`. The first test populates the global `installedIntegrations` array. Because
this array is not reset between tests, the second test's call to `init()` finds the
integration is already present in the list. This prevents the `setupOnce()` function
from running during the second test. As `setupOnce()` is responsible for registering
subscribers to the `orchestrion:openai:chat` channel, no subscribers are registered for
the second test. Consequently, when the test publishes events to this channel, there are
no listeners, causing the test to fail its assertions for created spans.
Also affects:
dev-packages/deno-integration-tests/suites/orchestrion-openai/test.ts:57~62
Did we get this right? 👍 / 👎 to inform future reviews.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.