Skip to content

fix(providers): 补齐 StepFun Plan 订阅端点配置 - #1139

Merged
vastsa merged 5 commits into
vastsa:mainfrom
zszz3:codex/fix-stepfun-plan-763
Sep 28, 2026
Merged

vastsa merged 5 commits into
vastsa:mainfrom
zszz3:codex/fix-stepfun-plan-763

Conversation

@zszz3

@zszz3 zszz3 commented Sep 27, 2026 •

Copy link
Copy Markdown
Contributor

修复内容

当前模型目录已收录 StepFun Plan 和 Step 5 Preview,但「添加 AI 服务」的预设列表缺少订阅端点。本 PR 补齐 StepFun Plan 配置入口,默认使用 https://api.stepfun.com/step_plan/v1 和 Anthropic Messages;现有适配器将请求发送到 /step_plan/v1/messages。

  • 使用当前 models.dev 的 stepfun-step-plan vendorKey,能力和上限直接取第一方目录。
  • 保留已有自定义服务和高级设置,普通 StepFun API 配置不变。
  • 服务列表和选中后的摘要显示域名及路径,直接可见 api.stepfun.com/step_plan/v1,窄屏允许换行;显示标签不包含 URL 用户名、密码或查询参数。默认接口仍是 Anthropic Messages。
  • 同步 9 种语言名称和使用说明,无数据库迁移、依赖升级或运行时协议改动。

替代 #763。旧 PR 的硬编码模型补充已被主线目录覆盖,本次不再引入,也不携带旧 PR 的语音和锁文件修复。

审核意见处理

  • 已合入当前上游 main b684e661797996db3ac64c3c5bdf5764a38fd522(0.15.9),保留分支历史。
  • provider-presets.test.ts 固定断言 vendorKey、订阅 URL、apiStyle,并确认普通 /v1 地址不会匹配订阅预设。
  • service-catalog.test.mjs 覆盖唯一入口以及中文名称、英文名称、vendorKey、订阅 URL 搜索。
  • e2e-provider-api-style 永久覆盖中英文用户路径:选择 StepFun Plan → 输入测试密钥 → 发现模型 → 显式选择 Step 5 Preview → 保存;检查发现请求和保存参数。
  • E2E 计划已记录该场景和验证边界。

最终候选验证

Task candidate: 267698ccbea8e5a0ab122221936e111cbfac8175
Base main: b684e661797996db3ac64c3c5bdf5764a38fd522
Environment: macOS,复用本机依赖,独立工作目录与临时 Electron profile。

  • 预设测试 20/20;最终提交的服务选择、选择器、表单布局和接口格式测试 47/47,通过。
  • 完整 e2e-provider-api-style:22 个场景通过,覆盖英文和简体中文;6 次创建、28 次更新均通过模拟 API 边界检查。此前 Codex 场景的基线失败随上游同步解决。
  • 最终提交额外用真实样式在 640px 宽窗口检查中英文 StepFun 选择和保存,列表与摘要都显示完整订阅路径且未横向裁切。
  • 故意把 StepFun 接口格式改错时,新增配置断言和用户路径测试均能捕获错误;恢复后通过。
  • JS 全量构建、Desktop typecheck、lint、架构检查、文档检查(520 页)通过。
  • check:pr-base -- --base upstream/main --head HEAD 通过。

界面测试使用真实设置组件,外部 API 被替换为测试边界;不声称覆盖 Host 落库、真实密钥或付费模型请求。本次 PR 没有 Rust 代码差异,未额外运行本地 Rust 全量检查。

官方依据:Step Plan API 接入说明。

Expose the subscription endpoint in the service picker so its key is
paired with the Step Plan route and Anthropic Messages format. Bind it
to the existing first-party models.dev vendor record.

Reuse published model capabilities and existing runtime adapters instead
of carrying the obsolete Step 5 metadata supplement from PR vastsa#763.

@vastsa vastsa left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

整体实现方向正确:Step Plan 预设的 .com 地址、Anthropic Messages 格式与仓库现有 URL 归一化逻辑相符。请处理以下两项后再合并:

  1. 更新主线基线。 当前远端 origin/main 是 2a4b80a6ef9f4136a44345021f21b7a4f1f9e634,PR head 38ab396a09b46df20344261d1bb466e2a7881123 的父提交仍是 3f5ada32eadd002a283d59820682b1a60addf30d,因此 head 不包含最新主线。现有基线检查是在主线推进前通过的;请更新分支并重跑相关检查。

  2. 补持久回归覆盖。 新增的是用户可选的预设,但现有 provider-presets.test.ts / service-catalog.test.mjs 没有断言该项的 vendorKey、URL 和 apiStyle;e2e-provider-api-style 也没有覆盖选择并保存 StepFun Plan。PR 描述的临时 Electron 检查不能防止后续回归。请加入针对该配置的断言,并在 E2E 计划记录对应用户路径(选择预设 → 输入密钥 → 发现/选择模型 → 保存)。

Keep the subscription vendor, endpoint and API format under durable
regression coverage, including discovery and explicit model selection
through the real settings form in both supported fixture languages.

Incorporate upstream main and document the user path so the temporary
validation from the original PR remains reproducible in the repository.
Refresh the StepFun Plan candidate against upstream 0.15.9 before PR
validation, preserving the existing preset and regression coverage.
Display endpoint hosts and paths in both the service picker and selected
service summary so StepFun Plan does not look like the ordinary API.
Allow long routes to wrap while excluding URL credentials and query data
from the visible endpoint label.

Keep request configuration unchanged and cover the visible subscription
path alongside the existing Anthropic discovery and save assertions.
@zszz3

zszz3 commented Sep 28, 2026

Copy link
Copy Markdown
Contributor Author

@vastsa 两项审核意见已处理,当前 head 为 267698ccb,麻烦再看一下:

  1. 已同步上游 main b684e6617(0.15.9),远端“Head contains latest base”检查通过。
  2. 已补充仓库内永久回归覆盖:预设的 vendorKey、URL、apiStyle 断言;服务选择与搜索;中英文“选择 StepFun Plan → 输入密钥 → 发现/选择模型 → 保存”的完整界面流程,并更新 E2E 计划。临时改错接口格式时,配置断言和界面测试均能捕获错误。

另外,服务列表和选中后的摘要现在直接显示 api.stepfun.com/step_plan/v1,避免只显示域名造成误解;默认保持 Anthropic Messages,请求路径不变。

本地相关测试及完整 provider 界面测试通过,远端 JS、Rust、Docs、PR base 四项检查全部通过。界面测试使用模拟 API 边界,未调用真实付费模型。

@vastsa
vastsa merged commit 961870e into vastsa:main Sep 28, 2026
4 checks passed
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.

2 participants