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

推荐订阅源

Google DeepMind News
Google DeepMind News
C
Check Point Blog
J
Java Code Geeks
腾讯CDC
Martin Fowler
Martin Fowler
MongoDB | Blog
MongoDB | Blog
H
Hackread – Cybersecurity News, Data Breaches, AI and More
博客园 - 三生石上(FineUI控件)
Apple Machine Learning Research
Apple Machine Learning Research
大猫的无限游戏
大猫的无限游戏
Engineering at Meta
Engineering at Meta
罗磊的独立博客
Last Week in AI
Last Week in AI
B
Blog
IT之家
IT之家
S
SegmentFault 最新的问题
D
DataBreaches.Net
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
GbyAI
GbyAI
博客园 - 聂微东
U
Unit 42
有赞技术团队
有赞技术团队
Y
Y Combinator Blog
MyScale Blog
MyScale 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(ollama): preserve configured native thinking · opencl...
steipete · 2026-04-28 · via Recent Commits to openclaw:main
Original file line numberDiff line numberDiff line change

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

3030

- Gateway/media: route text-only `chat.send` image offloads through media-understanding fields so `agents.defaults.imageModel` can describe WebChat attachments instead of leaving only an opaque `media://inbound` marker. Fixes #72968. Thanks @vorajeeah.

3131

- Gateway/Windows: route no-listener restart handoffs through the Windows supervisor without leaving restart tokens in flight, so failed task scheduling can be retried and successful handoffs do not coalesce later restart requests. (#69056) Thanks @Thatgfsj.

3232

- Gateway/model pricing: skip plugin manifest discovery during background pricing refreshes when `plugins.enabled: false`, so disabled-plugin setups do not keep rebuilding plugin metadata from the Gateway hot path. Fixes #73291. Thanks @slideshow-dingo and @fishgills.

33-

- Ollama/thinking: validate `/think` commands against live Ollama catalog reasoning metadata, so models whose `/api/show` capabilities include `thinking` expose `low`, `medium`, `high`, and `max` instead of being stuck on `off`. Fixes #73366. Thanks @cymise.

33+

- Ollama/thinking: validate `/think` commands against live Ollama catalog reasoning metadata and preserve explicit native `params.think`/`params.thinking`, so models whose `/api/show` capabilities include `thinking` expose `low`, `medium`, `high`, and `max` instead of being stuck on `off`. Fixes #73366. Thanks @cymise.

3434

- Gateway/sessions: remove automatic oversized `sessions.json` rotation backups, deprecate `session.maintenance.rotateBytes`, and teach `openclaw doctor --fix` to remove the ignored key so hot session writes no longer copy multi-MB stores. Refs #72338. Thanks @midhunmonachan and @DougButdorf.

3535

- Channels/Telegram: fail fast when Telegram rejects the startup `getMe` token probe with 401, so invalid or stale BotFather tokens are reported as token auth failures instead of misleading `deleteWebhook` cleanup failures. Fixes #47674. Thanks @samaedan-arch.

3636

- ACPX: keep generated Codex and Claude ACP wrapper startup paths working when remote or special state filesystems reject chmod, since OpenClaw invokes the wrappers through Node instead of executing them directly. Fixes #73333. Thanks @david-garcia-garcia.

Original file line numberDiff line numberDiff line change

@@ -859,7 +859,7 @@ For the full setup and behavior details, see [Ollama Web Search](/tools/ollama-s

859859

}

860860

```

861861
862-

Per-model `params.think` or `params.thinking` can disable or force Ollama API thinking for a specific configured model. Runtime commands such as `/think off` still apply to the active run.

862+

Per-model `params.think` or `params.thinking` can disable or force Ollama API thinking for a specific configured model. OpenClaw preserves those explicit model params when the active run only has the implicit default `off`; non-off runtime commands such as `/think medium` still override the active run.

863863
864864

</Accordion>

865865

@@ -934,7 +934,7 @@ For the full setup and behavior details, see [Ollama Web Search](/tools/ollama-s

934934

<Accordion title="Streaming configuration">

935935

OpenClaw's Ollama integration uses the **native Ollama API** (`/api/chat`) by default, which fully supports streaming and tool calling simultaneously. No special configuration is needed.

936936
937-

For native `/api/chat` requests, OpenClaw also forwards thinking control directly to Ollama: `/think off` and `openclaw agent --thinking off` send top-level `think: false`, while `/think low|medium|high` send the matching top-level `think` effort string. `/think max` maps to Ollama's highest native effort, `think: "high"`.

937+

For native `/api/chat` requests, OpenClaw also forwards thinking control directly to Ollama: `/think off` and `openclaw agent --thinking off` send top-level `think: false` unless an explicit model `params.think`/`params.thinking` value is configured, while `/think low|medium|high` send the matching top-level `think` effort string. `/think max` maps to Ollama's highest native effort, `think: "high"`.

938938
939939

<Tip>

940940

If you need to use the OpenAI-compatible endpoint, see the "Legacy OpenAI-compatible mode" section above. Streaming and tool calling may not work simultaneously in that mode.

Original file line numberDiff line numberDiff line change

@@ -212,6 +212,55 @@ describe("createConfiguredOllamaCompatStreamWrapper", () => {

212212

);

213213

});

214214
215+

it("does not overwrite configured native Ollama params.thinking with implicit off", async () => {

216+

await withMockNdjsonFetch(

217+

[

218+

'{"model":"m","created_at":"t","message":{"role":"assistant","content":"ok"},"done":false}',

219+

'{"model":"m","created_at":"t","message":{"role":"assistant","content":""},"done":true,"prompt_eval_count":1,"eval_count":1}',

220+

],

221+

async (fetchMock) => {

222+

const baseStreamFn = createOllamaStreamFn("http://ollama-host:11434");

223+

const model = {

224+

api: "ollama",

225+

provider: "ollama",

226+

id: "qwen3:32b",

227+

contextWindow: 131072,

228+

params: { thinking: "medium" },

229+

};

230+
231+

const wrapped = createConfiguredOllamaCompatStreamWrapper({

232+

provider: "ollama",

233+

modelId: "qwen3:32b",

234+

model,

235+

streamFn: baseStreamFn,

236+

thinkingLevel: "off",

237+

} as never);

238+

if (!wrapped) {

239+

throw new Error("Expected wrapped Ollama stream function");

240+

}

241+
242+

const stream = await Promise.resolve(

243+

wrapped(

244+

model as never,

245+

{

246+

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

247+

} as never,

248+

{} as never,

249+

),

250+

);

251+
252+

await collectStreamEvents(stream);

253+
254+

const requestInit = getGuardedFetchCall(fetchMock).init ?? {};

255+

if (typeof requestInit.body !== "string") {

256+

throw new Error("Expected string request body");

257+

}

258+

const requestBody = JSON.parse(requestInit.body) as { think?: string };

259+

expect(requestBody.think).toBe("medium");

260+

},

261+

);

262+

});

263+
215264

it("forwards the native think effort on native Ollama chat requests when thinking is enabled", async () => {

216265

await withMockNdjsonFetch(

217266

[

Original file line numberDiff line numberDiff line change

@@ -314,9 +314,16 @@ export function createConfiguredOllamaCompatStreamWrapper(

314314

streamFn = wrapOllamaCompatNumCtx(streamFn, resolveOllamaNumCtx(model));

315315

}

316316
317-

const ollamaThinkValue = isNativeOllamaTransport

317+

const configuredThinkValue = model ? resolveOllamaThinkParamValue(model.params) : undefined;

318+

const runtimeThinkValue = isNativeOllamaTransport

318319

? resolveOllamaThinkValue(ctx.thinkingLevel)

319320

: undefined;

321+

// "off" is also the implicit agent default. Preserve explicit native Ollama

322+

// model config unless the active run requests a non-off thinking level.

323+

const ollamaThinkValue =

324+

runtimeThinkValue === false && configuredThinkValue !== undefined

325+

? undefined

326+

: runtimeThinkValue;

320327

if (ollamaThinkValue !== undefined) {

321328

streamFn = createOllamaThinkingWrapper(streamFn, ollamaThinkValue);

322329

}