mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-06 13:20:43 +00:00
build: update pi packages to 0.68.1
This commit is contained in:
@@ -1,19 +1,22 @@
|
||||
import { describe, it } from "vitest";
|
||||
import {
|
||||
expectProviderOnboardAllowlistAlias,
|
||||
expectProviderOnboardPrimaryAndFallbacks,
|
||||
} from "../../test/helpers/plugins/provider-onboard.js";
|
||||
import { describe, expect, it } from "vitest";
|
||||
import { expectProviderOnboardPrimaryAndFallbacks } from "../../test/helpers/plugins/provider-onboard.js";
|
||||
import { applyOpencodeGoConfig, applyOpencodeGoProviderConfig } from "./onboard.js";
|
||||
|
||||
const MODEL_REF = "opencode-go/kimi-k2.5";
|
||||
|
||||
describe("opencode-go onboard", () => {
|
||||
it("adds allowlist entry and preserves alias", () => {
|
||||
expectProviderOnboardAllowlistAlias({
|
||||
applyProviderConfig: applyOpencodeGoProviderConfig,
|
||||
modelRef: MODEL_REF,
|
||||
alias: "Kimi",
|
||||
});
|
||||
it("leaves model aliases to the pi catalog", () => {
|
||||
const cfg = {
|
||||
agents: {
|
||||
defaults: {
|
||||
models: {
|
||||
[MODEL_REF]: { alias: "Kimi" },
|
||||
},
|
||||
},
|
||||
},
|
||||
};
|
||||
|
||||
expect(applyOpencodeGoProviderConfig(cfg)).toBe(cfg);
|
||||
});
|
||||
|
||||
it("sets primary model and preserves existing model fallbacks", () => {
|
||||
|
||||
@@ -1,34 +1,12 @@
|
||||
import {
|
||||
applyAgentDefaultModelPrimary,
|
||||
withAgentModelAliases,
|
||||
type OpenClawConfig,
|
||||
} from "openclaw/plugin-sdk/provider-onboard";
|
||||
|
||||
export const OPENCODE_GO_DEFAULT_MODEL_REF = "opencode-go/kimi-k2.5";
|
||||
|
||||
const OPENCODE_GO_ALIAS_DEFAULTS: Record<string, string> = {
|
||||
"opencode-go/kimi-k2.5": "Kimi",
|
||||
"opencode-go/glm-5": "GLM",
|
||||
"opencode-go/minimax-m2.5": "MiniMax",
|
||||
};
|
||||
|
||||
export function applyOpencodeGoProviderConfig(cfg: OpenClawConfig): OpenClawConfig {
|
||||
return {
|
||||
...cfg,
|
||||
agents: {
|
||||
...cfg.agents,
|
||||
defaults: {
|
||||
...cfg.agents?.defaults,
|
||||
models: withAgentModelAliases(
|
||||
cfg.agents?.defaults?.models,
|
||||
Object.entries(OPENCODE_GO_ALIAS_DEFAULTS).map(([modelRef, alias]) => ({
|
||||
modelRef,
|
||||
alias,
|
||||
})),
|
||||
),
|
||||
},
|
||||
},
|
||||
};
|
||||
return cfg;
|
||||
}
|
||||
|
||||
export function applyOpencodeGoConfig(cfg: OpenClawConfig): OpenClawConfig {
|
||||
|
||||
Reference in New Issue
Block a user