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

推荐订阅源

WordPress大学
WordPress大学
L
LangChain Blog
酷 壳 – CoolShell
酷 壳 – CoolShell
罗磊的独立博客
J
Java Code Geeks
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
博客园 - 叶小钗
小众软件
小众软件
博客园 - Franky
D
Docker
Google DeepMind News
Google DeepMind News
Microsoft Azure Blog
Microsoft Azure Blog
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
U
Unit 42
宝玉的分享
宝玉的分享
C
Check Point Blog
B
Blog
V
V2EX
博客园 - 三生石上(FineUI控件)
MyScale Blog
MyScale Blog
The Cloudflare Blog
博客园 - 聂微东
博客园_首页
Engineering at Meta
Engineering at Meta

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: harden response format forwarding · openclaw/opencla...
steipete · 2026-05-15 · via Recent Commits to openclaw:main

@@ -44,6 +44,7 @@ const providerRuntimeDeps = {

4444

};

45454646

let preparedExtraParamsCache = new WeakMap<OpenClawConfig, Map<string, Record<string, unknown>>>();

47+

const REQUEST_SCOPED_EXTRA_PARAM_KEYS = new Set(["response_format", "responseFormat"]);

47484849

export const __testing = {

4950

setProviderRuntimeDepsForTest(

@@ -112,6 +113,16 @@ export function resolveExtraParams(params: {

112113

delete merged.textVerbosity;

113114

}

114115116+

const resolvedResponseFormat = resolveAliasedParamValue(

117+

[defaultParams, globalParams, agentParams],

118+

"response_format",

119+

"responseFormat",

120+

);

121+

if (resolvedResponseFormat !== undefined) {

122+

merged.response_format = resolvedResponseFormat;

123+

delete merged.responseFormat;

124+

}

125+115126

const resolvedCachedContent = resolveAliasedParamValue(

116127

[defaultParams, globalParams, agentParams],

117128

"cached_content",

@@ -194,7 +205,8 @@ function resolvePreparedExtraParamsCacheKey(params: {

194205

workspaceDir: params.workspaceDir ?? "",

195206

thinkingLevel: params.thinkingLevel ?? "",

196207

resolvedTransport: params.resolvedTransport ?? "",

197-

extraParamsOverride: params.extraParamsOverride ?? null,

208+

extraParamsOverride:

209+

stripRequestScopedExtraParams(sanitizeExtraParamsRecord(params.extraParamsOverride)) ?? null,

198210

resolvedExtraParams: params.resolvedExtraParams ?? null,

199211

model: fingerprintPreparedExtraParamsModel(params.model),

200212

});

@@ -224,9 +236,11 @@ export function resolvePreparedExtraParams(params: {

224236

});

225237

const override =

226238

params.extraParamsOverride && Object.keys(params.extraParamsOverride).length > 0

227-

? sanitizeExtraParamsRecord(

228-

Object.fromEntries(

229-

Object.entries(params.extraParamsOverride).filter(([, value]) => value !== undefined),

239+

? stripRequestScopedExtraParams(

240+

sanitizeExtraParamsRecord(

241+

Object.fromEntries(

242+

Object.entries(params.extraParamsOverride).filter(([, value]) => value !== undefined),

243+

),

230244

),

231245

)

232246

: undefined;

@@ -312,6 +326,24 @@ function sanitizeExtraParamsRecord(

312326

);

313327

}

314328329+

function stripRequestScopedExtraParams(

330+

value: Record<string, unknown> | undefined,

331+

): Record<string, unknown> | undefined {

332+

if (!value) {

333+

return undefined;

334+

}

335+

const filtered = Object.fromEntries(

336+

Object.entries(value).filter(([key]) => !REQUEST_SCOPED_EXTRA_PARAM_KEYS.has(key)),

337+

);

338+

return Object.keys(filtered).length > 0 ? filtered : undefined;

339+

}

340+341+

function hasRequestScopedExtraParams(value: Record<string, unknown> | undefined): boolean {

342+

if (!value) {

343+

return false;

344+

}

345+

return [...REQUEST_SCOPED_EXTRA_PARAM_KEYS].some((key) => Object.hasOwn(value, key));

346+

}

315347

function shouldApplyDefaultOpenAIGptRuntimeParams(params: {

316348

provider: string;

317349

modelId: string;

@@ -674,9 +706,14 @@ type ApplyExtraParamsContext = {

674706

};

675707676708

function applyPrePluginStreamWrappers(ctx: ApplyExtraParamsContext): void {

709+

const baseExtraParams =

710+

ctx.override && hasRequestScopedExtraParams(ctx.override)

711+

? stripRequestScopedExtraParams(ctx.effectiveExtraParams)

712+

: ctx.effectiveExtraParams;

713+

const streamParams = ctx.override ? { ...baseExtraParams, ...ctx.override } : baseExtraParams;

677714

const wrappedStreamFn = createStreamFnWithExtraParams(

678715

ctx.agent.streamFn,

679-

ctx.effectiveExtraParams,

716+

streamParams,

680717

ctx.provider,

681718

ctx.model,

682719

);

@@ -822,8 +859,10 @@ export function applyExtraParamsToAgent(

822859

});

823860

const override =

824861

extraParamsOverride && Object.keys(extraParamsOverride).length > 0

825-

? Object.fromEntries(

826-

Object.entries(extraParamsOverride).filter(([, value]) => value !== undefined),

862+

? sanitizeExtraParamsRecord(

863+

Object.fromEntries(

864+

Object.entries(extraParamsOverride).filter(([, value]) => value !== undefined),

865+

),

827866

)

828867

: undefined;

829868

const effectiveExtraParams =