Skip to content

Local-first AI coding agent desktop: Electron + Rust host core + pi Agent Harness + user-installable plugins

fix(plugins): treat a null send callback as delivery success, not failure

koeriac7c26729f4f1
diff --git a/apps/desktop/electron/main/plugin-host-process.mjs b/apps/desktop/electron/main/plugin-host-process.mjs
index 4599ec051..ef8ae5054 100644
--- a/apps/desktop/electron/main/plugin-host-process.mjs
+++ b/apps/desktop/electron/main/plugin-host-process.mjs
@@ -134,14 +134,16 @@ function call(api, args = []) {
{ t: "call", id, api, args, ...(invocation ? { invocationId: invocation.id } : {}) },
// An async delivery failure means the channel to the broker is gone:
// fail the pending call and take the same terminal break as every
- // other transport error.
+ // other transport error. A null argument is a successful flush, not
+ // a failure: the child channel reports delivery as callback(null).
(error) => {
+ if (!error) return;
const entry = pending.get(id);
if (entry) {
pending.delete(id);
entry.reject(error);
}
- if (error) markBrokenAndExit(error);
+ markBrokenAndExit(error);
},
);
} catch (error) {