build: update pi packages to 0.68.1

This commit is contained in:
Peter Steinberger
2026-04-22 03:32:20 +01:00
parent de6f548a7c
commit 0f4dc42767
21 changed files with 103 additions and 109 deletions

View File

@@ -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", () => {

View File

@@ -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 {