fix(04): wire pending approval notifications in IPC and API server paths

This commit is contained in:
ZacharyZhang-NY committed 2026-03-22 17:12:40 -04:00
1 parent 9d01a7acc4
commit a2a110f0c5
5 files changed
+26 -2

No files matched your search

+9
View File
@@ -25,6 +25,7 @@ export function registerCoreOperationHandlers({
dispatchAutomation,
queueTaskRun,
getWorkerProcess,
notify,
}: Pick<
RegisterCoreHandlersDependencies,
| "registerHandle"
@@ -37,6 +38,7 @@ export function registerCoreOperationHandlers({
| "dispatchAutomation"
| "queueTaskRun"
| "getWorkerProcess"
| "notify"
>) {
registerHandle(IPC_CHANNELS.requestApproval, async (_event, payload) => {
const parsed = approvalInputSchema.parse(payload);
@@ -81,6 +83,13 @@ export function registerCoreOperationHandlers({
agentId: parsed.requestedByAgentId ?? undefined,
taskId: parsed.relatedTaskId ?? undefined,
});
notify({
title: "Approval Required",
body: parsed.payloadSummary ?? `${parsed.type} approval pending`,
urgency: "critical",
navigation: { section: "approvals", entityId: id },
batchKey: "pending_approval",
});
publishDomainChanged();
return ok(id);
});