spring-projects / spring-projects/spring-ai

Occasionally, the mcp tool invoked by springai reports this error:Did not observe any item or terminal signal within 20000ms in 'Mono.deferContextual ⇢ at io.modelcontextprotocol.spec.McpClientSession.sendRequest(McpClientSession.java:233)'

Open
#4,083 7 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

status: waiting-for-triage
Dominant language
Java
Stars
9.5k
Forks
2.9k
Avg merge
1d 7h
Merged PRs (30d)
6

Description

Bug description
I am using the Playwright MCP tool, and this unexpected error occurs occasionally. I'm not sure if it's a bug in the underlying Spring AI or if the tool has timed out in response
If the tool response times out, how should we correctly set the timeout period

Environment
spring ai 1.0,0

org.springframework.ai
spring-ai-starter-model-deepseek

Prompt prompt = new Prompt(getMessageList(), this.chatOptions);
ToolExecutionResult toolExecutionResult = toolCallingManager.executeToolCalls(prompt, toolCallChatResponse);

Steps to reproduce
This abnormal error occurs sporadically and cannot be reproduced

Minimal Complete Reproducible example
java.util.concurrent.TimeoutException: Did not observe any item or terminal signal within 20000ms in 'Mono.deferContextual ⇢ at io.modelcontextprotocol.spec.McpClientSession.sendRequest(McpClientSession.java:233)' (and no fallback has been configured)

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with io.modelcontextprotocol.spec.McpClientSession.sendRequest at line 233 and the toolExecutionManager.executeToolCalls call shown in the report. Determine whether the 20-second timeout originates in Spring AI or the MCP tool, then identify the supported timeout configuration. Done means the timeout behavior or configuration is clarified and covered by a reproducible test.

Written by the indexing model from the issue text.

Assessment

Tech stack
java, spring
Domain
ai, backend-api-design
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.