docs: document agent cache helpers · openclaw/openclaw@0dea7ea
steipete
·
2026-06-04
·
via Recent Commits to openclaw:main
| Original file line number | Diff line number | Diff line change |
|---|
|
| 1 | +/** |
| 2 | + * Optional JSONL diagnostics for agent cache/session/prompt tracing. |
| 3 | + */ |
1 | 4 | import crypto from "node:crypto"; |
2 | 5 | import path from "node:path"; |
3 | 6 | import { resolveStateDir } from "../config/paths.js"; |
@@ -11,8 +14,8 @@ import type { AgentMessage, StreamFn } from "./runtime/index.js";
|
11 | 14 | import { stableStringify } from "./stable-stringify.js"; |
12 | 15 | import { buildAgentTraceBase } from "./trace-base.js"; |
13 | 16 | |
14 | | -// Optional cache-trace diagnostics for prompt/session/cache debugging. Payloads |
15 | | -// are redacted before JSONL output while stable digests preserve correlation. |
| 17 | +// Payloads are redacted before JSONL output while stable digests preserve |
| 18 | +// correlation across prompt/session/cache stages. |
16 | 19 | type CacheTraceStage = |
17 | 20 | | "cache:result" |
18 | 21 | | "cache:state" |
|
| Original file line number | Diff line number | Diff line change |
|---|
|
| 1 | +/** |
| 2 | + * SQLite implementation of the agent runtime cache store. |
| 3 | + */ |
1 | 4 | import { |
2 | 5 | MAX_DATE_TIMESTAMP_MS, |
3 | 6 | asDateTimestampMs, |
@@ -24,13 +27,13 @@ import type {
|
24 | 27 | AgentRuntimeCacheWriteOptions, |
25 | 28 | } from "./agent-cache-store.js"; |
26 | 29 | |
27 | | -// SQLite-backed agent runtime cache. Entries are scoped per agent/scope pair and |
28 | | -// can store JSON values, binary blobs, and optional expiration timestamps. |
| 30 | +/** Options for an agent/scope-scoped SQLite runtime cache. */ |
29 | 31 | export type SqliteAgentCacheStoreOptions = OpenClawAgentDatabaseOptions & { |
30 | 32 | scope: string; |
31 | 33 | now?: () => number; |
32 | 34 | }; |
33 | 35 | |
| 36 | +/** Options for writing a single SQLite agent cache entry. */ |
34 | 37 | export type WriteSqliteAgentCacheEntryOptions = SqliteAgentCacheStoreOptions & |
35 | 38 | AgentRuntimeCacheWriteOptions; |
36 | 39 | |
|
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。