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

推荐订阅源

博客园 - 聂微东
Y
Y Combinator Blog
WordPress大学
WordPress大学
L
LangChain Blog
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
A
About on SuperTechFans
小众软件
小众软件
有赞技术团队
有赞技术团队
S
SegmentFault 最新的问题
宝玉的分享
宝玉的分享
Recent Announcements
Recent Announcements
GbyAI
GbyAI
I
InfoQ
The GitHub Blog
The GitHub Blog
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
酷 壳 – CoolShell
酷 壳 – CoolShell
罗磊的独立博客
C
Check Point Blog
V
V2EX
Apple Machine Learning Research
Apple Machine Learning Research
月光博客
月光博客
量子位
雷峰网
雷峰网
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
ci: stabilize main checks · openclaw/openclaw@1c8de09
steipete · 2026-05-30 · via Recent Commits to openclaw:main

@@ -2,8 +2,10 @@ import {

22

normalizeGooglePreviewModelId,

33

normalizeTogetherModelId,

44

} from "../plugin-sdk/provider-model-id-normalize.js";

5-

import { normalizeProviderModelIdWithManifest } from "../plugins/manifest-model-id-normalization.js";

5+

import { getCurrentPluginMetadataSnapshot } from "../plugins/current-plugin-metadata-snapshot.js";

66

import type { PluginManifestRecord } from "../plugins/manifest-registry.js";

7+

import type { PluginManifestModelIdNormalizationProvider } from "../plugins/manifest.js";

8+

import { resolvePluginMetadataSnapshot } from "../plugins/plugin-metadata-snapshot.js";

79

import { normalizeLowercaseStringOrEmpty } from "../shared/string-coerce.js";

810

import { normalizeProviderId } from "./provider-id.js";

911

@@ -17,6 +19,82 @@ export type ProviderModelIdNormalizationOptions = {

1719

manifestPlugins?: readonly Pick<PluginManifestRecord, "modelIdNormalization">[];

1820

};

192122+

function collectManifestModelIdNormalizationPolicies(

23+

plugins: readonly Pick<PluginManifestRecord, "modelIdNormalization">[],

24+

): Map<string, PluginManifestModelIdNormalizationProvider> {

25+

const policies = new Map<string, PluginManifestModelIdNormalizationProvider>();

26+

for (const plugin of plugins) {

27+

for (const [provider, policy] of Object.entries(plugin.modelIdNormalization?.providers ?? {})) {

28+

policies.set(normalizeLowercaseStringOrEmpty(provider), policy);

29+

}

30+

}

31+

return policies;

32+

}

33+34+

function hasProviderPrefix(modelId: string): boolean {

35+

return modelId.includes("/");

36+

}

37+38+

function formatPrefixedModelId(prefix: string, modelId: string): string {

39+

return `${prefix.replace(/\/+$/u, "")}/${modelId.replace(/^\/+/u, "")}`;

40+

}

41+42+

function normalizeProviderModelIdWithManifestPlugins(params: {

43+

provider: string;

44+

plugins: readonly Pick<PluginManifestRecord, "modelIdNormalization">[];

45+

modelId: string;

46+

}): string | undefined {

47+

const policy = collectManifestModelIdNormalizationPolicies(params.plugins).get(

48+

normalizeLowercaseStringOrEmpty(params.provider),

49+

);

50+

if (!policy) {

51+

return undefined;

52+

}

53+54+

let modelId = params.modelId.trim();

55+

if (!modelId) {

56+

return modelId;

57+

}

58+59+

for (const prefix of policy.stripPrefixes ?? []) {

60+

const normalizedPrefix = normalizeLowercaseStringOrEmpty(prefix);

61+

if (normalizedPrefix && normalizeLowercaseStringOrEmpty(modelId).startsWith(normalizedPrefix)) {

62+

modelId = modelId.slice(prefix.length);

63+

break;

64+

}

65+

}

66+67+

modelId = policy.aliases?.[normalizeLowercaseStringOrEmpty(modelId)] ?? modelId;

68+69+

if (!hasProviderPrefix(modelId)) {

70+

for (const rule of policy.prefixWhenBareAfterAliasStartsWith ?? []) {

71+

if (normalizeLowercaseStringOrEmpty(modelId).startsWith(rule.modelPrefix.toLowerCase())) {

72+

return formatPrefixedModelId(rule.prefix, modelId);

73+

}

74+

}

75+

if (policy.prefixWhenBare) {

76+

return formatPrefixedModelId(policy.prefixWhenBare, modelId);

77+

}

78+

}

79+80+

return modelId;

81+

}

82+83+

function resolveManifestNormalizationPlugins(

84+

options: ProviderModelIdNormalizationOptions,

85+

): readonly Pick<PluginManifestRecord, "modelIdNormalization">[] | undefined {

86+

if (options.manifestPlugins) {

87+

return options.manifestPlugins;

88+

}

89+

return (

90+

getCurrentPluginMetadataSnapshot({

91+

allowWorkspaceScopedSnapshot: true,

92+

requireDefaultDiscoveryContext: true,

93+

})?.plugins ??

94+

resolvePluginMetadataSnapshot({ config: {}, allowWorkspaceScopedCurrent: true }).plugins

95+

);

96+

}

97+2098

export function modelKey(provider: string, model: string): string {

2199

const providerId = provider.trim();

22100

const modelId = model.trim();

@@ -42,16 +120,15 @@ export function normalizeStaticProviderModelId(

42120

if (options.allowManifestNormalization === false) {

43121

return normalizeBuiltInProviderModelId(normalizedProvider, model);

44122

}

45-

const manifestModelId =

46-

normalizeProviderModelIdWithManifest({

47-

provider: normalizedProvider,

48-

plugins: options.manifestPlugins,

49-

context: {

123+

const manifestPlugins = resolveManifestNormalizationPlugins(options);

124+

const manifestModelId = manifestPlugins

125+

? normalizeProviderModelIdWithManifestPlugins({

50126

provider: normalizedProvider,

127+

plugins: manifestPlugins,

51128

modelId: model,

52-

},

53-

}) ?? model;

54-

return normalizeBuiltInProviderModelId(normalizedProvider, manifestModelId);

129+

})

130+

: undefined;

131+

return normalizeBuiltInProviderModelId(normalizedProvider, manifestModelId ?? model);

55132

}

5613357134

function normalizeBuiltInProviderModelId(provider: string, model: string): string {

@@ -62,6 +139,10 @@ function normalizeBuiltInProviderModelId(provider: string, model: string): strin

62139

const trimmed = model.trim();

63140

return trimmed && !trimmed.includes("/") ? `openrouter/${trimmed}` : model;

64141

}

142+

if (provider === "nvidia") {

143+

const trimmed = model.trim();

144+

return trimmed && !trimmed.includes("/") ? `nvidia/${trimmed}` : model;

145+

}

65146

if (provider === "xai") {

66147

const xaiAliases: Record<string, string> = {

67148

"grok-4-fast-reasoning": "grok-4-fast",