RPC: auto-cancel hook UI prompts
This commit is contained in:
@@ -99,6 +99,8 @@ class TauRpcClient {
|
|||||||
error?: string;
|
error?: string;
|
||||||
message?: unknown;
|
message?: unknown;
|
||||||
willRetry?: boolean;
|
willRetry?: boolean;
|
||||||
|
id?: string;
|
||||||
|
method?: string;
|
||||||
};
|
};
|
||||||
|
|
||||||
if (evt.type === "response" && evt.command === "prompt") {
|
if (evt.type === "response" && evt.command === "prompt") {
|
||||||
@@ -140,6 +142,19 @@ class TauRpcClient {
|
|||||||
this.scheduleMaybeResolve();
|
this.scheduleMaybeResolve();
|
||||||
return;
|
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 {
|
} catch {
|
||||||
// ignore malformed/non-JSON lines
|
// ignore malformed/non-JSON lines
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user