Skip to content

feat(provider): add stepfun#83

Merged
bzp2010 merged 1 commit intomainfrom
bzp/feat-stepfun-provider
May 4, 2026
Merged

feat(provider): add stepfun#83
bzp2010 merged 1 commit intomainfrom
bzp/feat-stepfun-provider

Conversation

@bzp2010
Copy link
Copy Markdown
Collaborator

@bzp2010 bzp2010 commented May 4, 2026

Summary by CodeRabbit

  • New Features
    • Added StepFun provider support with configurable API key and optional custom API endpoint
    • Added localized provider names for English and Chinese interfaces

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 4, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 0843d2df-508c-4572-9f82-dc6220214151

📥 Commits

Reviewing files that changed from the base of the PR and between 8d9c7af and 487b694.

📒 Files selected for processing (8)
  • src/config/entities/providers-schema.json
  • src/config/entities/providers.rs
  • src/gateway/providers/mod.rs
  • src/gateway/providers/stepfun.rs
  • src/proxy/provider.rs
  • ui/src/i18n/locales/en.json
  • ui/src/i18n/locales/zh-CN.json
  • ui/src/lib/api/types.ts

📝 Walkthrough

Walkthrough

A new OpenAI-compatible provider named StepFun is added across the codebase. The change includes schema updates, a new provider configuration variant, provider implementation with auth and URL handling, gateway registration, proxy integration, and UI localization.

Changes

StepFun Provider Addition

Layer / File(s) Summary
Schema Definition
src/config/entities/providers-schema.json
"stepfun" is added to the top-level type.enum and the conditional allOf matcher for OpenAI-compatible provider routing.
Config Enum & Matching
src/config/entities/providers.rs
ProviderConfig::StepFun(configs::StepFunProviderConfig) variant is added with #[serde(rename = "stepfun")]. The provider_type() method is extended to return identifiers::STEPFUN for the new variant. A schema validation test case stepfun_ok is added.
Provider Implementation
src/gateway/providers/stepfun.rs
New StepFun provider module defines IDENTIFIER = "stepfun", StepFunProviderConfig struct with api_key and optional api_base, and registers the provider via provider! macro with bearer auth and StepFun base URL. Unit tests validate metadata, auth header construction, URL building, and request payload preservation.
Gateway Wiring
src/gateway/providers/mod.rs
Module declaration pub mod stepfun, re-export pub use stepfun::StepFun, identifier constant pub const STEPFUN, config re-export StepFunProviderConfig, and provider registration in default_provider_registry() are added. Registry test is extended to assert "stepfun" is present.
Proxy Integration
src/proxy/provider.rs
provider_auth_and_base_url() adds match arms for ProviderConfig::StepFun(config) to extract API key and parse optional base URL override. Corresponding unit test provider_auth_and_base_url_returns_stepfun_api_key_and_optional_base_url is added.
UI Types & Localization
ui/src/lib/api/types.ts, ui/src/i18n/locales/en.json, ui/src/i18n/locales/zh-CN.json
PROVIDER_TYPE_VARIANTS and Provider discriminated union are updated to include 'stepfun' with ApiBaseProviderConfig. English translation providerTypes.stepfun: "StepFun" and Chinese translation providerTypes.stepfun: "阶跃星辰" are added.

Estimated Code Review Effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly Related PRs

  • feat(provider): add openrouter #63 — Both PRs add a new OpenAI-compatible provider (openrouter vs. stepfun) by making parallel updates to providers-schema.json, ProviderConfig enum, gateway provider registration, proxy auth handling, and UI type/i18n files.
  • feat(provider): add cohere #75 — Both PRs extend the same provider-related codepaths (schema, ProviderConfig enum and provider_type match, gateway registry and mod, proxy auth/base_url, UI types).
  • feat(provider): add siliconflow #82 — Both PRs add a new OpenAI-compatible provider by updating the same code surfaces (JSON schema, ProviderConfig enum/matching, gateway providers module, and provider_auth_and_base_url).

Important

Pre-merge checks failed

Please resolve all errors before merging. Addressing warnings is optional.

❌ Failed checks (1 error, 1 warning)

Check name Status Explanation Resolution
Security Check ❌ Error StepFunProviderConfig contains plaintext api_key field without documented redaction mechanisms for logs/serialization. Implement custom Debug impl or serde redaction for api_key field to mask credentials in logs/responses; verify no plaintext storage.
E2e Test Quality Review ⚠️ Warning PR lacks E2E tests and has incomplete unit test coverage for boundary cases and error scenarios. Add E2E tests for complete StepFun provider flow and extend unit tests to cover boundary cases, invalid inputs, and error conditions.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'feat(provider): add stepfun' clearly and concisely describes the main change: adding support for a new StepFun provider across the codebase.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch bzp/feat-stepfun-provider

Review rate limit: 4/5 reviews remaining, refill in 12 minutes.

Comment @coderabbitai help to get the list of available commands and usage tips.

@bzp2010 bzp2010 merged commit 0429787 into main May 4, 2026
3 checks passed
@bzp2010 bzp2010 deleted the bzp/feat-stepfun-provider branch May 4, 2026 06:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant