Skip to content

Conversation

@seratch
Copy link
Member

@seratch seratch commented Jun 5, 2025

This pull request reduces unnecessary stdout outputs during pnpm test execution. Not yet eliminated (mainly agents-realtime has a few more outputs that should be managed properly) but this PR definitely improves it.

Current outputs:

> CI=1 NODE_ENV=test vitest

 RUN  v3.1.1 /path-to/openai-agents-js

 ✓  @openai/agents-realtime  test/utils.test.ts (8 tests) 2ms
 ✓  @openai/agents-core  test/tracing.test.ts (10 tests) 5ms
 ✓  @openai/agents-openai  test/openaiChatCompletionsConverter.test.ts (14 tests) 3ms
 ✓  @openai/agents-core  test/items.test.ts (8 tests) 2ms
 ✓  @openai/agents-core  test/runState.test.ts (14 tests) 6ms
 ✓  @openai/agents-openai  test/openaiChatCompletionsModel.test.ts (8 tests) 6ms
 ✓  @openai/agents-realtime  test/openaiRealtimeWebRtc.test.ts (6 tests) 7ms
 ✓  @openai/agents-openai  test/openaiResponsesModel.helpers.test.ts (14 tests) 4ms
 ✓  @openai/agents-core  test/agent.test.ts (15 tests) 5ms
stdout | test/openaiRealtimeWebsocket.test.ts > OpenAIRealtimeWebSocket > handles audio delta, speech started and created/done events
Interrupting response after 0ms
Audio length: 0.020833333333333332ms
Interrupting response after 0ms
Audio length: 0.020833333333333332ms

 ✓  @openai/agents-core  test/runImplementation.test.ts (31 tests) 8ms
stdout | test/openaiRealtimeWebsocket.test.ts > OpenAIRealtimeWebSocket > full interrupt/_interrupt flow
Interrupting response after 0ms
Audio length: 0.020833333333333332ms

 ✓  @openai/agents-realtime  test/openaiRealtimeWebsocket.test.ts (8 tests) 9ms
stderr | test/realtimeSession.test.ts > RealtimeSession > sets the trace config correctly
In order to set traceMetadata or a groupId you need to specify a workflowName.

 ✓  @openai/agents-core  test/run.test.ts (18 tests) 17ms
stderr | test/realtimeSession.test.ts > RealtimeSession > propagates errors from handleFunctionCall
Error handling function call ModelBehaviorError: Tool missing not found
    at RealtimeSession.#handleFunctionCall (/Users/seratch/code/openai-agents-js/packages/agents-realtime/src/realtimeSession.ts:444:15)
    at EventEmitter.<anonymous> (/Users/seratch/code/openai-agents-js/packages/agents-realtime/src/realtimeSession.ts:589:9) {
  state: undefined
}

 ✓  @openai/agents-extensions  test/aiSdk.test.ts (22 tests) 8ms
 ✓  @openai/agents-realtime  test/realtimeSession.test.ts (11 tests) 109ms
 ✓  @openai/agents-realtime  test/openaiRealtimeEvents.test.ts (5 tests) 3ms
 ✓  @openai/agents-openai  test/openaiChatCompletionsStreaming.test.ts (2 tests) 2ms
 ✓  @openai/agents-openai  test/openaiResponsesModel.test.ts (2 tests) 4ms
stderr | test/openaiTracingExporter.test.ts > OpenAITracingExporter > skips export when no apiKey
No API key provided for OpenAI tracing exporter. Exports will be skipped

stderr | test/openaiTracingExporter.test.ts > OpenAITracingExporter > retries on server errors
[non-fatal] Tracing: server error 500, retrying.

stderr | test/openaiTracingExporter.test.ts > OpenAITracingExporter > stops on client error
[non-fatal] Tracing client error 400: bad

 ✓  @openai/agents-core  test/guardrail.test.ts (5 tests) 3ms
 ✓  @openai/agents-realtime  test/openaiRealtimeBase.test.ts (6 tests) 4ms
stderr | test/TwilioRealtimeTransport.test.ts > TwilioRealtimeTransportLayer > connect handles messages and events
Error parsing message: SyntaxError: Unexpected token 'b', "bad{" is not valid JSON
    at JSON.parse (<anonymous>)
    at FakeTwilioWebSocket.<anonymous> (/Users/seratch/code/openai-agents-js/packages/agents-extensions/src/TwilioRealtimeTransport.ts:87:27)
    at FakeTwilioWebSocket.emit (node:events:518:28)
    at /Users/seratch/code/openai-agents-js/packages/agents-extensions/test/TwilioRealtimeTransport.test.ts:89:12
    at processTicksAndRejections (node:internal/process/task_queues:105:5)
    at file:///Users/seratch/code/openai-agents-js/node_modules/@vitest/runner/dist/index.js:595:20 Message: { toString: [Function: toString] }

 ✓  @openai/agents-core  test/tool.test.ts (5 tests) 4ms
 ✓  @openai/agents-extensions  test/TwilioRealtimeTransport.test.ts (3 tests) 5ms
 ✓  @openai/agents-core  test/handoffs.test.ts (3 tests) 5ms
 ✓  @openai/agents-core  test/result.test.ts (4 tests) 5ms
stderr | test/handoff.test.ts > handoff() > parses JSON and reports errors
Invalid JSON when parsing: bad. Error: SyntaxError: Unexpected token 'b', "bad" is not valid JSON

 ✓  @openai/agents-core  test/handoff.test.ts (5 tests) 4ms
 ✓  @openai/agents-core  test/shims/mcp-stdio/node.test.ts (1 test) 32ms
 ✓  @openai/agents-openai  test/openaiTracingExporter.test.ts (5 tests) 36ms
 ✓  @openai/agents-extensions  test/index.test.ts (2 tests) 3ms
 ✓  @openai/agents-core  test/utils/messages.test.ts (4 tests) 1ms
 ✓  @openai/agents-core  test/utils/serialize.test.ts (4 tests) 1ms
 ✓  @openai/agents-core  test/utils/tools.test.ts (5 tests) 3ms
 ✓  @openai/agents-core  test/helpers/message.test.ts (4 tests) 2ms
 ✓  @openai/agents-core  test/utils/smartString.test.ts (7 tests) 2ms
 ✓  @openai/agents-core  test/usage.test.ts (3 tests) 2ms
 ✓  @openai/agents-openai  test/tools.test.ts (2 tests) 1ms
 ✓  @openai/agents-core  test/utils/typeGuards.test.ts (2 tests) 1ms
 ✓  @openai/agents-core  test/mcpCache.test.ts (1 test) 3ms
 ✓  @openai/agents-core  test/errors.test.ts (1 test) 2ms
 ✓  @openai/agents-openai  test/defaults.test.ts (5 tests) 2ms
 ✓  @openai/agents-core  test/runContext.test.ts (3 tests) 2ms
 ✓  @openai/agents-core  test/run.stream.test.ts (2 tests) 4ms
 ✓  @openai/agents-openai  test/openaiProvider.test.ts (4 tests) 2ms
 ✓  @openai/agents-core  test/model.test.ts (1 test) 1ms
 ✓  @openai/agents-core  test/utils/safeExecute.test.ts (2 tests) 1ms
 ✓  @openai/agents-core  test/run.utils.test.ts (1 test) 1ms
 ✓  @openai/agents-core  test/extensions/handoffPrompt.test.ts (2 tests) 1ms
 ✓  @openai/agents-realtime  test/openaiRealtimeWebRtc.environment.test.ts (1 test) 1ms
 ✓  @openai/agents-realtime  test/index.test.ts (2 tests) 1ms
 ✓  @openai/agents-core  test/extensions/handoffFilters.test.ts (1 test) 1ms
 ✓  @openai/agents  test/metadata.test.ts (1 test) 1ms
 ✓  @openai/agents-core  test/metadata.test.ts (1 test) 1ms
 ✓  @openai/agents-core  test/providers.test.ts (1 test) 1ms
 ✓  @openai/agents-core  test/shims/mcp-stdio/browser.test.ts (1 test) 1ms
 ✓  @openai/agents-core  test/utils/index.test.ts (1 test) 1ms
 ✓  @openai/agents-core  test/index.test.ts (1 test) 1ms
 ✓  @openai/agents-core  test/mcp.test.ts (1 test) 1ms
 ✓  @openai/agents-openai  test/index.test.ts (1 test) 1ms
 ✓  @openai/agents  test/index.test.ts (3 tests) 1ms

 Test Files  57 passed (57)
      Tests  303 passed (303)
   Start at  17:44:23
   Duration  4.33s (transform 1.75s, setup 0ms, collect 8.28s, tests 348ms, environment 5ms, prepare 4.06s)

@dkundel-openai
Copy link
Collaborator

Can you generate a changeset for the change in agents core? @seratch

@seratch seratch force-pushed the reduce-warnings-prints branch from bd66025 to 9a24820 Compare June 5, 2025 21:13
@seratch seratch force-pushed the reduce-warnings-prints branch from 9a24820 to 457073c Compare June 5, 2025 21:14
@changeset-bot
Copy link

changeset-bot bot commented Jun 5, 2025

🦋 Changeset detected

Latest commit: 457073c

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 5 packages
Name Type
@openai/agents-core Patch
@openai/agents-openai Patch
@openai/agents-realtime Patch
@openai/agents Patch
@openai/agents-extensions Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@seratch
Copy link
Member Author

seratch commented Jun 5, 2025

@dkundel-openai

Can you generate a changeset for the change in agents core? @seratch

Added a changeset for this

@dkundel-openai dkundel-openai merged commit 284d0ab into main Jun 5, 2025
5 checks passed
@dkundel-openai dkundel-openai deleted the reduce-warnings-prints branch June 5, 2025 21:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants