Skip to content

Commit 65ba33f

Browse files
restore
1 parent 2a6a256 commit 65ba33f

1 file changed

Lines changed: 2 additions & 5 deletions

File tree

tests/observability/extension/openai/OpenAIAgentsTraceInstrumentor.test.ts

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ describe('OpenAIAgentsTraceInstrumentor', () => {
8484
expect((instrumentor as any)._config.enabled).toBe(false);
8585
});
8686

87-
it('should accept enabled: true config and activate when enable() is called', () => {
87+
it('should auto-enable when enabled: true is passed', () => {
8888
// Mock the OpenAI Agents functions to verify they get called
8989
const setTracingDisabledSpy = jest.spyOn(require('@openai/agents'), 'setTracingDisabled');
9090
const setTraceProcessorsSpy = jest.spyOn(require('@openai/agents'), 'setTraceProcessors');
@@ -96,10 +96,7 @@ describe('OpenAIAgentsTraceInstrumentor', () => {
9696
// Verify the config was set correctly
9797
expect((instrumentor as any)._config.enabled).toBe(true);
9898

99-
// Explicitly enable the instrumentor
100-
instrumentor.enable();
101-
102-
// Verify that enable() triggered our setup
99+
// Verify that OpenTelemetry automatically called enable() which triggered our setup
103100
expect(setTracingDisabledSpy).toHaveBeenCalledWith(false);
104101
expect(setTraceProcessorsSpy).toHaveBeenCalled();
105102

0 commit comments

Comments
 (0)