AI-analysis but actually reproduced.
Summary
When pi-subagents runs parallel foreground tasks, an incoming message handled by pi-intercom can abort the parent tool call and terminate all child agents with SIGTERM (exit code 143).
This appears when the session is busy (!ctx.isIdle()), graceful detach is not accepted, and pi-intercom calls ctx.abort().
Repro Steps
- Start session A with both plugins enabled:
pi-intercom + pi-subagents.
- In session A, run a parallel call such as
subagent({ tasks: [...] }).
- Start session B connected to the same intercom broker.
- Send an intercom message from session B to session A while A is still running parallel tasks.
- Observe child subagents in A getting terminated.
Actual Result
- Aggregated run can show
0/N succeeded.
- Individual tasks fail with
exit code 143.
- Some workers may already have produced valid output before termination.
Expected Result
- Incoming intercom messages should not hard-abort unrelated parallel subagent work.
- Busy-session intercom handling should defer or non-destructively queue messages unless explicitly user-aborted.
Suspected Root Cause
In pi-intercom, when busy and detach is not accepted, the handler calls ctx.abort():
third-party-plugins/pi-intercom/index.ts (busy message handling branch)
In pi-subagents, foreground parallel child processes inherit the parent abort signal:
third-party-plugins/pi-subagents/subagent-executor.ts (runForegroundParallelTasks, passing input.signal)
third-party-plugins/pi-subagents/execution.ts (abort listener kills child with SIGTERM)
Detach is often rejected for normal built-in agents because allowIntercomDetach is gated by system prompt content and accepted depends on intercomStarted.
AI-analysis but actually reproduced.
Summary
When
pi-subagentsruns parallel foreground tasks, an incoming message handled bypi-intercomcan abort the parent tool call and terminate all child agents withSIGTERM(exit code 143).This appears when the session is busy (
!ctx.isIdle()), graceful detach is not accepted, andpi-intercomcallsctx.abort().Repro Steps
pi-intercom+pi-subagents.subagent({ tasks: [...] }).Actual Result
0/N succeeded.exit code 143.Expected Result
Suspected Root Cause
In
pi-intercom, when busy and detach is not accepted, the handler callsctx.abort():third-party-plugins/pi-intercom/index.ts(busy message handling branch)In
pi-subagents, foreground parallel child processes inherit the parent abort signal:third-party-plugins/pi-subagents/subagent-executor.ts(runForegroundParallelTasks, passinginput.signal)third-party-plugins/pi-subagents/execution.ts(abort listener kills child withSIGTERM)Detach is often rejected for normal built-in agents because
allowIntercomDetachis gated by system prompt content andaccepteddepends onintercomStarted.