From 6470d1a74dc5932143b15bf506247af693b8d540 Mon Sep 17 00:00:00 2001 From: StillHammer Date: Sun, 25 Jan 2026 11:46:33 +0700 Subject: [PATCH] Increase listen timeout: max 60min, default 30min --- README.md | 2 +- broker/index.js | 6 +++--- mcp-partner/tools/listen.js | 6 +++--- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index e337500..607da2d 100644 --- a/README.md +++ b/README.md @@ -85,7 +85,7 @@ listen() |------|-------------| | `register(name?)` | Register with the network (optional, auto on startup) | | `talk(message, to?, conversation?)` | Send a message | -| `listen(conversation?, timeout?)` | Listen for messages (2-15 min timeout) | +| `listen(conversation?, timeout?)` | Listen for messages (2-60 min timeout, default 30) | | `list_partners()` | List connected partners | ### Conversations diff --git a/broker/index.js b/broker/index.js index 2242027..4b23664 100644 --- a/broker/index.js +++ b/broker/index.js @@ -245,9 +245,9 @@ app.get("/listen/:partnerId", (req, res) => { const { partnerId } = req.params; const { conversationId } = req.query; - // Timeout en minutes (min 2, max 15, défaut 2) - let timeoutMinutes = parseInt(req.query.timeout) || 2; - timeoutMinutes = Math.max(2, Math.min(15, timeoutMinutes)); + // Timeout en minutes (min 2, max 60, défaut 30) + let timeoutMinutes = parseInt(req.query.timeout) || 30; + timeoutMinutes = Math.max(2, Math.min(60, timeoutMinutes)); const timeoutMs = timeoutMinutes * 60 * 1000; DB.setPartnerOnline(partnerId); diff --git a/mcp-partner/tools/listen.js b/mcp-partner/tools/listen.js index a57b5e8..16d9b52 100644 --- a/mcp-partner/tools/listen.js +++ b/mcp-partner/tools/listen.js @@ -12,7 +12,7 @@ export const definition = { }, timeout: { type: "number", - description: "Timeout en minutes (min: 2, max: 15, défaut: 2)", + description: "Timeout en minutes (min: 2, max: 60, défaut: 30)", }, }, }, @@ -22,8 +22,8 @@ export async function handler(args) { try { await ensureRegistered(); - let timeoutMinutes = args.timeout || 2; - timeoutMinutes = Math.max(2, Math.min(15, timeoutMinutes)); + let timeoutMinutes = args.timeout || 30; + timeoutMinutes = Math.max(2, Math.min(60, timeoutMinutes)); let url = `/listen/${myId}?timeout=${timeoutMinutes}`; if (args.conversation) {