Helper lifecycle
Clean up helper sessions created during agent coordination.
Creation and visibility
A subshell created with a pane's own token is marked as cross-agent communication. It appears under Cross-agent comms and starts with its notification bell off.
That classification remains even if the owner changes its notification preference later. It records how the helper was created.
Finish the exchange
- Confirm the helper's result has been collected.
- Record any output you need to keep.
- Call
terminate_subshellto stop it while retaining its row and history. - Use
delete_subshellinstead if the owner intends permanent removal.
The agent that opens a helper is responsible for cleaning it up. Do not assume an idle prompt or completed task removes the session.
Exited helpers
A helper process can exit while its row remains status: "running" with alive: false. send_to_subshell refuses that state. An authorized restart_subshell revives it using the same ID.
Restart can accept a new prompt. Inspect promptDelivered afterward rather than assuming the text was accepted.
Self restart
Restarting your own subshell terminates the process making the request. Do not use self-restart as a way to refresh tools during an active task.
Deletion is owner-only and removes captured history. Retained terminated logs remain subject to the server's retention policy.
Next steps
Read Session lifecycle and MCP tool reference.
Edit on GitHubLast updated on
