[KongchangAI]
· 2 min read· 1,392 words

OpenAI Agents SDK Parallel Calls Break: Legacy MCP Lock Slows Things Down 4x

OpenAI Agents SDK Parallel Calls Break: Legacy MCP Lock Slows Things Down 4x

A leftover mutex in the OpenAI Agents SDK and MCP compatibility layer degrades parallel tool calls into serial execution.

The article discloses a performance defect when OpenAI Agents SDK 0.24.0 is paired with MCP 2.3.0: four tool calls that should each take 3 seconds in parallel actually take 12 seconds, a classic serial-additive pattern. After reproducing it, Rivet traced the issue to mutual exclusion logic inside MCP's streamable HTTP client, allowing only one request through at a time. The lock was a temporary safety net introduced in March to fix an old MCP bug; after that bug was fixed, the lock was never removed and became a long-term bottleneck. The team's tested unofficial workaround is to set a private property to false, which drops the four calls to 3.1 seconds — but it only applies to MCP 2.x and could re-expose the old bug. The article reminds developers to watch for performance blind spots in SDK and protocol library compatibility layers, and to be cautious with workarounds.

Title

OpenAI Agents SDK Parallel Calls Break: Legacy MCP Lock Slows Things Down 4x

Meta Description

With OpenAI Agents SDK 0.24.0 and MCP 2.3.0, four parallel tool calls take 12 seconds instead of 3. The cause: a lock added for an old MCP bug in the streamable HTTP client is still in place. This article analyzes the root cause, unofficial workarounds, and what it means for Agent development.

Article Content

Four tool calls that should have run in parallel, each taking 3 seconds, ended up taking 12 seconds. The problem wasn't the network, and it wasn't the model — it was hidden in a compatibility layer between the OpenAI Agents SDK and MCP.

According to a short commentary from the YouTube channel Rivet, with OpenAI Agents SDK 0.24.0 paired with MCP 2.3.0, the streamable HTTP client can only handle one request at a time. A lock added to work around an older MCP bug was introduced in March and never removed, directly degrading parallel tool calls into a serial queue.

Open AI agents SDK 0.24.0 with MCP 2.3.0

The Symptom: Parallel Requests Forced into a Queue

The test scenario was straightforward: four tool calls fired simultaneously, each expected to take 3 seconds. With parallel logic, the total should be close to 3 seconds; the actual result was 12 seconds — exactly 4 times 3.

This linear additive timing curve is a classic signature of serial execution. In the video, Rivet points out that the crux lies in MCP's streamable HTTP client implementation: it internally holds mutual exclusion logic that allows only one request through at a time.

For Agent workflows that depend on multi-tool collaboration, this means latency grows multiplicatively with the number of tools. Four calls take 12 seconds; eight calls would approach 24 seconds. What users experience is noticeable lag and degraded responsiveness.

MCP (Model Context Protocol) is an open-source protocol standard proposed by Anthropic in late 2024, designed to let AI models connect to external tools, data sources, and services in a unified way. It uses a client-server architecture: the Agent side acts as an MCP client, communicating with MCP servers over transport layers such as HTTP and stdio, and the servers expose specific tool capabilities.

streamable HTTP is a transport method introduced in the 2025 MCP specification, replacing the earlier HTTP+SSE dual-endpoint approach. It allows both streaming responses and regular requests on a single endpoint. Because it supports long-lived connections and streaming returns, client implementations need to handle connection reuse, request queuing, and lifecycle management — and that's exactly the layer where the mutex described in this article was introduced. Understanding this helps clarify: the bottleneck isn't in the protocol semantics, but in the client's concurrency scheduling strategy.

Where the Lock Came From: A Patch for an Old Bug

This lock wasn't added arbitrarily. According to Rivet, it was introduced in March to fix an earlier MCP bug. In other words, it was originally a safety net — using serialization to avoid the stability risks posed by the old issue.

The problem is that after the old bug was fixed, the lock was never removed. It remained on the code path, turning a temporary defensive measure into a long-term performance bottleneck.

It's a lock added in March for an older MCP bug, and it's still on

These kinds of "fix leftovers" are not uncommon in rapidly iterating SDK ecosystems. When multiple component versions depend on each other, a patch's lifecycle often outlasts the bug that triggered it — and users typically only notice when performance anomalies surface.

Mutex is a fundamental primitive in concurrent programming used to protect shared resources: only one thread or coroutine may enter the critical section at any given time, and all other requests must wait. It's very effective for fixing race conditions and preventing connection state from being corrupted by concurrent writes, but the cost is sacrificing concurrency.

In the MCP streamable HTTP client, if multiple requests share the same session identifier, event stream, or connection state, not locking could cause garbled responses; locking ensures correctness but serializes parallel calls. This is a classic trade-off of "correctness for performance." The difficulty in cleaning up leftover locks is that a lock's introduction is usually tied to a specific reproduction scenario. Once the old bug disappears, it's hard to tell whether the lock still provides hidden protection, so maintainers often lean toward keeping it rather than deleting it — until clear performance evidence pushes for removal.

Temporary Workaround: Flip a Private Property

The Rivet team tested an unofficial workaround: setting a certain private property to false removes the serialization constraint. Under the same test conditions, all four calls completed within 3.1 seconds.

This result basically confirms that the lock is the bottleneck — once removed, the time drops from 12 seconds to near the level of a single call.

MCP 2.x only

It should be emphasized that this approach only applies to MCP 2.x and is unofficial. Modifying a private property carries risks: it bypasses the protection logic set by the maintainers and could re-expose the old bug that was supposedly fixed in March under certain scenarios. Before adopting it in production, you should evaluate the stability cost and watch whether official future versions resolve the issue formally.

Private properties in most languages are merely naming or access-control conventions; at runtime, they don't prevent external reads and writes. So in JavaScript/TypeScript SDKs, by accessing an implementation object's internal field and setting it to false, you can bypass the serialization logic the developers put in place.

The risk with this approach is that private properties are not part of the public API — their names, semantics, and default values can be refactored or removed in minor version upgrades, causing the workaround to silently fail or even trigger more insidious errors. A more robust engineering practice is: wrap such bypasses in a toggleable configuration option, verify behavior through integration tests when upgrading dependencies, and continuously track progress on the upstream issue so the patch can be removed as soon as an official version is released.

Implications for Agent Development

This case exposes a layer in the Agent toolchain that is easily overlooked: the model's capabilities and the tool protocol itself are both fine — the bottleneck lies in the client implementation details between them.

We reproduced it on November 4th. Have you hit this?

Rivet mentioned that the issue was reproduced on November 4th and asked the community whether anyone had encountered the same situation. The value of such public reproduction is that it turns a sporadic performance anomaly into a verifiable, concrete defect.

For teams building multi-tool Agents, a few things are worth noting:

  • When the number of parallel calls increases, watch whether total time grows linearly rather than staying flat — that's a signal of serialization;
  • Version combinations of the SDK and protocol libraries need to be included in performance testing scope; compatibility layers are often blind spots;
  • Be cautious with unofficial workarounds, document their scope of applicability, and roll them back promptly once an official fix lands.

Performance problems in toolchains usually don't throw errors — they just quietly get slower. These problems are harder to detect and are all the more deserving of a dedicated line of defense in monitoring.

One-line Summary

A leftover mutex in the OpenAI Agents SDK and MCP compatibility layer degrades parallel tool calls into serial execution.

Paragraph Summary

The article discloses a performance defect when OpenAI Agents SDK 0.24.0 is paired with MCP 2.3.0: four tool calls that should each take 3 seconds in parallel actually take 12 seconds, a classic serial-additive pattern. After reproducing it, Rivet traced the issue to mutual exclusion logic inside MCP's streamable HTTP client, allowing only one request through at a time. The lock was a temporary safety net introduced in March to fix an old MCP bug; after that bug was fixed, the lock was never removed and became a long-term bottleneck. The team's tested unofficial workaround is to set a private property to false, which drops the four calls to 3.1 seconds — but it only applies to MCP 2.x and could re-expose the old bug. The article reminds developers to watch for performance blind spots in SDK and protocol library compatibility layers, and to be cautious with workarounds.

#OpenAI Agents SDK#MCP#streamable HTTP#mutex#parallel tool calls#performance bottleneck
Share:

Related articles