Problem
When spawn_agent is called, the task is written to a task file and handed to the child via @<taskPath>, but the parent window never shows what was sent. The tool result only reports the subagent id and location:
Spawned subagent in . ...
To see what a subagent is working on, the user has to switch to its tmux window. The parent transcript — the one place that records the whole delegation lifecycle (spawn → report → revise → close) — is missing the most important part: the task itself.
Expected behavior
After a successful spawn, the parent transcript should display the task that was delegated, alongside the id/location info. It should be visible without switching windows, and consistent with how subagent reports are already rendered (fork-result with renderForkMessage, including the collapsed preview for long text).
Fix
In spawn_agent's execute in index.ts, after the spawn succeeds, deliver the task via pi.sendMessage with a new custom type (e.g. fork-spawn), display: true, and no triggerTurn — this is a display-only record, not a new conversation event:
pi.sendMessage(
{
customType: SPAWN_TYPE,
content: `Spawned subagent ${id} in ${location}:\n\n${task}`,
display: true,
},
{ triggerTurn: false },
);
Register the type with the existing renderForkMessage renderer so long tasks collapse to the PREVIEW_LINES preview like reports do.
Problem
When
spawn_agentis called, the task is written to a task file and handed to the child via@<taskPath>, but the parent window never shows what was sent. The tool result only reports the subagent id and location:To see what a subagent is working on, the user has to switch to its tmux window. The parent transcript — the one place that records the whole delegation lifecycle (spawn → report → revise → close) — is missing the most important part: the task itself.
Expected behavior
After a successful spawn, the parent transcript should display the task that was delegated, alongside the id/location info. It should be visible without switching windows, and consistent with how subagent reports are already rendered (
fork-resultwithrenderForkMessage, including the collapsed preview for long text).Fix
In
spawn_agent'sexecuteinindex.ts, after the spawn succeeds, deliver the task viapi.sendMessagewith a new custom type (e.g.fork-spawn),display: true, and notriggerTurn— this is a display-only record, not a new conversation event:Register the type with the existing
renderForkMessagerenderer so long tasks collapse to thePREVIEW_LINESpreview like reports do.