Skip to content

Commit 7ac51d4

Browse files
committed
Merge branch 'fix/session-config-tool-registration' of https://github.com/AjayKumbham/openai-agents-js into fix/session-config-tool-registration
2 parents 7f797cd + c4baacf commit 7ac51d4

File tree

1 file changed

+1
-7
lines changed

1 file changed

+1
-7
lines changed

.changeset/fix-session-config-tool-registration.md

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,4 @@
22
'@openai/agents-realtime': patch
33
---
44

5-
Fix session config breaking tool registration
6-
7-
When initializing a RealtimeSession with any config object, tool registration was being broken because empty or undefined tools arrays were being sent to the OpenAI API, which disabled tool calls. This fix ensures that the tools field is only included in session updates when tools are actually present, preventing the API from disabling tool functionality when session configuration is provided.
8-
9-
The issue occurred because the `_getMergedSessionConfig` method would include `tools: undefined` in the session data when no tools were explicitly provided in the config, which the OpenAI API interpreted as a request to disable all tools. Now, the tools field is only included when tools are actually available and non-empty.
10-
11-
This allows users to customize audio settings (voice, turn detection, noise reduction, etc.) while maintaining tool functionality, resolving the mutual exclusivity between session configuration and tool registration.
5+
Fix #339 session config breaking tool registration

0 commit comments

Comments
 (0)