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

推荐订阅源

Blog — PlanetScale
Blog — PlanetScale
C
Cybersecurity and Infrastructure Security Agency CISA
K
Kaspersky official blog
L
LangChain Blog
I
Intezer
N
News and Events Feed by Topic
C
Check Point Blog
MyScale Blog
MyScale Blog
I
InfoQ
Last Week in AI
Last Week in AI
腾讯CDC
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
L
LINUX DO - 热门话题
T
Threatpost
Y
Y Combinator Blog
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
H
Help Net Security
The GitHub Blog
The GitHub Blog
V
Vulnerabilities – Threatpost
NISL@THU
NISL@THU
云风的 BLOG
云风的 BLOG
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
A
About on SuperTechFans
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
Martin Fowler
Martin Fowler
P
Privacy International News Feed
AWS News Blog
AWS News Blog
Simon Willison's Weblog
Simon Willison's Weblog
S
Securelist
T
Tor Project blog
C
CERT Recently Published Vulnerability Notes
Scott Helme
Scott Helme
A
Arctic Wolf
有赞技术团队
有赞技术团队
博客园 - 三生石上(FineUI控件)
T
Tenable Blog
The Hacker News
The Hacker News
博客园_首页
Cisco Talos Blog
Cisco Talos Blog
Spread Privacy
Spread Privacy
Microsoft Security Blog
Microsoft Security Blog
N
News and Events Feed by Topic
K
KPMG report finds enterprise disconnect between AI and its ROI | CIO
V
V2EX
G
Google Developers Blog
Webroot Blog
Webroot Blog
www.infosecurity-magazine.com
www.infosecurity-magazine.com
WordPress大学
WordPress大学
P
Palo Alto Networks Blog
T
Threat Research - Cisco Blogs

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 test: trim doctor command hotspots · openclaw/openclaw@c66f16a test: isolate agent auth and spawn hotspots · openclaw/openclaw@9285935 test: stabilize MCP startup disposal race · openclaw/openclaw@dd9d2eb test: merge browser contract server suites · openclaw/openclaw@5817a76 test: narrow ollama provider discovery setup · openclaw/openclaw@a0d9598 build: declare qa-lab aimock runtime dependency · openclaw/openclaw@24431e5 test: speed up safe-bins exec harness · openclaw/openclaw@ee856ab test: preserve tool helpers in embedded runner mocks · openclaw/openclaw@acd86a0 refactor: move memory embeddings into provider plugins · openclaw/openclaw@77e6e4c test: reuse system-run temp fixtures · openclaw/openclaw@7e9ff0f test: trim hotspot wait overhead · openclaw/openclaw@12a59b0 Check: avoid duplicate boundary prep · openclaw/openclaw@baf11b8 test: reduce hotspot fixture overhead · openclaw/openclaw@3a59edd feat(ui): overhaul settings and slash command UX (#67819) thanks @Bun… · openclaw/openclaw@2cfb660 QA Matrix: exit cleanly on failure · openclaw/openclaw@42805d2 QA Matrix: isolate scenario coverage · openclaw/openclaw@7e659e1 Matrix: refresh crypto bootstrap state · openclaw/openclaw@94081d8 QA Lab: add provider registry · openclaw/openclaw@bb7e982 Matrix: add plugin changelog · openclaw/openclaw@4acab55 test: trim more hotspot overhead · openclaw/openclaw@f485311 test: trim remaining hotspot tests · openclaw/openclaw@6ba8626 test: narrow hotspot mocks · openclaw/openclaw@dbc8179 test: isolate gemini embedding request helpers · openclaw/openclaw@cd330f5 test: trim memory and mcp hotspots · openclaw/openclaw@fd48dfa test: slim provider registry mocks · openclaw/openclaw@2e08c77 test: harden Parallels update smoke · openclaw/openclaw@1a98090 feat: default Anthropic to Opus 4.7 · openclaw/openclaw@628b454 fix: harden node-host shell payload mutability checks · openclaw/openclaw@75c551e fix: land node-host approval binding for native binaries (#66731) (th… · openclaw/openclaw@29919bb CI: add daily schedule to CodeQL workflow (#67645) · openclaw/openclaw@69d25f5 fix(gateway): capture config hash after plugin auto-enable to prevent… · openclaw/openclaw@8c11210 fix: repair sanitized replay tool results before send (#67620) (thank… · openclaw/openclaw@c3c7a99 fix: restrict HTML timeout short-circuit to transient statuses · openclaw/openclaw@de129a6 fix: keep TUI watchdog bound to active run (#67401) (thanks @xantorres) · openclaw/openclaw@3525273 Gateway/skills: dedupe skills prefix-match + drop dead fallback on log · openclaw/openclaw@d7f489f Extensions/lmstudio: back off inference preload after consecutive fai… · openclaw/openclaw@b555214 TUI/streaming: add watchdog that resets the activity indicator after … · openclaw/openclaw@f44ab20 Agents/tool-loop: enable unknown-tool stream guard by default · openclaw/openclaw@36ed367 Gateway/skills: invalidate session skills snapshot on config write · openclaw/openclaw@b23d59a fix: classify HTML provider error pages correctly (#67642) (thanks @s… · openclaw/openclaw@e588e90 fix(skills): remove unused model-usage import (#67641) · openclaw/openclaw@55f05df docs(changelog): credit codex fix superseded PRs · openclaw/openclaw@e485f24 fix(openai-codex): normalize stale transport metadata in resolution a… · openclaw/openclaw@90801ba CI: pin Docker-related GitHub Actions (#67632) · openclaw/openclaw@f697b01 Android: modernize WebView and discovery API usage (#67627) · openclaw/openclaw@44a6e50 fix(deps): bump hono to 4.12.14 and @hono/node-server to 1.19.14 (GHS… · openclaw/openclaw@fbccc18 fix(deps): bump dompurify to 3.4.0 (#67614) · openclaw/openclaw@2c2dc00 CI: add explicit permissions to all workflow jobs (fixes code-scannin… · openclaw/openclaw@01b7516 fix: register bundled TTS providers and route overrides correctly (#6… · openclaw/openclaw@6ea3cdd fix: align host tilde paths with OS home (#62804) (thanks @stainlu) · openclaw/openclaw@ecfaf64 fix: flush creds queue before reconnect socket open (#67464) (thanks … · openclaw/openclaw@405c63f fix: strip standalone <function> tool call tags from visible text (#6… · openclaw/openclaw@78df859 fix(agents): preserve cli session metadata before transcript persist … · openclaw/openclaw@898fd04 docs(changelog): move cli transcript entry · openclaw/openclaw@c1817c6 fix(agents): normalize cli transcript api field · openclaw/openclaw@3a3fae0 docs(changelog): note cli transcript persistence · openclaw/openclaw@6c343f1 fix(agents): persist cli transcript turns · openclaw/openclaw@b8ef507 fix(msteams): harden security-sensitive flows (#65841) · openclaw/openclaw@c56b56e [Dashboard] Fix exec approval modal overflow for long command content… · openclaw/openclaw@053c5b0 Docs: remove QA changelog entry · openclaw/openclaw@7fd5771 QA: fix private runtime source loading (#67428) · openclaw/openclaw@d5933af docs(gateway): correct protocol.md schema path, hello-ok example, aut… · openclaw/openclaw@489404d CI: pin Node 22 runners to 22.18.0 · openclaw/openclaw@4ffa621 models.authStatus: normalize provider ids + tighten env-backed escape… · openclaw/openclaw@f2fdb9d Update CHANGELOG.md · openclaw/openclaw@7694a92 test(parallels): clean up npm update guard jobs · openclaw/openclaw@045ea7b Plugins: prefer scanDir override paths · openclaw/openclaw@b2974da fix(dreaming): default storage.mode to "separate" so phase blocks sto… · openclaw/openclaw@8c392f0 fix(memory-core): skip dreaming transcript ingestion via session stor… · openclaw/openclaw@a1b01f0 fix: dedupe replayed exec.finished node events (#67281) · openclaw/openclaw@5dcf526
fix: map google adaptive thinking dynamically · openclaw/openclaw@cc0f306
steipete · 2026-04-25 · via Recent Commits to openclaw:main
Original file line numberDiff line numberDiff line change

@@ -82,6 +82,7 @@ Docs: https://docs.openclaw.ai

8282

- Agents/sessions: persist the runtime-resolved context budget from embedded agent runs, so Codex GPT-5.5 sessions keep the catalog/runtime context cap instead of falling back to the generic 200k status value. Fixes #71294. Thanks @tud0r.

8383

- Agents/tools: fail runs before model submission when explicit tool allowlists resolve to no callable tools, preventing text-only hallucinated tool results for missing tools such as plugin commands that were not registered. Fixes #71292. Thanks @steipete.

8484

- Agents/embedded: skip provider submission when an embedded run has no prompt, replay history, or prompt-local images, preventing empty OpenAI Responses requests from surfacing provider errors into user channels. Fixes #71130. Thanks @steipete.

85+

- Providers/Google: map `/think adaptive` to Gemini dynamic thinking instead of a fixed medium/high budget, using Gemini 3's provider default and Gemini 2.5's `thinkingBudget: -1`. Fixes #71316. Thanks @steipete.

8586

- Providers/MiniMax: keep M2.7 chat model metadata text-only so image tool requests route through `MiniMax-VL-01` instead of the Anthropic-compatible chat endpoint. Fixes #71296. Thanks @ilker-cevikkaya.

8687

- Discord/replies: run `message_sending` plugin hooks for Discord reply delivery, including DM targets, so plugins can transform or cancel outbound Discord replies consistently with other channels. Fixes #59350. (#71094) Thanks @wei840222.

8788

- Control UI/commands: carry provider-owned thinking option ids/labels in session rows and defaults so fresh sessions show and accept dynamic modes such as `adaptive`, `xhigh`, and `max`. Fixes #71269. Thanks @Young-Khalil.

Original file line numberDiff line numberDiff line change

@@ -14,7 +14,7 @@ title: "Thinking levels"

1414

- medium → “think harder”

1515

- high → “ultrathink” (max budget)

1616

- xhigh → “ultrathink+” (GPT-5.2+ and Codex models, plus Anthropic Claude Opus 4.7 effort)

17-

- adaptive → provider-managed adaptive thinking (supported for Claude 4.6 on Anthropic/Bedrock and Anthropic Claude Opus 4.7)

17+

- adaptive → provider-managed adaptive thinking (supported for Claude 4.6 on Anthropic/Bedrock, Anthropic Claude Opus 4.7, and Google Gemini dynamic thinking)

1818

- max → provider max reasoning (currently Anthropic Claude Opus 4.7)

1919

- `x-high`, `x_high`, `extra-high`, `extra high`, and `extra_high` map to `xhigh`.

2020

- `highest` maps to `high`.

@@ -27,6 +27,7 @@ title: "Thinking levels"

2727

- Anthropic Claude Opus 4.7 maps `/think xhigh` to adaptive thinking plus `output_config.effort: "xhigh"`, because `/think` is a thinking directive and `xhigh` is the Opus 4.7 effort setting.

2828

- Anthropic Claude Opus 4.7 also exposes `/think max`; it maps to the same provider-owned max effort path.

2929

- OpenAI GPT models map `/think` through model-specific Responses API effort support. `/think off` sends `reasoning.effort: "none"` only when the target model supports it; otherwise OpenClaw omits the disabled reasoning payload instead of sending an unsupported value.

30+

- Google Gemini maps `/think adaptive` to Gemini's provider-owned dynamic thinking. Gemini 3 requests omit a fixed `thinkingLevel`, while Gemini 2.5 requests send `thinkingBudget: -1`; fixed levels still map to the closest Gemini `thinkingLevel` or budget for that model family.

3031

- MiniMax (`minimax/*`) on the Anthropic-compatible streaming path defaults to `thinking: { type: "disabled" }` unless you explicitly set thinking in model params or request params. This avoids leaked `reasoning_content` deltas from MiniMax's non-native Anthropic stream format.

3132

- Z.AI (`zai/*`) only supports binary thinking (`on`/`off`). Any non-`off` level is treated as `on` (mapped to `low`).

3233

- Moonshot (`moonshot/*`) maps `/think off` to `thinking: { type: "disabled" }` and any non-`off` level to `thinking: { type: "enabled" }`. When thinking is enabled, Moonshot only accepts `tool_choice` `auto|none`; OpenClaw normalizes incompatible values to `auto`.

Original file line numberDiff line numberDiff line change

@@ -180,6 +180,40 @@ describe("google provider plugin hooks", () => {

180180

runCase(cliProvider, "google-gemini-cli");

181181

});

182182
183+

it("advertises adaptive thinking for Gemini dynamic thinking", async () => {

184+

const { providers } = await registerProviderPlugin({

185+

plugin: googleProviderPlugin,

186+

id: "google",

187+

name: "Google Provider",

188+

});

189+

const provider = requireRegisteredProvider(providers, "google");

190+

expect(provider.resolveThinkingProfile).toBeDefined();

191+

const resolveThinkingProfile = provider.resolveThinkingProfile!;

192+

const gemini3Profile = resolveThinkingProfile({

193+

provider: "google",

194+

modelId: "gemini-3.1-pro-preview",

195+

} as never);

196+

const gemini25Profile = resolveThinkingProfile({

197+

provider: "google",

198+

modelId: "gemini-2.5-flash",

199+

} as never);

200+
201+

expect(gemini3Profile?.levels).toEqual([

202+

{ id: "off" },

203+

{ id: "low" },

204+

{ id: "adaptive" },

205+

{ id: "high" },

206+

]);

207+

expect(gemini25Profile?.levels).toEqual([

208+

{ id: "off" },

209+

{ id: "minimal" },

210+

{ id: "low" },

211+

{ id: "medium" },

212+

{ id: "adaptive" },

213+

{ id: "high" },

214+

]);

215+

});

216+
183217

it("shares Gemini replay and stream hooks across Google provider variants", async () => {

184218

const { providers } = await registerProviderPlugin({

185219

plugin: googleProviderPlugin,

Original file line numberDiff line numberDiff line change

@@ -12,8 +12,15 @@ export const GOOGLE_GEMINI_PROVIDER_HOOKS = {

1212

resolveThinkingProfile: ({ modelId }: ProviderDefaultThinkingPolicyContext) =>

1313

({

1414

levels: isGoogleGemini3ProModel(modelId)

15-

? [{ id: "off" }, { id: "low" }, { id: "high" }]

16-

: [{ id: "off" }, { id: "minimal" }, { id: "low" }, { id: "medium" }, { id: "high" }],

15+

? [{ id: "off" }, { id: "low" }, { id: "adaptive" }, { id: "high" }]

16+

: [

17+

{ id: "off" },

18+

{ id: "minimal" },

19+

{ id: "low" },

20+

{ id: "medium" },

21+

{ id: "adaptive" },

22+

{ id: "high" },

23+

],

1724

}) satisfies ProviderThinkingProfile,

1825

wrapStreamFn: createGoogleThinkingStreamWrapper,

1926

};

Original file line numberDiff line numberDiff line change

@@ -1,6 +1,7 @@

11

export {

22

createGoogleThinkingPayloadWrapper,

33

createGoogleThinkingStreamWrapper,

4+

isGoogleGemini25ThinkingBudgetModel,

45

isGoogleGemini3FlashModel,

56

isGoogleGemini3ProModel,

67

isGoogleGemini3ThinkingLevelModel,

Original file line numberDiff line numberDiff line change

@@ -10,7 +10,7 @@ describe("google thinking policy", () => {

1010

["minimal", "LOW"],

1111

["low", "LOW"],

1212

["medium", "HIGH"],

13-

["adaptive", "HIGH"],

13+

["adaptive", undefined],

1414

["high", "HIGH"],

1515

["xhigh", "HIGH"],

1616

] as const)("maps Gemini 3 Pro thinking level %s to %s", (thinkingLevel, expected) => {

@@ -40,7 +40,7 @@ describe("google thinking policy", () => {

4040

["minimal", "MINIMAL"],

4141

["low", "LOW"],

4242

["medium", "MEDIUM"],

43-

["adaptive", "MEDIUM"],

43+

["adaptive", undefined],

4444

["high", "HIGH"],

4545

["xhigh", "HIGH"],

4646

] as const)("maps Gemini 3 Flash thinking level %s to %s", (thinkingLevel, expected) => {

@@ -53,7 +53,7 @@ describe("google thinking policy", () => {

5353

});

5454
5555

it.each([

56-

[-1, "MINIMAL"],

56+

[-1, undefined],

5757

[0, "MINIMAL"],

5858

[2048, "LOW"],

5959

[8192, "MEDIUM"],

@@ -98,6 +98,43 @@ describe("google thinking policy", () => {

9898

});

9999

});

100100
101+

it("keeps Gemini 3 adaptive thinking provider-dynamic instead of forcing a fixed level", () => {

102+

const payload = {

103+

generationConfig: {

104+

thinkingConfig: { thinkingBudget: 8192, includeThoughts: true },

105+

},

106+

};

107+
108+

sanitizeGoogleThinkingPayload({

109+

payload,

110+

modelId: "gemini-3-flash-preview",

111+

thinkingLevel: "adaptive",

112+

});

113+
114+

expect(payload.generationConfig.thinkingConfig).toEqual({

115+

includeThoughts: true,

116+

});

117+

});

118+
119+

it("maps Gemini 2.5 adaptive thinking to dynamic thinkingBudget", () => {

120+

const payload = {

121+

config: {

122+

thinkingConfig: { thinkingBudget: 8192, includeThoughts: true },

123+

},

124+

};

125+
126+

sanitizeGoogleThinkingPayload({

127+

payload,

128+

modelId: "gemini-2.5-flash",

129+

thinkingLevel: "adaptive",

130+

});

131+
132+

expect(payload.config.thinkingConfig).toEqual({

133+

includeThoughts: true,

134+

thinkingBudget: -1,

135+

});

136+

});

137+
101138

it("maps Gemma 4 thinking mode without sending thinkingBudget", () => {

102139

const payload = {

103140

config: {

Original file line numberDiff line numberDiff line change

@@ -1,6 +1,7 @@

11

export {

22

createGoogleThinkingPayloadWrapper,

33

createGoogleThinkingStreamWrapper,

4+

isGoogleGemini25ThinkingBudgetModel,

45

isGoogleGemini3FlashModel,

56

isGoogleGemini3ProModel,

67

isGoogleGemini3ThinkingLevelModel,

Original file line numberDiff line numberDiff line change

@@ -444,6 +444,44 @@ describe("google transport stream", () => {

444444

});

445445

});

446446
447+

it("keeps adaptive Gemini 3 thinking on provider dynamic defaults", () => {

448+

const params = buildGoogleGenerativeAiParams(

449+

buildGeminiModel({ id: "gemini-3-flash-preview" }),

450+

{

451+

messages: [{ role: "user", content: "hello", timestamp: 0 }],

452+

} as never,

453+

{

454+

reasoning: "adaptive",

455+

} as never,

456+

);

457+
458+

expect(params.generationConfig).toMatchObject({

459+

thinkingConfig: { includeThoughts: true },

460+

});

461+

expect(params.generationConfig).not.toMatchObject({

462+

thinkingConfig: { thinkingLevel: expect.any(String) },

463+

});

464+

expect(params.generationConfig).not.toMatchObject({

465+

thinkingConfig: { thinkingBudget: expect.any(Number) },

466+

});

467+

});

468+
469+

it("maps adaptive Gemini 2.5 thinking to dynamic thinkingBudget", () => {

470+

const params = buildGoogleGenerativeAiParams(

471+

buildGeminiModel({ id: "gemini-2.5-flash" }),

472+

{

473+

messages: [{ role: "user", content: "hello", timestamp: 0 }],

474+

} as never,

475+

{

476+

reasoning: "adaptive",

477+

} as never,

478+

);

479+
480+

expect(params.generationConfig).toMatchObject({

481+

thinkingConfig: { includeThoughts: true, thinkingBudget: -1 },

482+

});

483+

});

484+
447485

it("normalizes explicit Gemini 3 Pro thinking levels", () => {

448486

const params = buildGoogleGenerativeAiParams(

449487

buildGeminiModel({ id: "gemini-3.1-pro-preview" }),

Original file line numberDiff line numberDiff line change

@@ -25,6 +25,7 @@ import { normalizeLowercaseStringOrEmpty } from "openclaw/plugin-sdk/text-runtim

2525

import { parseGeminiAuth } from "./gemini-auth.js";

2626

import { normalizeGoogleApiBaseUrl } from "./provider-policy.js";

2727

import {

28+

isGoogleGemini25ThinkingBudgetModel,

2829

isGoogleGemini3FlashModel,

2930

isGoogleGemini3ProModel,

3031

resolveGoogleGemini3ThinkingLevel,

@@ -238,6 +239,10 @@ function getGoogleThinkingBudget(

238239

return undefined;

239240

}

240241
242+

function isAdaptiveReasoningLevel(value: unknown): value is "adaptive" {

243+

return value === "adaptive";

244+

}

245+
241246

function resolveGoogleThinkingConfig(

242247

model: GoogleTransportModel,

243248

options: GoogleTransportOptions | undefined,

@@ -268,6 +273,17 @@ function resolveGoogleThinkingConfig(

268273

if (!options?.reasoning) {

269274

return getDisabledThinkingConfig(model.id);

270275

}

276+

if (isAdaptiveReasoningLevel(options.reasoning)) {

277+

if (isGoogleGemini3ProModel(model.id) || isGoogleGemini3FlashModel(model.id)) {

278+

return { includeThoughts: true };

279+

}

280+

if (isGoogleGemini25ThinkingBudgetModel(model.id)) {

281+

return normalizeGoogleThinkingConfig(model.id, {

282+

includeThoughts: true,

283+

thinkingBudget: -1,

284+

});

285+

}

286+

}

271287

if (isGoogleGemini3ProModel(model.id) || isGoogleGemini3FlashModel(model.id)) {

272288

return {

273289

includeThoughts: true,

Original file line numberDiff line numberDiff line change

@@ -97,7 +97,7 @@ describe("sanitizeGoogleThinkingPayload — gemini-2.5-pro zero budget", () => {

9797

});

9898

});

9999
100-

it("fills thinkingLevel for Gemini 3 Flash negative budgets", () => {

100+

it("rewrites Gemini 3 Flash negative budgets when a fixed thinking level is explicit", () => {

101101

const payload = {

102102

config: {

103103

thinkingConfig: { thinkingBudget: -1, includeThoughts: true },

@@ -113,4 +113,37 @@ describe("sanitizeGoogleThinkingPayload — gemini-2.5-pro zero budget", () => {

113113

thinkingLevel: "MEDIUM",

114114

});

115115

});

116+
117+

it("keeps Gemini 3 adaptive thinking on provider dynamic defaults", () => {

118+

const payload = {

119+

config: {

120+

thinkingConfig: { thinkingBudget: 8192, includeThoughts: true },

121+

},

122+

};

123+

sanitizeGoogleThinkingPayload({

124+

payload,

125+

modelId: "gemini-3-flash-preview",

126+

thinkingLevel: "adaptive",

127+

});

128+

expect(payload.config.thinkingConfig).toEqual({

129+

includeThoughts: true,

130+

});

131+

});

132+
133+

it("maps Gemini 2.5 adaptive thinking to thinkingBudget=-1", () => {

134+

const payload = {

135+

config: {

136+

thinkingConfig: { thinkingBudget: 8192, includeThoughts: true },

137+

},

138+

};

139+

sanitizeGoogleThinkingPayload({

140+

payload,

141+

modelId: "gemini-2.5-flash",

142+

thinkingLevel: "adaptive",

143+

});

144+

expect(payload.config.thinkingConfig).toEqual({

145+

includeThoughts: true,

146+

thinkingBudget: -1,

147+

});

148+

});

116149

});