fix(ipc): steer desktop messages into live runs

This commit is contained in:
ZacharyZhang-NY committed 2026-04-23 19:12:32 -04:00
1 parent a1dd361f51
commit b520de9a51
4 files changed
+132 -1

No files matched your search

+12
View File
@@ -202,6 +202,18 @@ export function createMainRuntimeSupport(state: MainRuntimeState) {
notify: (options) => requireIpcSupport().notify(options),
wakeAgentIfPossible: (agentId, companyId, trigger) =>
requireOrchestrationService().wakeAgentIfPossible(agentId, companyId, trigger),
injectRuntimeMessage: (recipientAgentId, companyId, message) => {
const injector = requireServiceGraph().getRuntimeMessageInjector();
if (!injector) return false;
try {
return injector.tryInject(recipientAgentId, companyId, message);
} catch (error) {
log.warn(
`[ipc-domain] runtime message injection failed for agent ${recipientAgentId}: ${error instanceof Error ? error.message : String(error)}`,
);
return false;
}
},
dispatchAutomation: (trigger, ctx) => requireAutomationService().dispatchAutomation(trigger, ctx),
runWorkflowPipeline: (workflowId, companyId) =>
requireAutomationService().runWorkflowPipeline(workflowId, companyId),