Asked on Discord, answer verified by @Strum355:
cody-agent.exe runs as a JSON-RPC server and encapsulates all the prompt logic. The JetBrains plugin launches the Cody agent server during startup and communicates via the agent protocol to accomplish tasks like listing and executing commands.