-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
fix: MCP per-call timeout, wire workflow context into prompt, fix parallel loop idx #3458
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -78,12 +78,14 @@ async def _run_async(self): | |
| response_queue, kind, name, arguments = item | ||
| try: | ||
| if kind == "resource": | ||
| result = await session.read_resource(name) | ||
| result = await asyncio.wait_for(session.read_resource(name), timeout=self.timeout) | ||
| elif kind == "prompt": | ||
| result = await session.get_prompt(name, arguments or None) | ||
| result = await asyncio.wait_for(session.get_prompt(name, arguments or None), timeout=self.timeout) | ||
| else: | ||
| result = await session.call_tool(name, arguments) | ||
| result = await asyncio.wait_for(session.call_tool(name, arguments), timeout=self.timeout) | ||
| response_queue.put((True, result)) | ||
| except asyncio.TimeoutError: | ||
| response_queue.put((False, f"MCP {kind} call timed out after {self.timeout} seconds (server side)")) | ||
|
Comment on lines
+87
to
+88
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win 🧩 Analysis chain🏁 Script executed: #!/bin/bash
set -euo pipefail
echo "== file excerpt =="
sed -n '1,130p' src/praisonai-agents/praisonaiagents/mcp/mcp.py
echo
echo "== timeout-related occurrences =="
rg -n "TimeoutError|wait_for|timeout|Response|response_queue|server side|configured timeout" src/praisonai-agents/praisonaiagents/mcp/mcp.py src/praisonai-agents -g '*.py' || trueRepository: MervinPraison/PraisonAI Length of output: 50380 Use neutral timeout wording. This timeout is enforced client-side by 🤖 Prompt for AI Agents |
||
| except Exception as e: | ||
| response_queue.put((False, str(e))) | ||
| except queue.Empty: | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.