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

推荐订阅源

小众软件
小众软件
B
Blog RSS Feed
美团技术团队
博客园 - 【当耐特】
C
Check Point Blog
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
M
MIT News - Artificial intelligence
aimingoo的专栏
aimingoo的专栏
J
Java Code Geeks
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
Microsoft Azure Blog
Microsoft Azure Blog
博客园 - 司徒正美
T
Tailwind CSS Blog
Last Week in AI
Last Week in AI
Google DeepMind News
Google DeepMind News
D
DataBreaches.Net
人人都是产品经理
人人都是产品经理
N
Netflix TechBlog - Medium
Vercel News
Vercel News
P
Proofpoint News Feed
IT之家
IT之家
I
InfoQ
腾讯CDC
H
Hackread – Cybersecurity News, Data Breaches, AI and More

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(sessions): honor load-time maintenance config · openc...
steipete · 2026-04-25 · via Recent Commits to openclaw:main
Original file line numberDiff line numberDiff line change

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

6767
6868

### Fixes

6969
70+

- Sessions: honor configured `session.maintenance` settings during load-time maintenance instead of falling back to default entry caps. Fixes #71356. Thanks @comolago.

7071

- Browser/sandbox: pass the resolved `browser.ssrfPolicy` into sandbox browser bridges and refresh cached bridges when the effective policy changes, so sandboxed browser navigation honors private-network opt-ins. Fixes #45153 and #57055. Thanks @jzakirov, @zuoanCo, and @kybrcore.

7172

- Browser/proxy: keep Gateway/provider proxy environment variables from proxying the OpenClaw-managed browser, so `HTTP_PROXY` and `HTTPS_PROXY` no longer block ordinary browser navigation. Fixes #71358. Thanks @Sanjays2402.

7273

- Dashboard/Windows: open Control UI and OAuth URLs through the system URL handler without `cmd.exe` parsing or PATH-based `rundll32` lookup, and reject non-HTTP browser-open inputs. Fixes #71098. Thanks @Sanjays2402.

Original file line numberDiff line numberDiff line change

@@ -8,10 +8,10 @@ import {

88

setSerializedSessionStore,

99

writeSessionStoreCache,

1010

} from "./store-cache.js";

11+

import { resolveMaintenanceConfig } from "./store-maintenance-runtime.js";

1112

import {

1213

capEntryCount,

1314

pruneStaleEntries,

14-

resolveMaintenanceConfigFromInput,

1515

type ResolvedSessionMaintenanceConfig,

1616

} from "./store-maintenance.js";

1717

import { applySessionStoreMigrations } from "./store-migrations.js";

@@ -128,7 +128,7 @@ export function loadSessionStore(

128128
129129

applySessionStoreMigrations(store);

130130

normalizeSessionStore(store);

131-

const maintenance = opts.maintenanceConfig ?? resolveMaintenanceConfigFromInput();

131+

const maintenance = opts.maintenanceConfig ?? resolveMaintenanceConfig();

132132

if (maintenance.mode === "enforce" && Object.keys(store).length > maintenance.maxEntries) {

133133

const beforeCount = Object.keys(store).length;

134134

const pruned = pruneStaleEntries(store, maintenance.pruneAfterMs, { log: false });

Original file line numberDiff line numberDiff line change

@@ -287,6 +287,55 @@ describe("Integration: saveSessionStore with pruning", () => {

287287

expect(loaded.newest).toBeDefined();

288288

});

289289
290+

it("loadSessionStore honors configured maxEntries without an explicit override", async () => {

291+

mockLoadConfig.mockReturnValue({

292+

session: {

293+

maintenance: {

294+

mode: "enforce",

295+

pruneAfter: "365d",

296+

maxEntries: 1000,

297+

rotateBytes: 10_485_760,

298+

},

299+

},

300+

});

301+
302+

const now = Date.now();

303+

const store = Object.fromEntries(

304+

Array.from({ length: 501 }, (_, index) => [`session-${index}`, makeEntry(now - index)]),

305+

);

306+

await fs.writeFile(storePath, JSON.stringify(store), "utf-8");

307+
308+

const loaded = loadSessionStore(storePath, { skipCache: true });

309+
310+

expect(Object.keys(loaded)).toHaveLength(501);

311+

});

312+
313+

it("loadSessionStore honors configured warn mode without an explicit override", async () => {

314+

mockLoadConfig.mockReturnValue({

315+

session: {

316+

maintenance: {

317+

mode: "warn",

318+

pruneAfter: "365d",

319+

maxEntries: 1,

320+

rotateBytes: 10_485_760,

321+

},

322+

},

323+

});

324+
325+

const now = Date.now();

326+

const store: Record<string, SessionEntry> = {

327+

oldest: makeEntry(now - DAY_MS),

328+

newest: makeEntry(now),

329+

};

330+

await fs.writeFile(storePath, JSON.stringify(store), "utf-8");

331+
332+

const loaded = loadSessionStore(storePath, { skipCache: true });

333+
334+

expect(Object.keys(loaded)).toHaveLength(2);

335+

expect(loaded.oldest).toBeDefined();

336+

expect(loaded.newest).toBeDefined();

337+

});

338+
290339

it("archives transcript files for entries evicted by maxEntries capping", async () => {

291340

applyCappedMaintenanceConfig(mockLoadConfig);

292341