fix(04): wire pending approval notifications in IPC and API server paths
This commit is contained in:
1 parent
9d01a7acc4
commit
a2a110f0c5
5 files changed
+26
-2
No files matched your search
@@ -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);
|
||||
});
|
||||
|
||||
Reference in new issue
Block a user