Skip to content

fix: #1942 Enable async tool calling in Realtime sessions#1984

Merged
seratch merged 5 commits intomainfrom
issue-1942-async-function-calls
Oct 23, 2025
Merged

fix: #1942 Enable async tool calling in Realtime sessions#1984
seratch merged 5 commits intomainfrom
issue-1942-async-function-calls

Conversation

@seratch
Copy link
Copy Markdown
Member

@seratch seratch commented Oct 23, 2025

This pull request resolves #1942 and the new behavior aligns with TS SDK. I think this is a kind of behavioral bug for most use cases, so I've switched the default behavior to this new one by default. If a developer wants to switch back to the current behavior, they can customize this way. That said, I cannot think of those use cases:

runner_config = RealtimeRunConfig(async_tool_calls=False)
runner = RealtimeRunner(agent, config=runner_config)


self._guardrail_tasks: set[asyncio.Task[Any]] = set()
self._tool_call_tasks: set[asyncio.Task[Any]] = set()
self._async_tool_calls: bool = bool(self._run_config.get("async_tool_calls", True))
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

As I mentioned in the PR description, the default value is true. If we'd like to make this opt-in, we can change this part for it, and switch the default behavior to true in future minor/major versions. But I personally think setting true should be beneficial for everyone.

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread src/agents/realtime/session.py Outdated
Copy link
Copy Markdown
Collaborator

@rm-openai rm-openai left a comment

Choose a reason for hiding this comment

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

codex seems right

Comment thread src/agents/realtime/session.py Outdated
@seratch seratch force-pushed the issue-1942-async-function-calls branch from ffd4c09 to 8f37010 Compare October 23, 2025 22:58
@seratch seratch merged commit 8c4d4d0 into main Oct 23, 2025
8 checks passed
@seratch seratch deleted the issue-1942-async-function-calls branch October 23, 2025 23:01
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.

Enable asynchronous function calling for Realtime session

2 participants