Skip to content

Commit 0b2ab6c

Browse files
committed
fix(stepfun): drop stale auth choice metadata
1 parent 73c1e37 commit 0b2ab6c

3 files changed

Lines changed: 65 additions & 2 deletions

File tree

‎CHANGELOG.md‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ Docs: https://docs.openclaw.ai
4848
### Fixes
4949

5050
- Agents/tools: honor configured custom provider API keys when deciding whether media, image-generation, video-generation, music-generation, and PDF tools are available. (#85570)
51+
- StepFun: stop advertising stale generic API key auth choices so onboarding only offers runtime-backed Standard and Step Plan choices.
5152
- Windows installer: fail Git checkout installs when `pnpm install` or `pnpm build` fails instead of writing a wrapper to a missing CLI build.
5253
- 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.
5354
- 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.

‎extensions/stepfun/index.test.ts‎

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
import { readFileSync } from "node:fs";
2+
import { resolve } from "node:path";
3+
import {
4+
registerProviderPlugin,
5+
requireRegisteredProvider,
6+
} from "openclaw/plugin-sdk/plugin-test-runtime";
7+
import { describe, expect, it } from "vitest";
8+
import stepfunPlugin from "./index.js";
9+
10+
type StepFunManifest = {
11+
setup?: {
12+
providers?: Array<{
13+
id?: string;
14+
authMethods?: string[];
15+
envVars?: string[];
16+
}>;
17+
};
18+
providerAuthChoices?: Array<{
19+
provider?: string;
20+
method?: string;
21+
choiceId?: string;
22+
}>;
23+
};
24+
25+
function readManifest(): StepFunManifest {
26+
return JSON.parse(readFileSync(resolve(import.meta.dirname, "openclaw.plugin.json"), "utf-8"));
27+
}
28+
29+
describe("stepfun provider registration", () => {
30+
it("keeps manifest auth choices aligned with runtime provider methods", async () => {
31+
const { providers } = await registerProviderPlugin({
32+
plugin: stepfunPlugin,
33+
id: "stepfun",
34+
name: "StepFun",
35+
});
36+
const manifest = readManifest();
37+
const runtimeChoices = ["stepfun", "stepfun-plan"].flatMap((providerId) => {
38+
const provider = requireRegisteredProvider(providers, providerId);
39+
return provider.auth.map((method) => ({
40+
provider: provider.id,
41+
method: method.id,
42+
choiceId: method.wizard?.choiceId,
43+
}));
44+
});
45+
46+
const manifestChoices = manifest.providerAuthChoices?.map((choice) => ({
47+
provider: choice.provider,
48+
method: choice.method,
49+
choiceId: choice.choiceId,
50+
}));
51+
52+
expect(runtimeChoices).toEqual(manifestChoices);
53+
expect(manifest.setup?.providers).toEqual([
54+
{
55+
id: "stepfun",
56+
envVars: ["STEPFUN_API_KEY"],
57+
},
58+
{
59+
id: "stepfun-plan",
60+
envVars: ["STEPFUN_API_KEY"],
61+
},
62+
]);
63+
});
64+
});

‎extensions/stepfun/openclaw.plugin.json‎

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,10 @@
1010
"providers": [
1111
{
1212
"id": "stepfun",
13-
"authMethods": ["api-key"],
1413
"envVars": ["STEPFUN_API_KEY"]
1514
},
1615
{
1716
"id": "stepfun-plan",
18-
"authMethods": ["api-key"],
1917
"envVars": ["STEPFUN_API_KEY"]
2018
}
2119
]

0 commit comments

Comments
 (0)