From 53c349cb86048a75a2a074405e7dad6f0f023542 Mon Sep 17 00:00:00 2001 From: Peter Steinberger Date: Wed, 10 Dec 2025 11:46:28 +0000 Subject: [PATCH] RPC: auto-cancel hook UI prompts --- src/process/tau-rpc.ts | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/src/process/tau-rpc.ts b/src/process/tau-rpc.ts index 9cc3366d9..577950b0e 100644 --- a/src/process/tau-rpc.ts +++ b/src/process/tau-rpc.ts @@ -99,6 +99,8 @@ class TauRpcClient { error?: string; message?: unknown; willRetry?: boolean; + id?: string; + method?: string; }; if (evt.type === "response" && evt.command === "prompt") { @@ -140,6 +142,19 @@ class TauRpcClient { this.scheduleMaybeResolve(); return; } + + // Handle hook UI requests by auto-cancelling (non-interactive surfaces like WhatsApp) + if (evt.type === "hook_ui_request" && evt.id) { + // Fire-and-forget response to unblock hook runner + this.child?.stdin.write( + `${JSON.stringify({ + type: "hook_ui_response", + id: evt.id, + cancelled: true, + })}\n`, + ); + return; + } } catch { // ignore malformed/non-JSON lines }