惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

量子位
宝玉的分享
宝玉的分享
Apple Machine Learning Research
Apple Machine Learning Research
阮一峰的网络日志
阮一峰的网络日志
博客园 - 司徒正美
酷 壳 – CoolShell
酷 壳 – CoolShell
IT之家
IT之家
H
Help Net Security
雷峰网
雷峰网
M
MIT News - Artificial intelligence
Microsoft Security Blog
Microsoft Security Blog
美团技术团队
GbyAI
GbyAI
博客园_首页
博客园 - 三生石上(FineUI控件)
T
Tailwind CSS Blog
I
InfoQ
小众软件
小众软件
Google DeepMind News
Google DeepMind News
D
Docker
Engineering at Meta
Engineering at Meta
WordPress大学
WordPress大学
博客园 - Franky
Hugging Face - Blog
Hugging Face - Blog

Recent Commits to openclaw:main

test: merge chat side-result checks · openclaw/openclaw@ddd2c2a test: merge cron history checks · openclaw/openclaw@f7eb746 test: merge responsive navigation shell checks · openclaw/openclaw@c2e4b47 docs(changelog): add codex oauth fixes · openclaw/openclaw@628e6cd test: merge navigation routing cases · openclaw/openclaw@5d8cecb Tests: mock channel registry bundled fallback · openclaw/openclaw@2b08233 Secrets: avoid broad web search discovery for single plugin config · openclaw/openclaw@a464f59 test: merge config view browser checks · openclaw/openclaw@20cf511 fix(status): align oauth health with runtime · openclaw/openclaw@eed7116 feat: add macOS screen snapshots for monitor preview (#67954) thanks … · openclaw/openclaw@f377db1 fix: report shared auth scopes in hello-ok (#67810) thanks @BunsDev · openclaw/openclaw@0b6c39b Auto-reply: avoid eager bundled route fallback · openclaw/openclaw@3ea1bf4 Tests: narrow session binding contract setup · openclaw/openclaw@54e4e16 fix(macOS): enable undo/redo in webchat composer text input (#34962) · openclaw/openclaw@00951dc Tests: speed up channel setup promotion · openclaw/openclaw@82b529a Docs: refresh agent instructions · openclaw/openclaw@5775fe2 fix(auth): serialize OAuth refresh across agents to fix #26322 (#67876) · openclaw/openclaw@8e79080 test: allow ollama public surface boundary test · openclaw/openclaw@7d4f1a6 Docs: add test performance guardrails · openclaw/openclaw@89706d3 Tests: restore context-engine usage proof · openclaw/openclaw@e4c4f95 Tests: slim context engine runtime coverage · openclaw/openclaw@74c198f ci: retry failed custom checkouts · openclaw/openclaw@0ee5baf test: trim duplicate provider auth onboarding cases · openclaw/openclaw@1ffc02e matrix: fix sessions_spawn --thread subagent session spawning (#67643) · openclaw/openclaw@1ce2596 test: reduce auth choice fixture churn · openclaw/openclaw@857b9cd test: mock health status config boundaries · openclaw/openclaw@9d5ab4a test: mock onboard config io boundary · openclaw/openclaw@299694d test: mock legacy state plugin boundaries · openclaw/openclaw@2713089 test: mock channel install boundaries · openclaw/openclaw@b945248 test: mock doctor preview channel boundaries · openclaw/openclaw@b1a3ad4
refactor(deepinfra): drop unused provider config helper ·...
vincentkoc · 2026-06-19 · via Recent Commits to openclaw:main

@@ -10,7 +10,6 @@ import {

1010

import { captureEnv } from "openclaw/plugin-sdk/test-env";

1111

import { afterEach, describe, expect, it, vi } from "vitest";

1212

import {

13-

applyDeepInfraProviderConfig,

1413

applyDeepInfraConfig,

1514

DEEPINFRA_BASE_URL,

1615

DEEPINFRA_DEFAULT_MODEL_REF,

@@ -36,53 +35,6 @@ describe("DeepInfra provider config", () => {

3635

});

3736

});

383739-

describe("applyDeepInfraProviderConfig", () => {

40-

it("does not set provider models (discovery populates them at runtime)", () => {

41-

const result = applyDeepInfraProviderConfig(emptyCfg, DEEPINFRA_DEFAULT_MODEL_REF);

42-

expect(result.models?.providers?.deepinfra).toBeUndefined();

43-

});

44-45-

it("sets DeepInfra alias on the provided model ref", () => {

46-

const result = applyDeepInfraProviderConfig(emptyCfg, DEEPINFRA_DEFAULT_MODEL_REF);

47-

const agentModel = result.agents?.defaults?.models?.[DEEPINFRA_DEFAULT_MODEL_REF];

48-

expect(agentModel).toEqual({ alias: "DeepInfra" });

49-

});

50-51-

it("attaches the alias to a non-default model ref when provided", () => {

52-

const fallbackRef = "deepinfra/other/awesome-model";

53-

const result = applyDeepInfraProviderConfig(emptyCfg, fallbackRef);

54-

expect(result.agents?.defaults?.models?.[fallbackRef]?.alias).toBe("DeepInfra");

55-

expect(result.agents?.defaults?.models?.[DEEPINFRA_DEFAULT_MODEL_REF]).toBeUndefined();

56-

});

57-58-

it("preserves existing alias if already set", () => {

59-

const cfg: OpenClawConfig = {

60-

agents: {

61-

defaults: {

62-

models: {

63-

[DEEPINFRA_DEFAULT_MODEL_REF]: { alias: "My Custom Alias" },

64-

},

65-

},

66-

},

67-

};

68-

const result = applyDeepInfraProviderConfig(cfg, DEEPINFRA_DEFAULT_MODEL_REF);

69-

const agentModel = result.agents?.defaults?.models?.[DEEPINFRA_DEFAULT_MODEL_REF];

70-

expect(agentModel?.alias).toBe("My Custom Alias");

71-

});

72-73-

it("does not change the default model selection", () => {

74-

const cfg: OpenClawConfig = {

75-

agents: {

76-

defaults: {

77-

model: { primary: "openai/gpt-5" },

78-

},

79-

},

80-

};

81-

const result = applyDeepInfraProviderConfig(cfg, DEEPINFRA_DEFAULT_MODEL_REF);

82-

expect(resolveAgentModelPrimaryValue(result.agents?.defaults?.model)).toBe("openai/gpt-5");

83-

});

84-

});

85-8638

describe("applyDeepInfraConfig", () => {

8739

it("sets the provided model ref as the primary default", () => {

8840

const result = applyDeepInfraConfig(emptyCfg, DEEPINFRA_DEFAULT_MODEL_REF);

@@ -103,6 +55,22 @@ describe("DeepInfra provider config", () => {

10355

expect(resolveAgentModelPrimaryValue(result.agents?.defaults?.model)).toBe(fallbackRef);

10456

expect(result.agents?.defaults?.models?.[fallbackRef]?.alias).toBe("DeepInfra");

10557

});

58+59+

it("preserves an existing alias on the selected model", () => {

60+

const cfg: OpenClawConfig = {

61+

agents: {

62+

defaults: {

63+

models: {

64+

[DEEPINFRA_DEFAULT_MODEL_REF]: { alias: "My Custom Alias" },

65+

},

66+

},

67+

},

68+

};

69+

const result = applyDeepInfraConfig(cfg, DEEPINFRA_DEFAULT_MODEL_REF);

70+

expect(result.agents?.defaults?.models?.[DEEPINFRA_DEFAULT_MODEL_REF]?.alias).toBe(

71+

"My Custom Alias",

72+

);

73+

});

10674

});

1077510876

describe("env var resolution", () => {