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

推荐订阅源

V
V2EX
P
Proofpoint News Feed
D
DataBreaches.Net
C
Check Point Blog
L
LangChain Blog
量子位
美团技术团队
Vercel News
Vercel News
人人都是产品经理
人人都是产品经理
N
Netflix TechBlog - Medium
V
Visual Studio Blog
Microsoft Security Blog
Microsoft Security Blog
博客园 - 【当耐特】
MongoDB | Blog
MongoDB | Blog
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
Last Week in AI
Last Week in AI
The GitHub Blog
The GitHub Blog
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
U
Unit 42
腾讯CDC
M
MIT News - Artificial intelligence
Microsoft Azure Blog
Microsoft Azure Blog
Blog — PlanetScale
Blog — PlanetScale

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: omit Ollama think for non-reasoning models · opencla...
leno23 · 2026-05-16 · via Recent Commits to openclaw:main

@@ -292,6 +292,113 @@ describe("createConfiguredOllamaCompatStreamWrapper", () => {

292292

);

293293

});

294294295+

it("does not forward truthy configured native Ollama thinking for non-reasoning models", async () => {

296+

await withMockNdjsonFetch(

297+

[

298+

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

299+

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

300+

],

301+

async (fetchMock) => {

302+

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

303+

const model = {

304+

api: "ollama",

305+

provider: "ollama",

306+

id: "llama3.2:latest",

307+

contextWindow: 8192,

308+

reasoning: false,

309+

params: { thinking: "medium" },

310+

};

311+312+

const wrapped = createConfiguredOllamaCompatStreamWrapper({

313+

provider: "ollama",

314+

modelId: "llama3.2:latest",

315+

model,

316+

streamFn: baseStreamFn,

317+

thinkingLevel: "off",

318+

} as never);

319+

if (!wrapped) {

320+

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

321+

}

322+323+

const stream = await Promise.resolve(

324+

wrapped(

325+

model as never,

326+

{

327+

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

328+

} as never,

329+

{} as never,

330+

),

331+

);

332+333+

await collectStreamEvents(stream);

334+335+

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

336+

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

337+

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

338+

}

339+

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

340+

think?: string;

341+

options?: { think?: string };

342+

};

343+

expect(requestBody.think).toBeUndefined();

344+

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

345+

},

346+

);

347+

});

348+349+

it("does not forward runtime native Ollama thinking for non-reasoning models", async () => {

350+

await withMockNdjsonFetch(

351+

[

352+

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

353+

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

354+

],

355+

async (fetchMock) => {

356+

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

357+

const model = {

358+

api: "ollama",

359+

provider: "ollama",

360+

id: "llama3.2:latest",

361+

contextWindow: 8192,

362+

reasoning: false,

363+

};

364+365+

const wrapped = createConfiguredOllamaCompatStreamWrapper({

366+

provider: "ollama",

367+

modelId: "llama3.2:latest",

368+

model,

369+

streamFn: baseStreamFn,

370+

thinkingLevel: "low",

371+

} as never);

372+

if (!wrapped) {

373+

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

374+

}

375+376+

const stream = await Promise.resolve(

377+

wrapped(

378+

model as never,

379+

{

380+

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

381+

} as never,

382+

{} as never,

383+

),

384+

);

385+386+

await collectStreamEvents(stream);

387+388+

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

389+

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

390+

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

391+

}

392+

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

393+

think?: string;

394+

options?: { think?: string };

395+

};

396+

expect(requestBody.think).toBeUndefined();

397+

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

398+

},

399+

);

400+

});

401+295402

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

296403

await withMockNdjsonFetch(

297404

[