fabro/crates
Bryan Helmkamp 950a2d06a7 Introduce Provider enum and ModelId type for compile-time provider safety
Replace scattered provider string literals ("anthropic", "openai", "gemini")
with a Provider enum and ModelId struct in the llm crate. This prevents
bugs like routing an OpenAI model to Anthropic's API (the bug fixed in
3263d0c) by making the provider identity a compile-time checked value.

Key changes:
- Add Provider enum (Anthropic, OpenAi, Gemini) with as_str/Display/FromStr
- Add ModelId struct bundling Provider + model name
- Replace WebFetchSummarizer's separate model+provider fields with ModelId
- Replace BaseProfile.id: &'static str with BaseProfile.provider: Provider
- Replace ProviderProfile::id() -> &str with provider() -> Provider
- Parse --provider CLI strings to Provider early via FromStr
- Update AgentBackend and CliBackend to use Provider instead of String/Option

Serialization boundaries (Request.provider, Response.provider, Client HashMap
keys) remain as strings, converted via provider.as_str().

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-02-28 03:29:30 -05:00
..
agent Introduce Provider enum and ModelId type for compile-time provider safety 2026-02-28 03:29:30 -05:00
attractor Introduce Provider enum and ModelId type for compile-time provider safety 2026-02-28 03:29:30 -05:00
git-storage Add git-storage crate for storing data in git object database 2026-02-24 23:17:44 -05:00
llm Introduce Provider enum and ModelId type for compile-time provider safety 2026-02-28 03:29:30 -05:00
mcp Add MCP client support for connecting to external tool servers 2026-02-27 23:28:33 -05:00
util Consolidate redact and terminal crates into util 2026-02-27 18:44:19 -05:00