-
Notifications
You must be signed in to change notification settings - Fork 1
Description
Project
cortex
Description
The Cortex CLI does not enforce the global timeout configuration when awaiting responses from Model Context Protocol (MCP) tools. If a connected MCP server hangs or takes longer than the configured timeout to return a tool result, the main CLI process blocks indefinitely waiting for the response.
Error Message
There is no error message; the CLI enters a non-responsive state with a loading spinner that spins indefinitely until manually terminated.Debug Logs
System Information
## Operating System
OS: Windows 11
## Hardware
CPU: Intel(R) Xeon(R) E-2388G CPU @ 3.20GHz (16 cores)
RAM: 125 GB
## Build Environment
Rust: rustc 1.92.0 (ded5c06cf 2025-12-08)
Target: x86_64
## Additional Context
This behavior indicates a missing `tokio::time::timeout` wrapper around the MCP client's request handling logic. The issue is strictly reproducible and violates the expected fault-tolerance specification of the application. It represents a critical reliability flaw in the integration of third-party MCP servers.Screenshots
No response
Steps to Reproduce
- Configure
cortexwith a strict timeout usingcortex config set timeout 5. - Connect a custom MCP server that implements a tool with an intentional 20-second delay (e.g., a
sleepfunction). - Start a chat session and instruct the agent to invoke this specific tool.
- Observe the CLI behavior after 5 seconds have passed.
Expected Behavior
The tool execution should be aborted after the configured 5-second timeout, returning a timeout error to the agent context so it can handle the failure gracefully.
Actual Behavior
The CLI ignores the global timeout setting for MCP transport layers, causing the application to hang until the external tool finishes or the user kills the process.
Additional Context
This behavior indicates a missing tokio::time::timeout wrapper around the MCP client's request handling logic. The issue is strictly reproducible and violates the expected fault-tolerance specification of the application. It represents a critical reliability flaw in the integration of third-party MCP servers.