Repository navigation
Conversation
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
变更说明
Adds Runcrate as a built-in model provider template. Runcrate serves open-weight models (DeepSeek, Qwen, Kimi, GLM, gpt-oss and others) behind an OpenAI-compatible API at
https://api.runcrate.ai/v1, so the template uses the defaultopenaiprovider type, the same wayopencode-goandmodelscopedo.featureRUNCRATE_API_KEY. Non-goals: no change to defaults, model selection, request handling or reasoning handling.Files:
backend/yuxi/modules/models/providers/builtin.py: newruncrateentry (base_url,api_key_env,models_endpoint), placed afteropencode-go.frontend/src/modules/settings/model/modelIcon.js:runcrateuses the neutraldefaultavatar, so the card does not fall back to the OpenAI logo throughprovider_type.工程主张与 Owner
runcrateprovider row exists, disabled, and an admin can enable it with a key and pick models from the live model list.BUILTIN_PROVIDERSowns the template;ensure_builtin_model_providers_in_dbseeds it once and never overwrites an edited row;is_enabledstaysFalsebecause onlysiliconflow-cnis enabled by default.验证情况
The template resolves to the OpenAI-compatible path and lists models
provider_type, wrong models endpoint._normalize_payload,fetch_remote_models.fetch_remote_modelson it:provider_type openai, 127 models returned, includingdeepseek-ai/DeepSeek-V4-Flash.test_builtin_provider_templates_default_to_openai_provider_typecovers every builtin template, including this one.Chat, tool calls and streaming through
load_chat_modelChatCompletionsAdapteragainst the real endpoint.yuxi.modules.models.chat.load_chat_model.ModelInfoforruncrate:deepseek-ai/DeepSeek-V4-Flashwith a real key and calledload_chat_model:invokereturnedokwith finish reasonstop;bind_toolswith aget_weathertool returned the callget_weather({"city": "Paris"});streamreturned 9 chunks joining took.Repo checks
cd backend && uv run pytest test/unit -m "not slow": 3622 passed, 22 failed, 1 skipped. The same 22 tests fail onmainwithout this change on this macOS host (Docker compose slot probe, Cube protocol, office/OCR conversion,renameat2in workdir copy); the failure lists are identical.uv run pytest test/unit/services/test_model_provider_service.py test/unit/config/test_options.py test/unit/services/test_model_selectors.py -m "not slow": 103 passed.uv run ruff check yuxi,uv run ruff format yuxi --check,uv run ruff check --select I yuxi: clean.python3 scripts/ci/verify_engineering_contracts.py: passed.python3 -m unittest scripts.ci.test_verify_engineering_contracts: 56 tests OK.cd frontend && npx eslint --max-warnings=0 src/modules/settings/model/modelIcon.js: clean.pnpm run test:unit: 1010 passed.简化 / 删除验收
不涉及
独立语义 Review
A fresh-context reviewer agent read
AGENTS.md,backend/AGENTS.mdand the full diff. It confirmed the entry shape, the disabled-by-default seeding, and that.envreaches api and worker without a Compose change. It flagged the OpenAI logo fallback (fixed by themodelIcon.jsline) and asked for the full unit suite, engineering contract checks and import sort check (results above).未验证范围与风险
runcrateis not in thepreserve_reasoningset inchat.py, so reasoning text from reasoning models is not carried across turns. Existing tests show a missing reasoning field does not break the tool flow, and the tool call above worked; I left the set unchanged to keep this PR data-only.事故反馈
不涉及
界面变更
The model provider list shows one more card, "Runcrate", with the neutral default avatar.
关联事项
无
补充说明
No migration: the row is added by the existing builtin seeding on app init, disabled until an admin enables it.
This PR was prepared with AI assistance (omp with Claude): the template entry, the avatar line, the test runs and this description were written with it, and the live calls above were run against the real Runcrate API.