Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 25 additions & 0 deletions crates/forge_domain/src/provider.rs
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ impl ProviderId {
pub const FIREWORKS_AI: ProviderId = ProviderId(Cow::Borrowed("fireworks-ai"));
pub const NOVITA: ProviderId = ProviderId(Cow::Borrowed("novita"));
pub const GOOGLE_AI_STUDIO: ProviderId = ProviderId(Cow::Borrowed("google_ai_studio"));
pub const ADAL: ProviderId = ProviderId(Cow::Borrowed("adal"));

/// Returns all built-in provider IDs
///
Expand Down Expand Up @@ -106,6 +107,7 @@ impl ProviderId {
ProviderId::FIREWORKS_AI,
ProviderId::NOVITA,
ProviderId::GOOGLE_AI_STUDIO,
ProviderId::ADAL,
]
Comment on lines 73 to 111
Copy link

Copilot AI Apr 6, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

New ADAL provider ID handling was added, but the unit tests in this file don't cover it (no assertions for ProviderId::ADAL display name, from_str("adal"), or presence in built_in_providers()). Please add targeted tests alongside the existing ProviderId tests to ensure this mapping doesn’t regress.

Copilot uses AI. Check for mistakes.
Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed — added 3 targeted unit tests in the updated commit:

  • test_adal_from_str — verifies "adal" parses to ProviderId::ADAL
  • test_adal_display_name — verifies display name is "AdaL"
  • test_adal_in_built_in_providers — verifies presence in built_in_providers()

All 20 provider tests pass.

}

Expand All @@ -132,6 +134,7 @@ impl ProviderId {
"fireworks-ai" => "FireworksAI".to_string(),
"novita" => "Novita".to_string(),
"google_ai_studio" => "GoogleAIStudio".to_string(),
"adal" => "AdaL".to_string(),
_ => {
// For other providers, use UpperCamelCase conversion
use convert_case::{Case, Casing};
Expand Down Expand Up @@ -176,7 +179,11 @@ impl std::str::FromStr for ProviderId {
"codex" => ProviderId::CODEX,
"fireworks-ai" => ProviderId::FIREWORKS_AI,
"novita" => ProviderId::NOVITA,
"vertex_ai_anthropic" => ProviderId::VERTEX_AI_ANTHROPIC,
"bedrock" => ProviderId::BEDROCK,
"opencode_zen" => ProviderId::OPENCODE_ZEN,
"google_ai_studio" => ProviderId::GOOGLE_AI_STUDIO,
"adal" => ProviderId::ADAL,
// For custom providers, use Cow::Owned to avoid memory leaks
custom => ProviderId(Cow::Owned(custom.to_string())),
};
Expand Down Expand Up @@ -581,6 +588,24 @@ mod tests {
assert_eq!(actual, expected);
}

#[test]
fn test_adal_from_str() {
let actual = ProviderId::from_str("adal").unwrap();
let expected = ProviderId::ADAL;
assert_eq!(actual, expected);
}

#[test]
fn test_adal_display_name() {
assert_eq!(ProviderId::ADAL.to_string(), "AdaL");
}

#[test]
fn test_adal_in_built_in_providers() {
let built_in = ProviderId::built_in_providers();
assert!(built_in.contains(&ProviderId::ADAL));
}

#[test]
fn test_io_intelligence() {
let fixture = "test_key";
Expand Down
9 changes: 9 additions & 0 deletions crates/forge_repo/src/provider/provider.json
Original file line number Diff line number Diff line change
Expand Up @@ -3099,5 +3099,14 @@
"input_modalities": ["text"]
}
]
},
{
"id": "adal",
"api_key_vars": "ADAL_API_KEY",
"url_param_vars": [],
"response_type": "OpenAI",
"url": "https://api.sylph.ai/v1/chat/completions",
"models": "https://api.sylph.ai/v1/models",
"auth_methods": ["api_key"]
}
]
Loading