From 0b2ab6c93c3a7691fa1890949a332676e8eaa89a Mon Sep 17 00:00:00 2001 From: Vincent Koc Date: Sat, 23 May 2026 08:23:56 +0200 Subject: [PATCH] fix(stepfun): drop stale auth choice metadata --- CHANGELOG.md | 1 + extensions/stepfun/index.test.ts | 64 +++++++++++++++++++++++++ extensions/stepfun/openclaw.plugin.json | 2 - 3 files changed, 65 insertions(+), 2 deletions(-) create mode 100644 extensions/stepfun/index.test.ts diff --git a/CHANGELOG.md b/CHANGELOG.md index fd4d0faa5fec..9d0842c28643 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -48,6 +48,7 @@ Docs: https://docs.openclaw.ai ### Fixes - Agents/tools: honor configured custom provider API keys when deciding whether media, image-generation, video-generation, music-generation, and PDF tools are available. (#85570) +- StepFun: stop advertising stale generic API key auth choices so onboarding only offers runtime-backed Standard and Step Plan choices. - Windows installer: fail Git checkout installs when `pnpm install` or `pnpm build` fails instead of writing a wrapper to a missing CLI build. - Sessions: surface previous-transcript archive failures during `/new` rotation so disk rename errors are logged instead of silently hiding stranded transcript files. Fixes #81984. (#85586, from #82081) Thanks @0xghost42. - TUI/agents: mirror internal-ui message-tool replies into final chat output so message-tool-only agents remain visible in `openclaw tui`. Fixes #85538. Thanks @danpolasek. diff --git a/extensions/stepfun/index.test.ts b/extensions/stepfun/index.test.ts new file mode 100644 index 000000000000..8394e7157372 --- /dev/null +++ b/extensions/stepfun/index.test.ts @@ -0,0 +1,64 @@ +import { readFileSync } from "node:fs"; +import { resolve } from "node:path"; +import { + registerProviderPlugin, + requireRegisteredProvider, +} from "openclaw/plugin-sdk/plugin-test-runtime"; +import { describe, expect, it } from "vitest"; +import stepfunPlugin from "./index.js"; + +type StepFunManifest = { + setup?: { + providers?: Array<{ + id?: string; + authMethods?: string[]; + envVars?: string[]; + }>; + }; + providerAuthChoices?: Array<{ + provider?: string; + method?: string; + choiceId?: string; + }>; +}; + +function readManifest(): StepFunManifest { + return JSON.parse(readFileSync(resolve(import.meta.dirname, "openclaw.plugin.json"), "utf-8")); +} + +describe("stepfun provider registration", () => { + it("keeps manifest auth choices aligned with runtime provider methods", async () => { + const { providers } = await registerProviderPlugin({ + plugin: stepfunPlugin, + id: "stepfun", + name: "StepFun", + }); + const manifest = readManifest(); + const runtimeChoices = ["stepfun", "stepfun-plan"].flatMap((providerId) => { + const provider = requireRegisteredProvider(providers, providerId); + return provider.auth.map((method) => ({ + provider: provider.id, + method: method.id, + choiceId: method.wizard?.choiceId, + })); + }); + + const manifestChoices = manifest.providerAuthChoices?.map((choice) => ({ + provider: choice.provider, + method: choice.method, + choiceId: choice.choiceId, + })); + + expect(runtimeChoices).toEqual(manifestChoices); + expect(manifest.setup?.providers).toEqual([ + { + id: "stepfun", + envVars: ["STEPFUN_API_KEY"], + }, + { + id: "stepfun-plan", + envVars: ["STEPFUN_API_KEY"], + }, + ]); + }); +}); diff --git a/extensions/stepfun/openclaw.plugin.json b/extensions/stepfun/openclaw.plugin.json index 4af669e89fca..a4db30d40091 100644 --- a/extensions/stepfun/openclaw.plugin.json +++ b/extensions/stepfun/openclaw.plugin.json @@ -10,12 +10,10 @@ "providers": [ { "id": "stepfun", - "authMethods": ["api-key"], "envVars": ["STEPFUN_API_KEY"] }, { "id": "stepfun-plan", - "authMethods": ["api-key"], "envVars": ["STEPFUN_API_KEY"] } ]