From 9e81be7228a20863f4d6e2de7aef014aadab56e4 Mon Sep 17 00:00:00 2001 From: alt-glitch Date: Tue, 9 Jun 2026 07:52:40 +0000 Subject: [PATCH] opentui(harden): configurable RPC timeout MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Read HERMES_TUI_RPC_TIMEOUT_MS for the JSON-RPC request timeout (floor 5s, default 120s) — Ink parity, env-tunable for slow handlers. --- ui-tui-opentui-v2/src/boundary/gateway/client.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/ui-tui-opentui-v2/src/boundary/gateway/client.ts b/ui-tui-opentui-v2/src/boundary/gateway/client.ts index 1d9e3f2a4ad..a2f2f074801 100644 --- a/ui-tui-opentui-v2/src/boundary/gateway/client.ts +++ b/ui-tui-opentui-v2/src/boundary/gateway/client.ts @@ -38,7 +38,10 @@ export interface RawClientOptions { readonly onExit?: (reason: string) => void } -const REQUEST_TIMEOUT_MS = 120_000 +const REQUEST_TIMEOUT_MS = (() => { + const raw = Number.parseInt(process.env.HERMES_TUI_RPC_TIMEOUT_MS ?? '', 10) + return Number.isFinite(raw) && raw > 0 ? Math.max(5000, raw) : 120_000 +})() export class RawGatewayClient { private proc: ReturnType | null = null