Let bots manage their hooks, with the user confirming what widens them
Bots get list_hooks, pause_hook and delete_hook, which act directly since they only take away. A new hook, or a new name, brief or filter, or switching a paused one back on, goes through propose_hook: it stores a hook_proposals row and puts a [hook-proposal:ID] card in the reply, which the user it was proposed to confirms or rejects. The card is read from what Confirm saves, with the bot's reason labelled as its own; confirming checks everything again and saves through the Hooks modal's helpers. A new hook's URL is shown on the card once, to the user only, never in the outcome the bot is told. What calls a hook, its computers and its signing are never proposed. Only chat replies propose, and a hook call's own run gets no hook tools, so a caller's payload can't reach them. Co-Authored-By: Claude Opus 5.5 <[email protected]>
This commit is contained in:
@@ -58,3 +58,16 @@ export const BotHookIdempotencyHeaders = [
|
||||
"x-request-id",
|
||||
"x-webhook-id",
|
||||
] as const;
|
||||
|
||||
/**
|
||||
* What a bot's hook proposal (`hook_proposals`) does once the user
|
||||
* confirms it: make a hook in the conversation it was proposed in, or
|
||||
* change one of theirs (its name, brief, filter, or switch it back on).
|
||||
* Pausing and deleting need no proposal: they only take away.
|
||||
*/
|
||||
export const HookProposalActions = [
|
||||
{ title: "Add", value: "create" },
|
||||
{ title: "Change", value: "change" },
|
||||
] as const;
|
||||
|
||||
export type HookProposalAction = (typeof HookProposalActions)[number]["value"];
|
||||
|
||||
@@ -108,6 +108,9 @@ export const JobStepToolLabels: Record<string, string> = {
|
||||
start_task: "Starting a task",
|
||||
delegate_task: "Handing work to the crew",
|
||||
hand_over_schedule: "Handing a routine to the crew",
|
||||
propose_hook: "Proposing a hook",
|
||||
pause_hook: "Pausing a hook",
|
||||
delete_hook: "Deleting a hook",
|
||||
assign_computer: "Changing computer access",
|
||||
update_memory: "Updating memory",
|
||||
update_instructions: "Updating instructions",
|
||||
|
||||
@@ -65,11 +65,15 @@ export const ReservedToolNames = [
|
||||
"create_workspace",
|
||||
"delegate_task",
|
||||
"delete_extension",
|
||||
"delete_hook",
|
||||
"delete_schedule",
|
||||
"list_extensions",
|
||||
"list_hooks",
|
||||
"list_schedules",
|
||||
"load_skill",
|
||||
"pause_hook",
|
||||
"propose_custom_tool",
|
||||
"propose_hook",
|
||||
"propose_mcp_server",
|
||||
"propose_skill",
|
||||
"report_run_failed",
|
||||
|
||||
Reference in New Issue
Block a user