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

推荐订阅源

钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
大猫的无限游戏
大猫的无限游戏
月光博客
月光博客
Last Week in AI
Last Week in AI
腾讯CDC
The Cloudflare Blog
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
MyScale Blog
MyScale Blog
博客园 - Franky
MongoDB | Blog
MongoDB | Blog
I
InfoQ
雷峰网
雷峰网
人人都是产品经理
人人都是产品经理
Blog — PlanetScale
Blog — PlanetScale
Y
Y Combinator Blog
H
Help Net Security
T
Tailwind CSS Blog
美团技术团队
aimingoo的专栏
aimingoo的专栏
博客园 - 三生石上(FineUI控件)
云风的 BLOG
云风的 BLOG
Google DeepMind News
Google DeepMind News
P
Proofpoint News Feed

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
fix(agents): skip model normalization in context warmup ·...
steipete · 2026-05-02 · via Recent Commits to openclaw:main

@@ -15,7 +15,12 @@ import { normalizeProviderId } from "./model-selection.js";

15151616

export { resetContextWindowCacheForTest } from "./context-runtime-state.js";

171718-

type ModelEntry = { id: string; contextWindow?: number; contextTokens?: number };

18+

type ModelEntry = {

19+

id: string;

20+

provider?: string;

21+

contextWindow?: number;

22+

contextTokens?: number;

23+

};

1924

type ModelRegistryLike = {

2025

getAvailable?: () => ModelEntry[];

2126

getAll: () => ModelEntry[];

@@ -53,7 +58,7 @@ export function applyDiscoveredContextWindows(params: {

5358

: typeof model.contextWindow === "number"

5459

? Math.trunc(model.contextWindow)

5560

: undefined;

56-

const contextTokens = shouldUseDiscoveredAnthropicOpus47ContextWindow(model.id)

61+

const contextTokens = shouldUseDiscoveredAnthropicOpus47ContextWindow(model)

5762

? ANTHROPIC_CONTEXT_1M_TOKENS

5863

: discoveredContextTokens;

5964

if (!contextTokens || contextTokens <= 0) {

@@ -236,7 +241,9 @@ function ensureContextWindowCacheLoaded(): Promise<void> {

236241

await import("./pi-model-discovery-runtime.js");

237242

const agentDir = resolveOpenClawAgentDir();

238243

const authStorage = discoverAuthStorage(agentDir);

239-

const modelRegistry = discoverModels(authStorage, agentDir) as unknown as ModelRegistryLike;

244+

const modelRegistry = discoverModels(authStorage, agentDir, {

245+

normalizeModels: false,

246+

}) as unknown as ModelRegistryLike;

240247

const models =

241248

typeof modelRegistry.getAvailable === "function"

242249

? modelRegistry.getAvailable()

@@ -418,17 +425,23 @@ function shouldUseAnthropicOpus47ContextWindow(params: {

418425

);

419426

}

420427421-

function shouldUseDiscoveredAnthropicOpus47ContextWindow(modelId: string): boolean {

428+

function shouldUseDiscoveredAnthropicOpus47ContextWindow(model: ModelEntry): boolean {

429+

const provider =

430+

typeof model.provider === "string" ? normalizeProviderId(model.provider) : undefined;

431+

const modelId = model.id;

422432

if (!isClaudeOpus47Model(modelId)) {

423433

return false;

424434

}

435+

if (provider) {

436+

return provider === "anthropic" || provider === "claude-cli";

437+

}

425438

const normalized = normalizeLowercaseStringOrEmpty(modelId);

426439

const slash = normalized.indexOf("/");

427440

if (slash < 0) {

428441

return false;

429442

}

430-

const provider = normalizeProviderId(normalized.slice(0, slash));

431-

return provider === "claude-cli";

443+

const inferredProvider = normalizeProviderId(normalized.slice(0, slash));

444+

return inferredProvider === "claude-cli";

432445

}

433446434447

function resolveModelFamilyId(modelId: string): string {