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

推荐订阅源

Google DeepMind News
Google DeepMind News
Microsoft Security Blog
Microsoft Security Blog
B
Blog
Martin Fowler
Martin Fowler
WordPress大学
WordPress大学
爱范儿
爱范儿
博客园_首页
博客园 - 聂微东
量子位
V
Visual Studio Blog
aimingoo的专栏
aimingoo的专栏
T
The Blog of Author Tim Ferriss
J
Java Code Geeks
小众软件
小众软件
大猫的无限游戏
大猫的无限游戏
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
N
Netflix TechBlog - Medium
F
Fortinet All Blogs
The Cloudflare Blog
T
Tailwind CSS Blog
G
Google Developers Blog
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
月光博客
月光博客
腾讯CDC

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(gateway): cache session list thinking enrichment · op...
steipete · 2026-05-04 · via Recent Commits to openclaw:main

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

11

import fs from "node:fs";

22

import os from "node:os";

33

import path from "node:path";

4-

import { afterEach, describe, expect, test } from "vitest";

4+

import { afterEach, describe, expect, test, vi } from "vitest";

55

import { resetConfigRuntimeState, setRuntimeConfigSnapshot } from "../config/config.js";

66

import type { OpenClawConfig } from "../config/config.js";

77

import type { SessionEntry } from "../config/sessions.js";

@@ -201,6 +201,93 @@ describe("gateway session utils", () => {

201201

expect(row.thinkingDefault).toBe("medium");

202202

});

203203204+

test("session list memoizes repeated thinking enrichment per provider model", async () => {

205+

const resolveThinkingProfile = vi.fn(() => ({

206+

levels: [{ id: "off" as const }, { id: "medium" as const }],

207+

defaultLevel: "medium" as const,

208+

}));

209+

const registry = createEmptyPluginRegistry();

210+

registry.providers.push({

211+

pluginId: "test",

212+

source: "test",

213+

provider: {

214+

id: "openai-codex",

215+

label: "OpenAI Codex",

216+

auth: [],

217+

resolveThinkingProfile,

218+

},

219+

});

220+

setActivePluginRegistry(registry);

221+222+

const cfg = createModelDefaultsConfig({ primary: "openai-codex/gpt-5.5" });

223+

const store = Object.fromEntries(

224+

Array.from({ length: 5 }, (_value, index) => [

225+

`session-${index}`,

226+

{

227+

sessionId: `session-${index}`,

228+

modelProvider: "openai-codex",

229+

model: "gpt-5.5",

230+

updatedAt: Date.now() - index,

231+

} satisfies SessionEntry,

232+

]),

233+

);

234+235+

const result = await listSessionsFromStoreAsync({

236+

cfg,

237+

storePath: "",

238+

store,

239+

opts: {},

240+

});

241+242+

expect(result.sessions).toHaveLength(5);

243+

expect(resolveThinkingProfile).toHaveBeenCalledTimes(3);

244+

});

245+246+

test("session list thinking cache preserves case-distinct model catalog entries", async () => {

247+

const cfg = createModelDefaultsConfig({ primary: "custom/CaseModel" });

248+

const modelCatalog = [

249+

{

250+

provider: "custom",

251+

id: "CaseModel",

252+

name: "CaseModel",

253+

reasoning: true,

254+

compat: { supportedReasoningEfforts: ["low", "medium", "high", "xhigh"] },

255+

},

256+

{

257+

provider: "custom",

258+

id: "casemodel",

259+

name: "casemodel",

260+

reasoning: true,

261+

compat: { supportedReasoningEfforts: ["low", "medium", "high"] },

262+

},

263+

];

264+

const result = await listSessionsFromStoreAsync({

265+

cfg,

266+

storePath: "",

267+

modelCatalog,

268+

store: {

269+

upper: {

270+

sessionId: "upper",

271+

modelProvider: "custom",

272+

model: "CaseModel",

273+

updatedAt: 2,

274+

} satisfies SessionEntry,

275+

lower: {

276+

sessionId: "lower",

277+

modelProvider: "custom",

278+

model: "casemodel",

279+

updatedAt: 1,

280+

} satisfies SessionEntry,

281+

},

282+

opts: {},

283+

});

284+285+

const upper = result.sessions.find((session) => session.key === "upper");

286+

const lower = result.sessions.find((session) => session.key === "lower");

287+

expect(upper?.thinkingLevels?.map((level) => level.id)).toContain("xhigh");

288+

expect(lower?.thinkingLevels?.map((level) => level.id)).not.toContain("xhigh");

289+

});

290+204291

test("session defaults and rows expose xhigh from configured catalog compat", () => {

205292

const cfg = createModelDefaultsConfig({ primary: "gmn/gpt-5.4" });

206293

const catalog = [