mirror of
https://github.com/openclaw/openclaw.git
synced 2026-08-25 20:05:46 -06:00
e50f73d331
* fix(onboard): activate media-only provider authentication * refactor(onboard): keep media model defaults plugin-private
38 lines
1.2 KiB
TypeScript
38 lines
1.2 KiB
TypeScript
// Fal tests cover onboard plugin behavior.
|
|
import {
|
|
type OpenClawConfig,
|
|
resolveAgentModelPrimaryValue,
|
|
} from "openclaw/plugin-sdk/provider-onboard";
|
|
import { describe, expect, it } from "vitest";
|
|
import { applyFalConfig } from "./onboard.js";
|
|
|
|
const emptyCfg: OpenClawConfig = {};
|
|
|
|
describe("applyFalConfig", () => {
|
|
it("writes the default image model to mediaModels.image (the key the runtime reads)", () => {
|
|
const result = applyFalConfig(emptyCfg);
|
|
|
|
expect(resolveAgentModelPrimaryValue(result.agents?.defaults?.mediaModels?.image)).toBe(
|
|
"fal/fal-ai/flux/dev",
|
|
);
|
|
// The retired key must stay untouched: nothing in the runtime reads it.
|
|
expect(result.agents?.defaults).not.toHaveProperty("imageGenerationModel");
|
|
});
|
|
|
|
it("does not overwrite an existing mediaModels.image default", () => {
|
|
const cfg = {
|
|
agents: {
|
|
defaults: {
|
|
mediaModels: { image: { primary: "other-provider/custom-model" } },
|
|
},
|
|
},
|
|
} as OpenClawConfig;
|
|
|
|
const result = applyFalConfig(cfg);
|
|
|
|
expect(resolveAgentModelPrimaryValue(result.agents?.defaults?.mediaModels?.image)).toBe(
|
|
"other-provider/custom-model",
|
|
);
|
|
});
|
|
});
|