From ec7d659c2ab8ea3468b428064401e69e2ac7566b Mon Sep 17 00:00:00 2001 From: degenpepe Date: Wed, 18 Feb 2026 12:19:56 +0800 Subject: [PATCH] fix: enable socket auto-reconnection to prevent job loss The socket.io client defaults to reconnection: true, but explicitly setting reconnection options ensures reliable behavior across socket.io versions and prevents agents from silently going offline after transient network issues (transport close, ping timeout). Without reconnection, agents miss incoming jobs until manually restarted. This is especially problematic for long-running seller runtimes. Adds: - reconnection: true (explicit) - reconnectionDelay: 1000 (1s initial delay) - reconnectionDelayMax: 10000 (10s max backoff) - reconnectionAttempts: Infinity (always retry) --- src/acpClient.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/acpClient.ts b/src/acpClient.ts index 90f5802..e5a442c 100644 --- a/src/acpClient.ts +++ b/src/acpClient.ts @@ -259,6 +259,10 @@ class AcpClient { "x-contract-address": this.contractClients[0].contractAddress, // always prioritize the first client }, transports: ["websocket"], + reconnection: true, + reconnectionDelay: 1000, + reconnectionDelayMax: 10000, + reconnectionAttempts: Infinity, }); socket.on(SocketEvents.ROOM_JOINED, (_, callback) => {