Skip to content

parallel_tool_calls default is True in the client, despite docs saying False #762

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
AmmarAamir786 opened this issue May 26, 2025 · 0 comments · May be fixed by #763
Open

parallel_tool_calls default is True in the client, despite docs saying False #762

AmmarAamir786 opened this issue May 26, 2025 · 0 comments · May be fixed by #763
Labels
bug Something isn't working

Comments

@AmmarAamir786
Copy link

What happened

The Agents SDK documentation for ModelSettings.parallel_tool_calls states:

“Whether to use parallel tool calls when calling the model.
Defaults to False if not provided.”

However, in practice the underlying openai Python client (v1.32+) treats parallel_tool_calls=True by default whenever the field is omitted, and the SDK does not override this. As a result, tools are always invoked in parallel unless you explicitly set parallel_tool_calls=False on your ModelSettings.

Steps to reproduce

from agents import Agent, ModelSettings, Tool

# Define two trivial tools
@function_tool("greet")
def greet_tool(name: str) -> str:
    return f"Hello, {name}!"

@function_tool("farewell")
def farewell_tool(name: str) -> str:
    return f"Goodbye, {name}!"

# Build an agent with both tools, never touching parallel_tool_calls
agent = Agent(
        name="demo-agent",
        instructions="You are a helpful assistant.",
        tools=[greet_tool, farewell_tool],
    )

async def main():
    # Set up the runner to use the agent
    result = await Runner.run(
        agent,
        input="Hello it was nice to meet you. Goodbye",
        run_config=run_config,
    )
    print(result.final_output)

if __name__ == "__main__":
    asyncio.run(main())

Without that override, both greet_tool and farewell_tool fire in parallelreproducing the defaultTrue behavior you observed. This can be observed on OpenAI' tracing

### Suggested fixes
Enforce the documented default

Modify ModelSettings (or its resolver) to explicitly send parallel_tool_calls=False when the field is None.

Or update the docs

Clarify that the underlying openai client now defaults to True, and require users to explicitly set False if they want sequential tool calls.

### Environment
openai-agents-python version: 0.0.15

openai Python client version: ≥1.32.0

Python version: e.g. 3.10
@AmmarAamir786 AmmarAamir786 added the bug Something isn't working label May 26, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant