RPC: auto-cancel hook UI prompts
This commit is contained in:
@@ -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
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user