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

推荐订阅源

J
Java Code Geeks
腾讯CDC
博客园 - 聂微东
爱范儿
爱范儿
罗磊的独立博客
P
Proofpoint News Feed
博客园 - Franky
博客园 - 三生石上(FineUI控件)
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
酷 壳 – CoolShell
酷 壳 – CoolShell
Jina AI
Jina AI
Blog — PlanetScale
Blog — PlanetScale
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
博客园 - 司徒正美
美团技术团队
MongoDB | Blog
MongoDB | Blog
WordPress大学
WordPress大学
A
About on SuperTechFans
I
InfoQ
博客园_首页
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
H
Help Net Security
Microsoft Azure Blog
Microsoft Azure Blog
G
Google Developers 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
fix: pass claude cli thinking effort (#77410) · openclaw/...
stainlu · 2026-05-05 · via Recent Commits to openclaw:main

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

66

normalizeClaudePermissionArgs,

77

normalizeClaudeSettingSourcesArgs,

88

resolveClaudePermissionMode,

9+

resolveClaudeCliExecutionArgs,

910

} from "./cli-shared.js";

10111112

describe("normalizeClaudePermissionArgs", () => {

@@ -75,6 +76,67 @@ describe("normalizeClaudeSettingSourcesArgs", () => {

7576

});

7677

});

777879+

describe("resolveClaudeCliExecutionArgs", () => {

80+

it("omits effort args when thinking is off", () => {

81+

expect(

82+

resolveClaudeCliExecutionArgs({

83+

workspaceDir: "/tmp",

84+

provider: "claude-cli",

85+

modelId: "claude-sonnet-4-6",

86+

thinkingLevel: "off",

87+

useResume: false,

88+

baseArgs: ["-p", "--output-format", "stream-json"],

89+

}),

90+

).toEqual(["-p", "--output-format", "stream-json"]);

91+

});

92+93+

it("maps OpenClaw thinking levels to Claude effort args", () => {

94+

expect(

95+

resolveClaudeCliExecutionArgs({

96+

workspaceDir: "/tmp",

97+

provider: "claude-cli",

98+

modelId: "claude-opus-4-7",

99+

thinkingLevel: "minimal",

100+

useResume: false,

101+

baseArgs: ["-p"],

102+

}),

103+

).toEqual(["-p", "--effort", "low"]);

104+

expect(

105+

resolveClaudeCliExecutionArgs({

106+

workspaceDir: "/tmp",

107+

provider: "claude-cli",

108+

modelId: "claude-opus-4-7",

109+

thinkingLevel: "adaptive",

110+

useResume: false,

111+

baseArgs: ["-p"],

112+

}),

113+

).toEqual(["-p", "--effort", "medium"]);

114+

expect(

115+

resolveClaudeCliExecutionArgs({

116+

workspaceDir: "/tmp",

117+

provider: "claude-cli",

118+

modelId: "claude-opus-4-7",

119+

thinkingLevel: "xhigh",

120+

useResume: true,

121+

baseArgs: ["-p", "--resume", "{sessionId}"],

122+

}),

123+

).toEqual(["-p", "--resume", "{sessionId}", "--effort", "xhigh"]);

124+

});

125+126+

it("replaces static effort args when a session thinking level is active", () => {

127+

expect(

128+

resolveClaudeCliExecutionArgs({

129+

workspaceDir: "/tmp",

130+

provider: "claude-cli",

131+

modelId: "claude-opus-4-7",

132+

thinkingLevel: "max",

133+

useResume: false,

134+

baseArgs: ["-p", "--effort", "low", "--effort=high"],

135+

}),

136+

).toEqual(["-p", "--effort", "max"]);

137+

});

138+

});

139+78140

describe("normalizeClaudeBackendConfig", () => {

79141

it("normalizes both args and resumeArgs for custom overrides", () => {

80142

const normalized = normalizeClaudeBackendConfig({

@@ -196,6 +258,7 @@ describe("normalizeClaudeBackendConfig", () => {

196258

expect(normalized?.resumeArgs).toContain("--permission-mode");

197259

expect(normalized?.resumeArgs).toContain("bypassPermissions");

198260

expect(normalized?.liveSession).toBe("claude-stdio");

261+

expect(backend.resolveExecutionArgs).toBe(resolveClaudeCliExecutionArgs);

199262

});

200263201264

it("leaves claude cli subscription-managed, restricts setting sources, and clears inherited env overrides", () => {