Infer vendor from the agent registry name. The model comes from the agent's hook payload (e.g., SessionStart sends `"model": "claude-sonnet-4-5-20250929"`). We don't guess the model — only the vendor, which is deterministic from the agent name.
(agent_name: &str)
| 369 | /// `"model": "claude-sonnet-4-5-20250929"`). We don't guess the model — |
| 370 | /// only the vendor, which is deterministic from the agent name. |
| 371 | pub(crate) fn vendor_from_agent_name(agent_name: &str) -> &'static str { |
| 372 | match agent_name { |
| 373 | "claude-code" => "anthropic", |
| 374 | "cline" => "unknown", // Cline supports multiple providers; real vendor comes from hook payload |
| 375 | "copilot" => "github", |
| 376 | "cursor" => "anthropic", |
| 377 | "gemini-cli" => "google", |
| 378 | "codex" => "openai", |
| 379 | "kiro" => "amazon-bedrock", |
| 380 | "opencode" => "openai", |
| 381 | _ => "unknown", |
| 382 | } |
| 383 | } |
| 384 | |
| 385 | /// Truncate a string to `max_len` bytes, breaking at a word boundary where |
| 386 | /// possible and appending `"..."`. Mirrors the same helper in sibling modules. |
no outgoing calls