Skip to content

fix(agent): raise MCP cold-start timeout to 30s in openai and deep runners#345

Open
jellyfishing2346 wants to merge 1 commit into
IBM:mainfrom
jellyfishing2346:task-355
Open

fix(agent): raise MCP cold-start timeout to 30s in openai and deep runners#345
jellyfishing2346 wants to merge 1 commit into
IBM:mainfrom
jellyfishing2346:task-355

Conversation

@jellyfishing2346
Copy link
Copy Markdown
Contributor

Description

SDK default of 5s is exceeded by heavy servers (e.g. vibration/scipy) on
first cold-start invocation. Plumb client_session_timeout_seconds into
MCPServerStdio (openai-agent) and session_kwargs.read_timeout_seconds into
MultiServerMCPClient connections (deep-agent). Configurable via
MCP_INIT_TIMEOUT_SECONDS env var. claude-agent unaffected (load_timeout_ms
already defaults to 60s).

Fix Details

Impact on Benchmarking

  • No change to baselines: This fix only improves stability/performance.
  • Baseline change: This fix corrects a scoring error. (Please provide "Before vs. After" results).

Related Issues

Verification Steps

  1. Run the following command: uv run pytest tests/integration
  2. Describe any manual verification performed:

Checklist

  • I have added tests that prove my fix is effective.
  • My code follows the project's Ruff formatting and linting rules.
  • I have signed off my commits (DCO).

…nners

Signed-off-by: Faizan Khan <faizanakhan2003@gmail.com>
@jellyfishing2346
Copy link
Copy Markdown
Contributor Author

Hi @DhavalRepo18, this PR fixes the cold-start timeout issue from #335. When a user runs the agent for the first time on a fresh install, some MCP servers like the vibration server take longer than 5 seconds to start up because they have to load heavy packages like scipy. This caused the whole run to crash. The fix bumps the timeout to 30 seconds in the openai-agent and deep-agent runners, which is generous enough to survive any cold start without affecting normal warm runs since those finish in well under a second. The claude-agent runner didn't need changes because it already has a 60 second timeout built into the SDK. All existing tests still pass, and the timeout can be overridden with the MCP_INIT_TIMEOUT_SECONDS environment variable for users on particularly slow machines.

@DhavalRepo18
Copy link
Copy Markdown
Collaborator

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.

Cold-start MCP-init timeout aborts agent run on fresh install

2 participants