Skip to content

feat: add StepFun provider support - #400

Merged
delete-cloud merged 1 commit into
mainfrom
dogfood/stepfun-provider-remote
May 30, 2026
Merged

delete-cloud merged 1 commit into
mainfrom
dogfood/stepfun-provider-remote

Conversation

@delete-cloud

@delete-cloud delete-cloud commented May 30, 2026 •

Copy link
Copy Markdown
Owner

Summary

  • add first-class stepfun provider selection backed by OpenAICompatProvider
  • use https://api.stepfun.com/v1 by default and STEP_API_KEY env fallback
  • cover CLI/config/runtime/HTTP session/provider plugin paths

Verification

  • uv run pytest tests/coding_agent/plugins/test_llm_provider.py tests/core/test_config.py tests/coding_agent/test_cli_pipeline.py::TestCliProviderChoices tests/coding_agent/test_cli_pipeline.py::TestHeadlessPipelineIsolation tests/coding_agent/test_bootstrap.py::TestBootstrap::test_create_agent_uses_stepfun_api_key_env_fallback tests/ui/test_http_server.py::TestSessionCreation::test_create_session_accepts_stepfun_runtime_provider tests/providers/test_openai_compat.py -q (83 passed)
  • uv run ruff check src/coding_agent/app.py src/coding_agent/core/config.py src/coding_agent/plugins/llm_provider.py tests/coding_agent/plugins/test_llm_provider.py tests/core/test_config.py tests/coding_agent/test_cli_pipeline.py tests/coding_agent/test_bootstrap.py tests/ui/test_http_server.py
  • git diff --check -- .
  • live StepFun smoke via provider=stepfun, model=step-3.7-flash, STEP_API_KEY env only; returned sanitized preview without printing secrets

Dogfood notes

DeepSeek v4-pro was used to drive the initial implementation attempt in this worktree. It completed the production-code core and hit max steps before tests; tests and final verification were completed manually.

Summary by CodeRabbit

  • New Features

    • Added support for StepFun as a new LLM provider with automatic API key resolution from the STEP_API_KEY environment variable
  • Tests

    • Added comprehensive test coverage for StepFun provider configuration and integration

Review Change Stack

@coderabbitai

coderabbitai Bot commented May 30, 2026 •

Copy link
Copy Markdown
Contributor

Caution

Review failed

Pull request was closed or merged during review

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 0bcfa338-69f9-4bd7-85a8-8f04596640b2

📥 Commits

Reviewing files that changed from the base of the PR and between c797037 and 71ff223.

📒 Files selected for processing (8)
  • coding-agent/src/coding_agent/app.py
  • coding-agent/src/coding_agent/core/config.py
  • coding-agent/src/coding_agent/plugins/llm_provider.py
  • coding-agent/tests/coding_agent/plugins/test_llm_provider.py
  • coding-agent/tests/coding_agent/test_bootstrap.py
  • coding-agent/tests/coding_agent/test_cli_pipeline.py
  • coding-agent/tests/core/test_config.py
  • coding-agent/tests/ui/test_http_server.py

📝 Walkthrough

Walkthrough

This PR adds "stepfun" as a new supported LLM provider with automatic STEP_API_KEY environment variable fallback. The implementation extends the provider type definition, configuration loading, plugin system, and app pipeline to handle the new provider alongside existing provider-specific environment variable fallback chains. Comprehensive test coverage validates the integration across unit, integration, and end-to-end layers.

Changes

Stepfun Provider Support

Layer / File(s) Summary
Stepfun provider type and config loading
coding-agent/src/coding_agent/core/config.py
Extends ProviderName type to include "stepfun" as a valid provider literal. load_config() adds a provider-specific branch to resolve api_key from the STEP_API_KEY environment variable when provider is "stepfun" and no api_key was supplied.
Provider plugin implementation and app fallback
coding-agent/src/coding_agent/plugins/llm_provider.py, coding-agent/src/coding_agent/app.py
LLMProviderPlugin.provide_llm() gains a "stepfun" provider branch that constructs OpenAICompatProvider with https://api.stepfun.com/v1 as the default base URL and sources API key from STEP_API_KEY fallback. create_child_pipeline() adds a matching "stepfun" environment variable fallback to the existing provider-specific chain.
Plugin unit tests
coding-agent/tests/coding_agent/plugins/test_llm_provider.py
TestStepFunProvider validates that LLMProviderPlugin with provider="stepfun" returns an OpenAICompatProvider, uses the default StepFun-compatible base URL, respects base_url overrides with trailing slash normalization, and prioritizes explicit api_key over the STEP_API_KEY environment variable.
Config unit tests
coding-agent/tests/core/test_config.py
Parametrized config construction test extended to include stepfun provider. TestLoadConfig adds two new test cases verifying load_config() uses STEP_API_KEY when AGENT_API_KEY is missing or empty for the stepfun provider choice.
Bootstrap and CLI integration tests
coding-agent/tests/coding_agent/test_bootstrap.py, coding-agent/tests/coding_agent/test_cli_pipeline.py
Bootstrap test verifies create_agent falls back to STEP_API_KEY when AGENT_API_KEY is absent for stepfun provider. CLI pipeline tests validate that CLI provider selection argument forwarding and headless run/pipeline flows both use STEP_API_KEY and correctly forward provider/model/api_key overrides to create_agent.
HTTP server session test
coding-agent/tests/ui/test_http_server.py
Session creation test confirms the HTTP server accepts stepfun runtime provider metadata, stores provider_name/model_name on the session object, and exposes the same values through the /sessions/{session_id} info endpoint.

Sequence Diagram(s)

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

Possibly related PRs

  • delete-cloud/Coding-Agent-Loop#85: Extends provider-routing code paths (load_config, create_child_pipeline, LLMProviderPlugin.provide_llm) to add provider-specific env-var API key fallback for deepseek, following the same pattern as this PR's stepfun implementation.

🐰 A new provider hops into the field,
StepFun dances where APIs yield,
Fallback keys from env they're sealed,
Config chains let secrets revealed! 🔐✨

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 3.57% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ 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: add StepFun provider support' directly and clearly summarizes the main change: adding support for a new StepFun provider to 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.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ 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 dogfood/stepfun-provider-remote

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

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

@delete-cloud
delete-cloud merged commit f575efb into main May 30, 2026
1 check was pending
@delete-cloud
delete-cloud deleted the dogfood/stepfun-provider-remote branch June 1, 2026 14:31
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