Skip to content

feat(provider): add AdaL (SylphAI) as a built-in provider#2868

Open
chindris-mihai-alexandru wants to merge 1 commit intoantinomyhq:mainfrom
chindris-mihai-alexandru:feat/adal-provider
Open

feat(provider): add AdaL (SylphAI) as a built-in provider#2868
chindris-mihai-alexandru wants to merge 1 commit intoantinomyhq:mainfrom
chindris-mihai-alexandru:feat/adal-provider

Conversation

@chindris-mihai-alexandru
Copy link
Copy Markdown

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:

  • Cross-tool model access — ForgeCode users can use AdaL's model routing via forge provider login adal
  • Credential sharing — Developers using both tools can share their ADAL_API_KEY
  • Expanded ecosystem — Connects two popular AI development tools

Changes

crates/forge_repo/src/provider/provider.json

  • Added adal provider entry with OpenAI-compatible response type
  • API endpoint: https://api.sylph.ai/v1/chat/completions
  • Models endpoint: https://api.sylph.ai/v1/models (dynamic model fetching)
  • Auth: API key (ADAL_API_KEY)

crates/forge_domain/src/provider.rs

  • Added ProviderId::ADAL constant
  • Added "adal" to built_in_providers() list
  • Added "AdaL" display name mapping
  • Added "adal" to FromStr implementation

Testing

  • cargo check -p forge_domain passes
  • ✅ All 17 provider tests pass (cargo test -p forge_domain -- provider)
  • ✅ JSON validation passes

Related

🌸 Generated with AdaL

Copilot AI review requested due to automatic review settings April 6, 2026 18:27
@github-actions github-actions bot added the type: feature Brand new functionality, features, pages, workflows, endpoints, etc. label Apr 6, 2026
@CLAassistant
Copy link
Copy Markdown

CLAassistant commented Apr 6, 2026

CLA assistant check
All committers have signed the CLA.

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

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 adal provider entry to the embedded provider.json (OpenAI-compatible chat + dynamic models URL).
  • Added ProviderId::ADAL plus built-in registration, display-name mapping, and FromStr parsing support in forge_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.

Comment on lines 168 to 185
"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())),
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.

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).

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 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.

Comment on lines 73 to 111
@@ -106,6 +107,7 @@
ProviderId::FIREWORKS_AI,
ProviderId::NOVITA,
ProviderId::GOOGLE_AI_STUDIO,
ProviderId::ADAL,
]
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.

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>
@chindris-mihai-alexandru
Copy link
Copy Markdown
Author

Addressed both review comments from Copilot:

  1. Missing FromStr match arms — Added explicit arms for vertex_ai_anthropic, bedrock, and opencode_zen that were previously falling through to the custom branch. This pre-existing issue is now fixed as part of this PR.

  2. Unit tests for ProviderId::ADAL — Added 3 tests:

    • 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 the built-in list

All 20 provider tests pass ✅

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

type: feature Brand new functionality, features, pages, workflows, endpoints, etc.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants