Keep every hook call's response, searchable by the user and the bot
A hook call used to record only how it was taken; its run's answer went to the chat alone and was lost to the call once the job was pruned. Now `bot_hook_events` keeps `response`, `response_message_id` and `responded_at`, written on every call a run took in when that run ends (completed, failed, lost, stopped or cancelled) by `recordHookCallResponse` in the job helpers, and calls turn done or failed. The Calls view searches what calls sent and what runs answered, filters by status and pages; Show all loads one call whole. Bots get `search_hook_calls` and `read_hook_call` for their own hooks (never in a hook call's own run), with payloads always marked as outside data. Calls are kept for the app setting `hook_events_keep_days` (Settings > General, default now 30 days). The caller still only gets 202 Queued. Co-Authored-By: Claude Opus 5.5 <[email protected]>
This commit is contained in:
@@ -26,11 +26,15 @@ export type BotHookSignatureFormat = (typeof BotHookSignatureFormats)[number]["v
|
||||
/**
|
||||
* What became of one call to a hook: it queued a run, joined a run still
|
||||
* waiting, was refused (a bad signature, a paused hook), repeated a call
|
||||
* already taken, or was a notification the hook's filter left out.
|
||||
* already taken, or was a notification the hook's filter left out. Queued
|
||||
* and merged calls wait on their run, and turn answered or failed when it
|
||||
* ends (`recordHookCallResponse`), with its response.
|
||||
*/
|
||||
export const BotHookEventStatuses = [
|
||||
{ title: "Queued", value: "queued" },
|
||||
{ title: "Merged", value: "merged" },
|
||||
{ title: "Answered", value: "done" },
|
||||
{ title: "Failed", value: "failed" },
|
||||
{ title: "Rejected", value: "rejected" },
|
||||
{ title: "Duplicate", value: "duplicate" },
|
||||
{ title: "Ignored", value: "ignored" },
|
||||
@@ -71,3 +75,9 @@ export const HookProposalActions = [
|
||||
] as const;
|
||||
|
||||
export type HookProposalAction = (typeof HookProposalActions)[number]["value"];
|
||||
|
||||
/**
|
||||
* The app setting (Settings > General) for how many days hook calls are
|
||||
* kept, else `AppData.BotHookEventsKeepDays`.
|
||||
*/
|
||||
export const HookEventsKeepDaysSettingKey = "hook_events_keep_days";
|
||||
|
||||
@@ -113,6 +113,8 @@ export const JobStepToolLabels: Record<string, string> = {
|
||||
capture_secret: "Saving a secret",
|
||||
show_secret: "Showing a secret",
|
||||
pause_hook: "Pausing a hook",
|
||||
search_hook_calls: "Looking through hook calls",
|
||||
read_hook_call: "Reading a hook call",
|
||||
delete_hook: "Deleting a hook",
|
||||
assign_computer: "Changing computer access",
|
||||
update_memory: "Updating memory",
|
||||
|
||||
@@ -77,9 +77,11 @@ export const ReservedToolNames = [
|
||||
"propose_hook",
|
||||
"propose_mcp_server",
|
||||
"propose_skill",
|
||||
"read_hook_call",
|
||||
"report_run_failed",
|
||||
"request_secret",
|
||||
"search_computers",
|
||||
"search_hook_calls",
|
||||
"send_message",
|
||||
"set_bot_workspace_instructions",
|
||||
"set_extension_access",
|
||||
|
||||
Reference in New Issue
Block a user