Skip to content

feat(deno): add openai integration#22467

Open
isaacs wants to merge 1 commit into
isaacs/deno-orchestrion-integrations-firebasefrom
isaacs/deno-orchestrion-integrations-openai
Open

feat(deno): add openai integration#22467
isaacs wants to merge 1 commit into
isaacs/deno-orchestrion-integrations-firebasefrom
isaacs/deno-orchestrion-integrations-openai

Conversation

@isaacs

@isaacs isaacs commented Jul 21, 2026

Copy link
Copy Markdown
Member

No description provided.

@isaacs
isaacs requested a review from a team as a code owner July 21, 2026 20:21
@isaacs
isaacs requested review from JPeer264 and andreiborza and removed request for a team July 21, 2026 20:21
@isaacs
isaacs force-pushed the isaacs/deno-orchestrion-integrations-openai branch from 9ea3b80 to 247a3be Compare July 21, 2026 20:55
@isaacs
isaacs requested a review from a team as a code owner July 21, 2026 20:55
@isaacs
isaacs force-pushed the isaacs/deno-orchestrion-integrations-firebase branch from 4a7b537 to 4fa1a42 Compare July 21, 2026 20:55
@isaacs
isaacs force-pushed the isaacs/deno-orchestrion-integrations-openai branch from 247a3be to 166b082 Compare July 21, 2026 21:31
@isaacs
isaacs force-pushed the isaacs/deno-orchestrion-integrations-firebase branch from 4fa1a42 to 932c59a Compare July 21, 2026 21:31
@isaacs
isaacs force-pushed the isaacs/deno-orchestrion-integrations-openai branch from 166b082 to 1b4d06d Compare July 21, 2026 21:43
@isaacs
isaacs force-pushed the isaacs/deno-orchestrion-integrations-firebase branch from 932c59a to 2c24656 Compare July 21, 2026 21:43
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({

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant