mirror of
https://github.com/openclaw/openclaw.git
synced 2026-06-06 05:51:15 +08:00
fix(stepfun): drop stale auth choice metadata
This commit is contained in:
@@ -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.
|
||||
|
||||
64
extensions/stepfun/index.test.ts
Normal file
64
extensions/stepfun/index.test.ts
Normal file
@@ -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"],
|
||||
},
|
||||
]);
|
||||
});
|
||||
});
|
||||
@@ -10,12 +10,10 @@
|
||||
"providers": [
|
||||
{
|
||||
"id": "stepfun",
|
||||
"authMethods": ["api-key"],
|
||||
"envVars": ["STEPFUN_API_KEY"]
|
||||
},
|
||||
{
|
||||
"id": "stepfun-plan",
|
||||
"authMethods": ["api-key"],
|
||||
"envVars": ["STEPFUN_API_KEY"]
|
||||
}
|
||||
]
|
||||
|
||||
Reference in New Issue
Block a user