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

推荐订阅源

爱范儿
爱范儿
T
The Blog of Author Tim Ferriss
G
Google Developers Blog
博客园_首页
博客园 - 【当耐特】
量子位
S
SegmentFault 最新的问题
B
Blog RSS Feed
酷 壳 – CoolShell
酷 壳 – CoolShell
V
Visual Studio Blog
T
Tailwind CSS Blog
阮一峰的网络日志
阮一峰的网络日志
V
V2EX
Y
Y Combinator Blog
博客园 - 聂微东
The Cloudflare Blog
小众软件
小众软件
J
Java Code Geeks
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
月光博客
月光博客
H
Help Net Security
Jina AI
Jina 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
fix(ollama): expose native thinking efforts · openclaw/op...
steipete · 2026-04-27 · via Recent Commits to openclaw:main

@@ -150,7 +150,7 @@ describe("createConfiguredOllamaCompatStreamWrapper", () => {

150150

);

151151

});

152152153-

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

153+

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

154154

await withMockNdjsonFetch(

155155

[

156156

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

@@ -193,10 +193,63 @@ describe("createConfiguredOllamaCompatStreamWrapper", () => {

193193

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

194194

}

195195

const requestBody = JSON.parse(requestInit.body) as {

196-

think?: boolean;

197-

options?: { think?: boolean; num_ctx?: number };

196+

think?: boolean | string;

197+

options?: { think?: boolean | string; num_ctx?: number };

198+

};

199+

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

200+

expect(requestBody.options?.think).toBeUndefined();

201+

expect(requestBody.options?.num_ctx).toBe(131072);

202+

},

203+

);

204+

});

205+206+

it("maps native Ollama max thinking to think=high on the wire", async () => {

207+

await withMockNdjsonFetch(

208+

[

209+

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

210+

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

211+

],

212+

async (fetchMock) => {

213+

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

214+

const model = {

215+

api: "ollama",

216+

provider: "ollama",

217+

id: "gpt-oss:20b",

218+

contextWindow: 131072,

219+

};

220+221+

const wrapped = createConfiguredOllamaCompatStreamWrapper({

222+

provider: "ollama",

223+

modelId: "gpt-oss:20b",

224+

model,

225+

streamFn: baseStreamFn,

226+

thinkingLevel: "max",

227+

} as never);

228+

if (!wrapped) {

229+

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

230+

}

231+232+

const stream = await Promise.resolve(

233+

wrapped(

234+

model as never,

235+

{

236+

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

237+

} as never,

238+

{} as never,

239+

),

240+

);

241+242+

await collectStreamEvents(stream);

243+244+

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

245+

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

246+

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

247+

}

248+

const requestBody = JSON.parse(requestInit.body) as {

249+

think?: boolean | string;

250+

options?: { think?: boolean | string; num_ctx?: number };

198251

};

199-

expect(requestBody.think).toBe(true);

252+

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

200253

expect(requestBody.options?.think).toBeUndefined();

201254

expect(requestBody.options?.num_ctx).toBe(131072);

202255

},