MCPcopy Create free account
hub / github.com/atomicdotdev/atomic / vendor_from_agent_name

Function vendor_from_agent_name

atomic-agent/src/turn/orchestrator/mod.rs:371–383  ·  view source on GitHub ↗

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)

Source from the content-addressed store, hash-verified

369/// `"model": "claude-sonnet-4-5-20250929"`). We don't guess the model —
370/// only the vendor, which is deterministic from the agent name.
371pub(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.

Callers 3

handle_session_startMethod · 0.70

Calls

no outgoing calls

Tested by 1