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

推荐订阅源

爱范儿
爱范儿
P
Palo Alto Networks Blog
月光博客
月光博客
H
Hackread – Cybersecurity News, Data Breaches, AI and More
I
InfoQ
aimingoo的专栏
aimingoo的专栏
腾讯CDC
T
Threatpost
D
DataBreaches.Net
Vercel News
Vercel News
F
Fortinet All Blogs
Engineering at Meta
Engineering at Meta
C
Cybersecurity and Infrastructure Security Agency CISA
Forbes - Security
Forbes - Security
U
Unit 42
C
Check Point Blog
Blog — PlanetScale
Blog — PlanetScale
O
OpenAI News
量子位
TaoSecurity Blog
TaoSecurity Blog
Microsoft Azure Blog
Microsoft Azure Blog
cs.AI updates on arXiv.org
cs.AI updates on arXiv.org
V
Visual Studio Blog
Recorded Future
Recorded Future
云风的 BLOG
云风的 BLOG
Security Archives - TechRepublic
Security Archives - TechRepublic
The Last Watchdog
The Last Watchdog
S
Security Affairs
Attack and Defense Labs
Attack and Defense Labs
罗磊的独立博客
Stack Overflow Blog
Stack Overflow Blog
Microsoft Security Blog
Microsoft Security Blog
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
V
V2EX
小众软件
小众软件
S
SegmentFault 最新的问题
www.infosecurity-magazine.com
www.infosecurity-magazine.com
W
WeLiveSecurity
AI
AI
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
博客园 - 聂微东
I
Intezer
Know Your Adversary
Know Your Adversary
Exploit-DB.com RSS Feed
Exploit-DB.com RSS Feed
P
Proofpoint News Feed
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
The Cloudflare Blog
博客园_首页
NISL@THU
NISL@THU
K
KPMG report finds enterprise disconnect between AI and its ROI | CIO

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 test: trim doctor command hotspots · openclaw/openclaw@c66f16a test: isolate agent auth and spawn hotspots · openclaw/openclaw@9285935 test: stabilize MCP startup disposal race · openclaw/openclaw@dd9d2eb test: merge browser contract server suites · openclaw/openclaw@5817a76 test: narrow ollama provider discovery setup · openclaw/openclaw@a0d9598 build: declare qa-lab aimock runtime dependency · openclaw/openclaw@24431e5 test: speed up safe-bins exec harness · openclaw/openclaw@ee856ab test: preserve tool helpers in embedded runner mocks · openclaw/openclaw@acd86a0 refactor: move memory embeddings into provider plugins · openclaw/openclaw@77e6e4c test: reuse system-run temp fixtures · openclaw/openclaw@7e9ff0f test: trim hotspot wait overhead · openclaw/openclaw@12a59b0 Check: avoid duplicate boundary prep · openclaw/openclaw@baf11b8 test: reduce hotspot fixture overhead · openclaw/openclaw@3a59edd feat(ui): overhaul settings and slash command UX (#67819) thanks @Bun… · openclaw/openclaw@2cfb660 QA Matrix: exit cleanly on failure · openclaw/openclaw@42805d2 QA Matrix: isolate scenario coverage · openclaw/openclaw@7e659e1 Matrix: refresh crypto bootstrap state · openclaw/openclaw@94081d8 QA Lab: add provider registry · openclaw/openclaw@bb7e982 Matrix: add plugin changelog · openclaw/openclaw@4acab55 test: trim more hotspot overhead · openclaw/openclaw@f485311 test: trim remaining hotspot tests · openclaw/openclaw@6ba8626 test: narrow hotspot mocks · openclaw/openclaw@dbc8179 test: isolate gemini embedding request helpers · openclaw/openclaw@cd330f5 test: trim memory and mcp hotspots · openclaw/openclaw@fd48dfa test: slim provider registry mocks · openclaw/openclaw@2e08c77 test: harden Parallels update smoke · openclaw/openclaw@1a98090 feat: default Anthropic to Opus 4.7 · openclaw/openclaw@628b454 fix: harden node-host shell payload mutability checks · openclaw/openclaw@75c551e fix: land node-host approval binding for native binaries (#66731) (th… · openclaw/openclaw@29919bb CI: add daily schedule to CodeQL workflow (#67645) · openclaw/openclaw@69d25f5 fix(gateway): capture config hash after plugin auto-enable to prevent… · openclaw/openclaw@8c11210 fix: repair sanitized replay tool results before send (#67620) (thank… · openclaw/openclaw@c3c7a99 fix: restrict HTML timeout short-circuit to transient statuses · openclaw/openclaw@de129a6 fix: keep TUI watchdog bound to active run (#67401) (thanks @xantorres) · openclaw/openclaw@3525273 Gateway/skills: dedupe skills prefix-match + drop dead fallback on log · openclaw/openclaw@d7f489f Extensions/lmstudio: back off inference preload after consecutive fai… · openclaw/openclaw@b555214 TUI/streaming: add watchdog that resets the activity indicator after … · openclaw/openclaw@f44ab20 Agents/tool-loop: enable unknown-tool stream guard by default · openclaw/openclaw@36ed367 Gateway/skills: invalidate session skills snapshot on config write · openclaw/openclaw@b23d59a fix: classify HTML provider error pages correctly (#67642) (thanks @s… · openclaw/openclaw@e588e90 fix(skills): remove unused model-usage import (#67641) · openclaw/openclaw@55f05df docs(changelog): credit codex fix superseded PRs · openclaw/openclaw@e485f24 fix(openai-codex): normalize stale transport metadata in resolution a… · openclaw/openclaw@90801ba CI: pin Docker-related GitHub Actions (#67632) · openclaw/openclaw@f697b01 Android: modernize WebView and discovery API usage (#67627) · openclaw/openclaw@44a6e50 fix(deps): bump hono to 4.12.14 and @hono/node-server to 1.19.14 (GHS… · openclaw/openclaw@fbccc18 fix(deps): bump dompurify to 3.4.0 (#67614) · openclaw/openclaw@2c2dc00 CI: add explicit permissions to all workflow jobs (fixes code-scannin… · openclaw/openclaw@01b7516 fix: register bundled TTS providers and route overrides correctly (#6… · openclaw/openclaw@6ea3cdd fix: align host tilde paths with OS home (#62804) (thanks @stainlu) · openclaw/openclaw@ecfaf64 fix: flush creds queue before reconnect socket open (#67464) (thanks … · openclaw/openclaw@405c63f fix: strip standalone <function> tool call tags from visible text (#6… · openclaw/openclaw@78df859 fix(agents): preserve cli session metadata before transcript persist … · openclaw/openclaw@898fd04 docs(changelog): move cli transcript entry · openclaw/openclaw@c1817c6 fix(agents): normalize cli transcript api field · openclaw/openclaw@3a3fae0 docs(changelog): note cli transcript persistence · openclaw/openclaw@6c343f1 fix(agents): persist cli transcript turns · openclaw/openclaw@b8ef507 fix(msteams): harden security-sensitive flows (#65841) · openclaw/openclaw@c56b56e [Dashboard] Fix exec approval modal overflow for long command content… · openclaw/openclaw@053c5b0 Docs: remove QA changelog entry · openclaw/openclaw@7fd5771 QA: fix private runtime source loading (#67428) · openclaw/openclaw@d5933af docs(gateway): correct protocol.md schema path, hello-ok example, aut… · openclaw/openclaw@489404d CI: pin Node 22 runners to 22.18.0 · openclaw/openclaw@4ffa621 models.authStatus: normalize provider ids + tighten env-backed escape… · openclaw/openclaw@f2fdb9d Update CHANGELOG.md · openclaw/openclaw@7694a92 test(parallels): clean up npm update guard jobs · openclaw/openclaw@045ea7b Plugins: prefer scanDir override paths · openclaw/openclaw@b2974da fix(dreaming): default storage.mode to "separate" so phase blocks sto… · openclaw/openclaw@8c392f0 fix(memory-core): skip dreaming transcript ingestion via session stor… · openclaw/openclaw@a1b01f0 fix: dedupe replayed exec.finished node events (#67281) · openclaw/openclaw@5dcf526
refactor(cron): keep legacy notify migration in doctor · openclaw/openclaw@b222b5f
steipete · 2026-05-31 · via Recent Commits to openclaw:main
11

import path from "node:path";

2-

import type { DatabaseSync } from "node:sqlite";

32

import {

43

normalizeLowercaseStringOrEmpty,

54

normalizeOptionalString,

65

normalizeStringifiedOptionalString,

76

} from "@openclaw/normalization-core/string-coerce";

87

import { uniqueValues } from "@openclaw/normalization-core/string-normalization";

9-

import type { Insertable, Selectable } from "kysely";

108

import { parseByteSize } from "../cli/parse-bytes.js";

119

import type { CronConfig } from "../config/types.cron.js";

12-

import { executeSqliteQuerySync, getNodeSqliteKysely } from "../infra/kysely-sync.js";

13-

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

1410

import {

1511

openOpenClawStateDatabase,

1612

runOpenClawStateWriteTransaction,

1713

} from "../state/openclaw-state-db.js";

1814

import type { CronRunLogEntry } from "./run-log-types.js";

19-

import { parseCronRunLogEntryObject } from "./run-log/entry-codec.js";

15+

import {

16+

countCronRunLogRows,

17+

insertCronRunLogEntry,

18+

parseStoredRunLogEntry,

19+

pruneCronRunLogRows,

20+

readCronRunLogRows,

21+

readCronRunLogRowsPage,

22+

} from "./run-log/sqlite-store.js";

2023

import type { CronDeliveryStatus, CronRunStatus } from "./types.js";

21242225

export type { CronRunLogEntry } from "./run-log-types.js";

@@ -55,11 +58,6 @@ type AppendCronRunLogOptions = {

5558

keepLines?: number | false;

5659

};

576058-

type CronRunLogsTable = OpenClawStateKyselyDatabase["cron_run_logs"];

59-

type CronRunLogDatabase = Pick<OpenClawStateKyselyDatabase, "cron_run_logs">;

60-

type CronRunLogRow = Selectable<CronRunLogsTable>;

61-

type CronRunLogInsert = Insertable<CronRunLogsTable>;

62-6361

const INVALID_CRON_RUN_LOG_JOB_ID_MESSAGE = "invalid cron run log job id";

64626563

function assertSafeCronRunLogJobId(jobId: string): string {

@@ -132,207 +130,6 @@ function cronStoreKey(storePath: string): string {

132130

return path.resolve(storePath);

133131

}

134132135-

function getCronRunLogKysely(db: DatabaseSync) {

136-

return getNodeSqliteKysely<CronRunLogDatabase>(db);

137-

}

138-139-

function normalizeNumber(value: number | bigint | null): number | undefined {

140-

if (typeof value === "bigint") {

141-

return Number(value);

142-

}

143-

return typeof value === "number" ? value : undefined;

144-

}

145-146-

function booleanToInteger(value: boolean | undefined): number | null {

147-

return typeof value === "boolean" ? (value ? 1 : 0) : null;

148-

}

149-150-

function integerToBoolean(value: number | bigint | null): boolean | undefined {

151-

const normalized = normalizeNumber(value);

152-

return normalized == null ? undefined : normalized !== 0;

153-

}

154-155-

function bindCronRunLogRow(params: {

156-

storeKey: string;

157-

seq: number;

158-

entry: CronRunLogEntry;

159-

}): CronRunLogInsert {

160-

const entry = params.entry;

161-

return {

162-

store_key: params.storeKey,

163-

job_id: entry.jobId,

164-

seq: params.seq,

165-

ts: entry.ts,

166-

status: entry.status ?? null,

167-

error: entry.error ?? null,

168-

summary: entry.summary ?? null,

169-

diagnostics_summary: entry.diagnostics?.summary ?? null,

170-

delivery_status: entry.deliveryStatus ?? null,

171-

delivery_error: entry.deliveryError ?? null,

172-

delivered: booleanToInteger(entry.delivered),

173-

session_id: entry.sessionId ?? null,

174-

session_key: entry.sessionKey ?? null,

175-

run_id: entry.runId ?? null,

176-

run_at_ms: entry.runAtMs ?? null,

177-

duration_ms: entry.durationMs ?? null,

178-

next_run_at_ms: entry.nextRunAtMs ?? null,

179-

model: entry.model ?? null,

180-

provider: entry.provider ?? null,

181-

total_tokens: entry.usage?.total_tokens ?? null,

182-

entry_json: JSON.stringify(entry),

183-

created_at: Date.now(),

184-

};

185-

}

186-187-

function parseStoredRunLogEntry(row: CronRunLogRow): CronRunLogEntry | null {

188-

let rawEntry: unknown;

189-

try {

190-

rawEntry = JSON.parse(row.entry_json);

191-

} catch {

192-

return null;

193-

}

194-

const parsed = parseCronRunLogEntryObject(rawEntry, { jobId: row.job_id });

195-

if (!parsed) {

196-

return null;

197-

}

198-

return {

199-

...parsed,

200-

ts: normalizeNumber(row.ts) ?? parsed.ts,

201-

jobId: row.job_id,

202-

status: (row.status as CronRunStatus | null) ?? parsed.status,

203-

error: row.error ?? parsed.error,

204-

summary: row.summary ?? parsed.summary,

205-

delivered: integerToBoolean(row.delivered) ?? parsed.delivered,

206-

deliveryStatus: (row.delivery_status as CronDeliveryStatus | null) ?? parsed.deliveryStatus,

207-

deliveryError: row.delivery_error ?? parsed.deliveryError,

208-

sessionId: row.session_id ?? parsed.sessionId,

209-

sessionKey: row.session_key ?? parsed.sessionKey,

210-

runId: row.run_id ?? parsed.runId,

211-

runAtMs: normalizeNumber(row.run_at_ms) ?? parsed.runAtMs,

212-

durationMs: normalizeNumber(row.duration_ms) ?? parsed.durationMs,

213-

nextRunAtMs: normalizeNumber(row.next_run_at_ms) ?? parsed.nextRunAtMs,

214-

model: row.model ?? parsed.model,

215-

provider: row.provider ?? parsed.provider,

216-

};

217-

}

218-219-

function readCronRunLogRows(db: DatabaseSync, storeKey: string, jobId?: string): CronRunLogRow[] {

220-

let query = getCronRunLogKysely(db)

221-

.selectFrom("cron_run_logs")

222-

.selectAll()

223-

.where("store_key", "=", storeKey);

224-

if (jobId) {

225-

query = query.where("job_id", "=", jobId);

226-

}

227-

return executeSqliteQuerySync(db, query.orderBy("ts", "asc").orderBy("seq", "asc")).rows;

228-

}

229-230-

function buildRunLogWhereClause(params: {

231-

storeKey: string;

232-

jobId?: string;

233-

statuses: CronRunStatus[] | null;

234-

deliveryStatuses: CronDeliveryStatus[] | null;

235-

runId?: string;

236-

}): { whereSql: string; values: Array<string | number> } {

237-

const clauses = ["store_key = ?"];

238-

const values: Array<string | number> = [params.storeKey];

239-

if (params.jobId) {

240-

clauses.push("job_id = ?");

241-

values.push(params.jobId);

242-

}

243-

if (params.statuses?.length) {

244-

clauses.push(`status IN (${params.statuses.map(() => "?").join(", ")})`);

245-

values.push(...params.statuses);

246-

}

247-

if (params.deliveryStatuses?.length) {

248-

clauses.push(

249-

`COALESCE(delivery_status, 'not-requested') IN (${params.deliveryStatuses

250-

.map(() => "?")

251-

.join(", ")})`,

252-

);

253-

values.push(...params.deliveryStatuses);

254-

}

255-

const runId = normalizeOptionalString(params.runId);

256-

if (runId) {

257-

clauses.push("run_id = ?");

258-

values.push(runId);

259-

}

260-

return { whereSql: clauses.join(" AND "), values };

261-

}

262-263-

function countCronRunLogRows(

264-

db: DatabaseSync,

265-

whereSql: string,

266-

values: Array<string | number>,

267-

): number {

268-

const row = db

269-

.prepare(`SELECT COUNT(*) AS count FROM cron_run_logs WHERE ${whereSql}`)

270-

.get(...values) as { count?: number | bigint } | undefined;

271-

return normalizeNumber(row?.count ?? null) ?? 0;

272-

}

273-274-

function readCronRunLogRowsPage(params: {

275-

db: DatabaseSync;

276-

storeKey: string;

277-

jobId?: string;

278-

statuses: CronRunStatus[] | null;

279-

deliveryStatuses: CronDeliveryStatus[] | null;

280-

runId?: string;

281-

sortDir: CronRunLogSortDir;

282-

offset?: number;

283-

limit?: number;

284-

}): CronRunLogRow[] {

285-

const { whereSql, values } = buildRunLogWhereClause(params);

286-

const order = params.sortDir === "asc" ? "ASC" : "DESC";

287-

const limitSql =

288-

params.limit === undefined || params.offset === undefined ? "" : " LIMIT ? OFFSET ?";

289-

const limitValues =

290-

params.limit === undefined || params.offset === undefined ? [] : [params.limit, params.offset];

291-

return params.db

292-

.prepare(

293-

`SELECT * FROM cron_run_logs WHERE ${whereSql} ORDER BY ts ${order}, seq ${order}${limitSql}`,

294-

)

295-

.all(...values, ...limitValues) as CronRunLogRow[];

296-

}

297-298-

function nextCronRunLogSeq(db: DatabaseSync, storeKey: string, jobId: string): number {

299-

const row = db

300-

.prepare(

301-

"SELECT COALESCE(MAX(seq), 0) AS seq FROM cron_run_logs WHERE store_key = ? AND job_id = ?",

302-

)

303-

.get(storeKey, jobId) as { seq?: number | bigint } | undefined;

304-

return (normalizeNumber(row?.seq ?? null) ?? 0) + 1;

305-

}

306-307-

function insertCronRunLogEntry(db: DatabaseSync, storeKey: string, entry: CronRunLogEntry): void {

308-

const seq = nextCronRunLogSeq(db, storeKey, entry.jobId);

309-

executeSqliteQuerySync(

310-

db,

311-

getCronRunLogKysely(db)

312-

.insertInto("cron_run_logs")

313-

.values(bindCronRunLogRow({ storeKey, seq, entry })),

314-

);

315-

}

316-317-

function pruneCronRunLogRows(

318-

db: DatabaseSync,

319-

storeKey: string,

320-

jobId: string,

321-

keepLines: number,

322-

): void {

323-

const keep = Math.max(1, Math.floor(keepLines));

324-

db.prepare(

325-

`DELETE FROM cron_run_logs

326-

WHERE store_key = ? AND job_id = ?

327-

AND seq NOT IN (

328-

SELECT seq FROM cron_run_logs

329-

WHERE store_key = ? AND job_id = ?

330-

ORDER BY seq DESC

331-

LIMIT ?

332-

)`,

333-

).run(storeKey, jobId, storeKey, jobId, keep);

334-

}

335-336133

export async function appendCronRunLog(params: {

337134

storePath: string;

338135

entry: CronRunLogEntry;

@@ -503,14 +300,14 @@ export async function readCronRunLogEntriesPage(

503300

const offset = Math.max(0, Math.floor(opts.offset ?? 0));

504301505302

if (!query) {

506-

const { whereSql, values } = buildRunLogWhereClause({

303+

const total = countCronRunLogRows({

304+

db,

507305

storeKey,

508306

jobId,

509307

statuses,

510308

deliveryStatuses,

511309

runId: opts.runId,

512310

});

513-

const total = countCronRunLogRows(db, whereSql, values);

514311

const boundedOffset = Math.min(total, offset);

515312

const entries = readCronRunLogRowsPage({

516313

db,