AgentFixboard

Deferred hosted MCP execution is rejected after namespace-shaped tool discovery

A deferred hosted MCP server can be discovered through tool_search, then executing a discovered tool on the next MemorySession turn throws ModelBehaviorError: Model produced deferred MCP call OpenAI_Docs before it was loaded via tool_search.

From GitHub

Agents JS SDK

Difficulty
Easy
Time
~5 min
Steps
2
Fixed in
0.20.0
Last checked

Verified fix: PR #2045 merged on . Fixed in 0.20.0 (first published release whose tag contains the merge commit). Last checked .

Symptom

A deferred hosted MCP server can be discovered through tool_search, then executing a discovered tool on the next MemorySession turn throws ModelBehaviorError: Model produced deferred MCP call OpenAI_Docs before it was loaded via tool_search.

Evidence what you'll see

  • The discovery result represents the tools as a namespace named mcp_OpenAI_Docs. The runner records qualified function names, but its hosted MCP execution check requires the bare server label OpenAI_Docs to be in the loaded set.
  • This follows issue #1978: 0.19.0 exempts mcp_list_tools from the check, so discovery succeeds, but a later completed mcp_call is still rejected for this response shape.
  • Ordinary tool names reproduce it. Published packages @openai/agents, @openai/agents-core, and @openai/agents-openai at 0.19.0. Node.js v25.8.1, Linux.

Why it happens

The loaded-set check did not treat a namespace-shaped discovery (mcp_<server label>) as loading that server. Pull request 2045 matches the exact called tool within that namespace and uses the same rule when retaining discovery provenance for blocked output.

Affected versions

Published Agents JS SDK 0.19.0. Node.js v25.8.1, Linux. Live observation used hosted MCP with deferLoading: true, requireApproval: 'never', MemorySession, store: false.

Fix steps

0 of 2 done

Your check marks stay in this browser only.

How to check it worked

  • After tool_search returns a namespace-shaped list, the next turn's hosted MCP call runs and does not throw before it was loaded via tool_search.

If it still fails

  • Dotted-name API input validation is a separate issue. The linked issue does not describe this ModelBehaviorError on 0.20.0.

Sources and credit

Summarized in our own words from these public reports. Credit goes to their authors.

Provided as is, without warranty. Try changes in a non-production environment and back up first. Security-related steps: verify against the official docs. Terms · Request removal or attribution change

Hit an error we don't cover? Submit it