feat(provider): add AdaL (SylphAI) as a built-in provider#2868
feat(provider): add AdaL (SylphAI) as a built-in provider#2868chindris-mihai-alexandru wants to merge 1 commit intoantinomyhq:mainfrom
Conversation
There was a problem hiding this comment.
Pull request overview
Adds AdaL (SylphAI) as a built-in provider so ForgeCode can authenticate via ADAL_API_KEY and use AdaL’s OpenAI-compatible chat completions endpoint, with models fetched dynamically.
Changes:
- Added an
adalprovider entry to the embeddedprovider.json(OpenAI-compatible chat + dynamic models URL). - Added
ProviderId::ADALplus built-in registration, display-name mapping, andFromStrparsing support inforge_domain.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
crates/forge_repo/src/provider/provider.json |
Adds the adal provider configuration (endpoints, auth method, response type). |
crates/forge_domain/src/provider.rs |
Introduces ProviderId::ADAL and wires it into built-in provider utilities and parsing. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| "claude_code" => ProviderId::CLAUDE_CODE, | ||
| "vertex_ai" => ProviderId::VERTEX_AI, | ||
| "big_model" => ProviderId::BIG_MODEL, | ||
| "azure" => ProviderId::AZURE, | ||
| "github_copilot" => ProviderId::GITHUB_COPILOT, | ||
| "openai_compatible" => ProviderId::OPENAI_COMPATIBLE, | ||
| "openai_responses_compatible" => ProviderId::OPENAI_RESPONSES_COMPATIBLE, | ||
| "anthropic_compatible" => ProviderId::ANTHROPIC_COMPATIBLE, | ||
| "forge_services" => ProviderId::FORGE_SERVICES, | ||
| "io_intelligence" => ProviderId::IO_INTELLIGENCE, | ||
| "minimax" => ProviderId::MINIMAX, | ||
| "codex" => ProviderId::CODEX, | ||
| "fireworks-ai" => ProviderId::FIREWORKS_AI, | ||
| "novita" => ProviderId::NOVITA, | ||
| "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())), |
There was a problem hiding this comment.
ProviderId::from_str is intended to return the borrowed built-in constants for built-in IDs, but several built-in providers (e.g. vertex_ai_anthropic, bedrock, opencode_zen) are missing from this match. That causes those IDs to fall through to the custom branch, allocating a new String each parse and making behavior inconsistent with other built-ins. Add explicit match arms for the missing built-in IDs (and consider a test to prevent regressions).
There was a problem hiding this comment.
Fixed — added the missing FromStr match arms for vertex_ai_anthropic, bedrock, and opencode_zen in the updated commit. These pre-existing gaps are now closed. All 27 built-in provider constants now have corresponding FromStr arms.
| @@ -106,6 +107,7 @@ | |||
| ProviderId::FIREWORKS_AI, | |||
| ProviderId::NOVITA, | |||
| ProviderId::GOOGLE_AI_STUDIO, | |||
| ProviderId::ADAL, | |||
| ] | |||
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
Fixed — added 3 targeted unit tests in the updated commit:
test_adal_from_str— verifies"adal"parses toProviderId::ADALtest_adal_display_name— verifies display name is"AdaL"test_adal_in_built_in_providers— verifies presence inbuilt_in_providers()
All 20 provider tests pass.
Add AdaL CLI by SylphAI as a new provider option in ForgeCode. AdaL is
registered as an OpenAI-compatible provider with api.sylph.ai endpoints,
enabling ForgeCode users to access AdaL's models via API key auth.
Changes:
- Add 'adal' entry to provider.json with OpenAI response type
- Add ProviderId::ADAL constant to forge_domain
- Wire up display_name ("AdaL"), FromStr, and built_in_providers()
- Add missing FromStr arms for vertex_ai_anthropic, bedrock, opencode_zen
- Add unit tests for ADAL display name, from_str, and built_in_providers
Co-Authored-By: ForgeCode <noreply@forgecode.dev>
c933d80 to
57ac2a0
Compare
|
Addressed both review comments from Copilot:
All 20 provider tests pass ✅ |
Summary
Add AdaL (SylphAI) as a built-in provider in ForgeCode, enabling users to access AdaL's AI models directly from the ForgeCode terminal.
Motivation
AdaL CLI by SylphAI is a self-evolving coding agent that provides access to models from OpenAI, Anthropic, Google, and more. Adding AdaL as a provider in ForgeCode allows:
forge provider login adalADAL_API_KEYChanges
crates/forge_repo/src/provider/provider.jsonadalprovider entry with OpenAI-compatible response typehttps://api.sylph.ai/v1/chat/completionshttps://api.sylph.ai/v1/models(dynamic model fetching)ADAL_API_KEY)crates/forge_domain/src/provider.rsProviderId::ADALconstant"adal"tobuilt_in_providers()list"AdaL"display name mapping"adal"toFromStrimplementationTesting
cargo check -p forge_domainpassescargo test -p forge_domain -- provider)Related
🌸 Generated with AdaL