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

推荐订阅源

雷峰网
雷峰网
Y
Y Combinator Blog
酷 壳 – CoolShell
酷 壳 – CoolShell
The Cloudflare Blog
博客园_首页
J
Java Code Geeks
A
About on SuperTechFans
人人都是产品经理
人人都是产品经理
量子位
C
Check Point Blog
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
博客园 - 三生石上(FineUI控件)
L
LangChain Blog
N
Netflix TechBlog - Medium
Hugging Face - Blog
Hugging Face - Blog
B
Blog
美团技术团队
Microsoft Security Blog
Microsoft Security Blog
P
Proofpoint News Feed
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
宝玉的分享
宝玉的分享
罗磊的独立博客
MongoDB | Blog
MongoDB | Blog
Last Week in AI
Last Week in AI

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(providers): share Claude thinking profiles · ope...
steipete · 2026-04-27 · via Recent Commits to openclaw:main

@@ -1,8 +1,9 @@

1-

import { definePluginEntry, type ProviderThinkingProfile } from "openclaw/plugin-sdk/plugin-entry";

1+

import { definePluginEntry } from "openclaw/plugin-sdk/plugin-entry";

22

import { createProviderApiKeyAuthMethod } from "openclaw/plugin-sdk/provider-auth-api-key";

33

import {

44

matchesExactOrPrefix,

55

PASSTHROUGH_GEMINI_REPLAY_HOOKS,

6+

resolveClaudeThinkingProfile,

67

} from "openclaw/plugin-sdk/provider-model-shared";

78

import { normalizeLowercaseStringOrEmpty } from "openclaw/plugin-sdk/text-runtime";

89

import { applyOpencodeZenConfig, OPENCODE_ZEN_DEFAULT_MODEL } from "./api.js";

@@ -17,20 +18,6 @@ const OPENCODE_SHARED_WIZARD_GROUP = {

1718

groupLabel: "OpenCode",

1819

groupHint: OPENCODE_SHARED_HINT,

1920

} as const;

20-

const ANTHROPIC_OPUS_47_MODEL_PREFIXES = ["claude-opus-4-7", "claude-opus-4.7"] as const;

21-

const ANTHROPIC_ADAPTIVE_MODEL_PREFIXES = [

22-

"claude-opus-4-6",

23-

"claude-opus-4.6",

24-

"claude-sonnet-4-6",

25-

"claude-sonnet-4.6",

26-

] as const;

27-

const BASE_ANTHROPIC_THINKING_LEVELS = [

28-

{ id: "off" },

29-

{ id: "minimal" },

30-

{ id: "low" },

31-

{ id: "medium" },

32-

{ id: "high" },

33-

] as const satisfies ProviderThinkingProfile["levels"];

34213522

function isModernOpencodeModel(modelId: string): boolean {

3623

const lower = normalizeLowercaseStringOrEmpty(modelId);

@@ -40,32 +27,6 @@ function isModernOpencodeModel(modelId: string): boolean {

4027

return !matchesExactOrPrefix(lower, MINIMAX_MODERN_MODEL_MATCHERS);

4128

}

422943-

function matchesAnyPrefix(modelId: string, prefixes: readonly string[]): boolean {

44-

const lower = normalizeLowercaseStringOrEmpty(modelId);

45-

return prefixes.some((prefix) => lower.startsWith(prefix));

46-

}

47-48-

function resolveOpencodeThinkingProfile(modelId: string): ProviderThinkingProfile {

49-

if (matchesAnyPrefix(modelId, ANTHROPIC_OPUS_47_MODEL_PREFIXES)) {

50-

return {

51-

levels: [

52-

...BASE_ANTHROPIC_THINKING_LEVELS,

53-

{ id: "xhigh" },

54-

{ id: "adaptive" },

55-

{ id: "max" },

56-

],

57-

defaultLevel: "off",

58-

};

59-

}

60-

if (matchesAnyPrefix(modelId, ANTHROPIC_ADAPTIVE_MODEL_PREFIXES)) {

61-

return {

62-

levels: [...BASE_ANTHROPIC_THINKING_LEVELS, { id: "adaptive" }],

63-

defaultLevel: "adaptive",

64-

};

65-

}

66-

return { levels: BASE_ANTHROPIC_THINKING_LEVELS };

67-

}

68-6930

export default definePluginEntry({

7031

id: PROVIDER_ID,

7132

name: "OpenCode Zen Provider",

@@ -106,7 +67,7 @@ export default definePluginEntry({

10667

],

10768

...PASSTHROUGH_GEMINI_REPLAY_HOOKS,

10869

isModernModelRef: ({ modelId }) => isModernOpencodeModel(modelId),

109-

resolveThinkingProfile: ({ modelId }) => resolveOpencodeThinkingProfile(modelId),

70+

resolveThinkingProfile: ({ modelId }) => resolveClaudeThinkingProfile(modelId),

11071

});

11172

api.registerMediaUnderstandingProvider(opencodeMediaUnderstandingProvider);

11273

},