pub fn detect_agent(command: &[String]) -> AgentKindExpand description
Detect the agent kind from the command argv (FR-1.2).
Rules:
- If
commandis empty, this is a caller bug →Generic. - If the basename of
command[0]isclaude(with optional.exeon Windows), →ClaudeCode. - If the basename is
codex→CodexCli. - If the basename is
gemini→GeminiCli. - Otherwise →
Generic.
A forced --adapter flag bypasses this; the CLI wires that by passing the
adapter’s AgentKind directly, so detection only runs for the auto path.