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

推荐订阅源

让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
人人都是产品经理
人人都是产品经理
Cisco Talos Blog
Cisco Talos Blog
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
V
V2EX
博客园 - 三生石上(FineUI控件)
Martin Fowler
Martin Fowler
WordPress大学
WordPress大学
D
Docker
S
SegmentFault 最新的问题
博客园 - 聂微东
美团技术团队
Apple Machine Learning Research
Apple Machine Learning Research
月光博客
月光博客
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
Last Week in AI
Last Week in AI
M
MIT News - Artificial intelligence
F
Fortinet All Blogs
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
The GitHub Blog
The GitHub Blog
GbyAI
GbyAI
L
LangChain Blog
Vercel News
Vercel News
博客园 - 叶小钗
MongoDB | Blog
MongoDB | Blog
Stack Overflow Blog
Stack Overflow Blog
H
Help Net Security
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
The Cloudflare Blog
Engineering at Meta
Engineering at Meta
T
Threat Research - Cisco Blogs
T
Threatpost
Scott Helme
Scott Helme
T
Tailwind CSS Blog
Latest news
Latest news
Stack Overflow Blog
Stack Overflow Blog
Blog — PlanetScale
Blog — PlanetScale
The Register - Security
The Register - Security
罗磊的独立博客
P
Proofpoint News Feed
腾讯CDC
S
Schneier on Security
雷峰网
雷峰网
A
About on SuperTechFans
T
Tenable Blog
F
Full Disclosure
Cyberwarzone
Cyberwarzone
博客园_首页
有赞技术团队
有赞技术团队
K
Kaspersky official blog

Recent Commits to openclaw:main

fix(memory): bound qmd embed backoff · openclaw/openclaw@caac973 fix(discord): bound timeout member expiry · openclaw/openclaw@6399b6a fix(qqbot): skip token cache on invalid clock · openclaw/openclaw@472606d fix(infra): bound device bootstrap expiry · openclaw/openclaw@1774965 fix(cron): bound relative at timestamps · openclaw/openclaw@e0248fc fix(crestodian): bound rescue approval expiry · openclaw/openclaw@6a753ad fix(agents): bound codex cli fallback expiry · openclaw/openclaw@53812bd fix(gateway): forward stop sequences across providers feat: expand workboard orchestration metadata (#88408) fix(discord): bound rest rate-limit deadlines · openclaw/openclaw@abc26b0 fix(agents): show exec target node in tool display · openclaw/openclaw@64533ba fix(telegram): bound transport cooldown expiry · openclaw/openclaw@7d4bf8f test(release): harden live release checks · openclaw/openclaw@bdb0fde fix(anthropic): bound setup token expiry · openclaw/openclaw@926a165 fix(bedrock): bound mantle runtime token expiry · openclaw/openclaw@70b6fdd fix(agents): bound google prompt cache expiry · openclaw/openclaw@1ee751d fix(agents): bound auth profile block expiry · openclaw/openclaw@30e3ca0 fix(telegram): bound error cooldown expiry · openclaw/openclaw@1f6c1ea fix(discord): bound component registry expiry fix(discord): carry reply typing feedback through queue · openclaw/openclaw@6f20f29 fix(discord): omit undefined component registry fields fix(gateway): bound node pending work expiry fix(gateway): explain ignored restart signal · openclaw/openclaw@bc77f7a fix(media): dedupe duplicate inbound media path urls fix(gateway): bound plugin node capability expiry fix(install): show npm install progress without gum · openclaw/openclaw@1c9851e fix(commitments): bound terminal failure cooldown expiry · openclaw/openclaw@a4f6240 test(tasks): cover task domain view mappers (#86755) · openclaw/openclaw@8d3fe21 fix(imessage): bound private api negative cache expiry refactor(matrix): move ephemeral state to plugin sqlite (#88387) fix(imessage): bound approval reaction poll expiry fix(agents): bound exec followup handoff expiry · openclaw/openclaw@cbad1b6 fix(sandbox): bound novnc observer token expiry · openclaw/openclaw@f4cd5e4 test(release): wait for live probe cleanup · openclaw/openclaw@0e7773d fix(agents): bound exec approval request expiry · openclaw/openclaw@d8e7734 fix(google): bound realtime browser session expiry · openclaw/openclaw@da7fb64 fix(msteams): bound delegated token expiry · openclaw/openclaw@3fffb34 fix(workboard): bound claim expiry checks · openclaw/openclaw@0dd67e2 fix(browser): bound armed dialog expiry · openclaw/openclaw@4df27b9 fix(commands): bound private approval route expiry · openclaw/openclaw@e708a87 fix(agents): hide sessions_send alias normalization · openclaw/openclaw@2dacc6d fix(plugin-state): bound ttl expiry writes · openclaw/openclaw@9660e42 fix(skills): bound upload expiry checks · openclaw/openclaw@522da25 fix(exec): bound approval pending expiry · openclaw/openclaw@d44621b test(release): skip unavailable anthropic live models fix(matrix): bound allowlist store cache expiry · openclaw/openclaw@283238f fix(discord): bound unbound webhook echo expiry · openclaw/openclaw@5568ecc fix(zalouser): bound group context cache expiry · openclaw/openclaw@743d537 fix(tui): distinguish /new and /reset descriptions · openclaw/openclaw@63a3676 fix(voice-call): bound realtime stream token expiry feat(ui): add collapsible recent sessions section · openclaw/openclaw@a2fc4ca refactor: route model catalog imports to core package · openclaw/openclaw@8eeaa45 fix(sessions): repair prompt blobs on fast updates · openclaw/openclaw@4d13055 fix(qqbot): bound upload cache expiry · openclaw/openclaw@bfceffa fix(gateway): bound exec approval expiry · openclaw/openclaw@031583e fix(scripts): prebuild gateway cpu private qa artifacts · openclaw/openclaw@2ccbc67 fix(agents): bound code mode snapshot expiry · openclaw/openclaw@11b5728 [Fix] Deliver restart recovery replies (#86089) fix(feishu): bound card action token expiry · openclaw/openclaw@ac0fb97 fix(ci): repair current test type fixtures · openclaw/openclaw@1de9f99 fix(nvidia): bound featured model cache expiry fix(bedrock): bound discovery cache expiry · openclaw/openclaw@e52b4bc fix(plugins): ignore helper files in extension roots fix(bedrock): bound mantle iam token expiry · openclaw/openclaw@5ba3505 perf(gateway): reuse stable turn metadata · openclaw/openclaw@18e7d28 fix(outbound): bound current conversation expiry · openclaw/openclaw@02ca283 fix(plugin-sdk): bound live catalog cache expiry · openclaw/openclaw@4f0e3cb fix(outbound): pack newline-mode paragraphs up to limit fix(gateway): bound run session miss cache expiry · openclaw/openclaw@b1911a7 fix(agents): bound native permission approval expiry · openclaw/openclaw@450642a fix(discord): avoid private test session intersection fix(agents): bound native hook relay expiry fix(gateway): bound transcription relay session expiry fix(codex): refresh stale managed runtime plugin · openclaw/openclaw@3c91928 fix(gateway): bound realtime relay session expiry · openclaw/openclaw@6ac7564 fix(feishu): bound sender name cache expiry · openclaw/openclaw@23e1aac fix(discord): bound realtime wake followup expiry · openclaw/openclaw@c65af78 fix(scripts): make kitchen sink rpc help inert · openclaw/openclaw@4155ac1 fix(qqbot): honor legacy c2c stream progress fix(discord): bound speaker context cache expiry fix(gateway): bound config schema cache expiry Add per-agent SQLite cache store (#88349) · openclaw/openclaw@fc50f94 fix(qqbot): deliver partial tool progress fix(tailscale): bound whois cache expiry · openclaw/openclaw@f491d42 fix(google): bound gemini oauth token expiry fix(google): bound vertex adc token cache expiry · openclaw/openclaw@697bafa fix(msteams): bound parent thread cache expiry fix(msteams): bound team id cache expiry fix(whatsapp): bound group metadata cache expiry · openclaw/openclaw@5eb7192 fix(scripts): parse forwarded package script options fix(feishu): bound approval card expiry fix(feishu): bound quick action launcher expiry · openclaw/openclaw@0563470 fix(gateway): guard traced channel handoff stops · openclaw/openclaw@536c009 fix(feishu): bound card action chat cache clocks · openclaw/openclaw@c94c43d feat(ios): refresh app store metadata (#88235) · openclaw/openclaw@8a99c0d refactor: extract model catalog core package · openclaw/openclaw@30e1556 fix(feishu): bound group name cache clocks · openclaw/openclaw@ec15f90 fix(feishu): bound probe cache expiry clocks fix(zalo): bound hosted media expiry clocks · openclaw/openclaw@f91ddef fix(deps): remove photon root runtime · openclaw/openclaw@8438589
fix(agents): bound sqlite cache expiry · openclaw/openclaw@9ad7f5b
steipete · 2026-05-31 · via Recent Commits to openclaw:main

@@ -5,6 +5,13 @@ import {

55

getNodeSqliteKysely,

66

} from "../../infra/kysely-sync.js";

77

import { normalizeAgentId } from "../../routing/session-key.js";

8+

import {

9+

MAX_DATE_TIMESTAMP_MS,

10+

asDateTimestampMs,

11+

isFutureDateTimestampMs,

12+

resolveDateTimestampMs,

13+

resolveExpiresAtMsFromDurationMs,

14+

} from "../../shared/number-coercion.js";

815

import type { DB as OpenClawAgentKyselyDatabase } from "../../state/openclaw-agent-db.generated.js";

916

import {

1017

openOpenClawAgentDatabase,

@@ -89,7 +96,7 @@ function parseValue(raw: string | null): unknown {

89969097

function isExpired(row: AgentCacheRow, now: number): boolean {

9198

const expiresAt = asNumber(row.expires_at);

92-

return expiresAt !== null && expiresAt <= now;

99+

return expiresAt !== null && !isFutureDateTimestampMs(expiresAt, { nowMs: now });

93100

}

9410195102

function rowToCacheValue(

@@ -112,17 +119,31 @@ function resolveExpiresAt(options: AgentRuntimeCacheWriteOptions, now: number):

112119

if (!Number.isFinite(options.ttlMs) || options.ttlMs <= 0) {

113120

throw new Error("SQLite agent cache ttlMs must be a positive finite number.");

114121

}

115-

return now + options.ttlMs;

122+

const expiresAt = resolveExpiresAtMsFromDurationMs(options.ttlMs, { nowMs: now });

123+

if (expiresAt === undefined) {

124+

throw new Error("SQLite agent cache ttlMs must resolve to a valid Date timestamp.");

125+

}

126+

return expiresAt;

116127

}

117-

return options.expiresAt ?? null;

128+

if (options.expiresAt !== undefined) {

129+

if (options.expiresAt === null) {

130+

return null;

131+

}

132+

const expiresAt = asDateTimestampMs(options.expiresAt);

133+

if (expiresAt === undefined) {

134+

throw new Error("SQLite agent cache expiresAt must be a valid Date timestamp.");

135+

}

136+

return expiresAt;

137+

}

138+

return null;

118139

}

119140120141

export function writeSqliteAgentCacheEntry(

121142

options: WriteSqliteAgentCacheEntryOptions,

122143

): AgentRuntimeCacheValue {

123144

const scope = normalizeScope(options);

124145

const key = normalizeKey(options.key);

125-

const updatedAt = options.now?.() ?? Date.now();

146+

const updatedAt = resolveDateTimestampMs(options.now?.());

126147

const expiresAt = resolveExpiresAt(options, updatedAt);

127148

const valueJson = options.value === undefined ? null : JSON.stringify(options.value);

128149

const blob =

@@ -182,7 +203,7 @@ export function readSqliteAgentCacheEntry(

182203

.where("scope", "=", scope.scope)

183204

.where("key", "=", key),

184205

) ?? null;

185-

if (!row || isExpired(row, options.now?.() ?? Date.now())) {

206+

if (!row || isExpired(row, resolveDateTimestampMs(options.now?.()))) {

186207

return null;

187208

}

188209

return rowToCacheValue(row, scope);

@@ -192,7 +213,7 @@ export function listSqliteAgentCacheEntries(

192213

options: SqliteAgentCacheStoreOptions,

193214

): AgentRuntimeCacheValue[] {

194215

const scope = normalizeScope(options);

195-

const now = options.now?.() ?? Date.now();

216+

const now = resolveDateTimestampMs(options.now?.());

196217

const database = openOpenClawAgentDatabase(toDatabaseOptions(options));

197218

const db = getNodeSqliteKysely<AgentCacheDatabase>(database.db);

198219

return executeSqliteQuerySync(

@@ -238,7 +259,10 @@ export function clearExpiredSqliteAgentCacheEntries(

238259

options: SqliteAgentCacheStoreOptions & { currentTime?: number },

239260

): number {

240261

const scope = normalizeScope(options);

241-

const currentTime = options.currentTime ?? options.now?.() ?? Date.now();

262+

const currentTime = asDateTimestampMs(options.currentTime ?? options.now?.() ?? Date.now());

263+

if (currentTime === undefined) {

264+

return 0;

265+

}

242266

return runOpenClawAgentWriteTransaction((database) => {

243267

const db = getNodeSqliteKysely<AgentCacheDatabase>(database.db);

244268

const result = executeSqliteQuerySync(

@@ -247,7 +271,13 @@ export function clearExpiredSqliteAgentCacheEntries(

247271

.deleteFrom("cache_entries")

248272

.where("scope", "=", scope.scope)

249273

.where("expires_at", "is not", null)

250-

.where("expires_at", "<=", currentTime),

274+

.where((eb) =>

275+

eb.or([

276+

eb("expires_at", "<=", currentTime),

277+

eb("expires_at", ">", MAX_DATE_TIMESTAMP_MS),

278+

eb("expires_at", "<", -MAX_DATE_TIMESTAMP_MS),

279+

]),

280+

),

251281

);

252282

return Number(result.numAffectedRows ?? 0);

253283

}, toDatabaseOptions(options));