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

推荐订阅源

H
Help Net Security
T
ThreatConnect
SecWiki News
SecWiki News
F
Future of Privacy Forum
AWS News Blog
AWS News Blog
C
Cisco Blogs
A
Arctic Wolf
Vercel News
Vercel News
The GitHub Blog
The GitHub Blog
Scott Helme
Scott Helme
V
V2EX
博客园 - 叶小钗
阮一峰的网络日志
阮一峰的网络日志
K
Kaspersky official blog
G
Google Developers Blog
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
P
Privacy International News Feed
C
Cyber Attacks, Cyber Crime and Cyber Security
N
News | PayPal Newsroom
Schneier on Security
Schneier on Security
NISL@THU
NISL@THU
Microsoft Azure Blog
Microsoft Azure Blog
量子位
The Hacker News
The Hacker News
Stack Overflow Blog
Stack Overflow Blog
Security Latest
Security Latest
M
Microsoft Research Blog - Microsoft Research
Google Online Security Blog
Google Online Security Blog
博客园_首页
C
CXSECURITY Database RSS Feed - CXSecurity.com
I
InfoQ
Google DeepMind News
Google DeepMind News
Y
Y Combinator Blog
The Cloudflare Blog
Microsoft Security Blog
Microsoft Security Blog
Martin Fowler
Martin Fowler
Cisco Talos Blog
Cisco Talos Blog
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
T
Troy Hunt's Blog
F
Fox-IT International blog
S
Security @ Cisco Blogs
博客园 - 司徒正美
cs.CV updates on arXiv.org
cs.CV updates on arXiv.org
C
Comments on: Blog
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
L
LINUX DO - 最新话题
GbyAI
GbyAI
Project Zero
Project Zero
腾讯CDC
T
Tailwind CSS Blog

Recent Commits to openclaw:main

fix(perf): bound session transcript stat fanout fix(test): bound plugin gauntlet prebuilds Add OpenTelemetry LLM content spans (#86191) chore: remove unused tracked assets fix(release): accept optional Discord voice decoder · openclaw/openclaw@8f1f790 fix(perf): tolerate passing filtered release gates · openclaw/openclaw@c410658 fix(release): stabilize beta validation tests · openclaw/openclaw@e049105 fix(ui): refresh raw copy i18n baseline · openclaw/openclaw@010a79b fix(packaging): bound dist inventory filesystem scans fix(test): remove image tool timeout slack · openclaw/openclaw@669df88 fix(cron): accept opaque session target keys · openclaw/openclaw@c9364f0 fix: honor skill source install aliases (#84842) · openclaw/openclaw@24d58af fix(test): avoid message tool bundled channel loads · openclaw/openclaw@6421808 test(onboard): guard docker e2e resources · openclaw/openclaw@80aa6d7 chore: bump OpenClaw to 2026.5.26 · openclaw/openclaw@d00d0a2 fix: stabilize discord voice receive recovery · openclaw/openclaw@321f06a perf: reduce session and auth cache hotpath work (#86678) · openclaw/openclaw@ee51169 fix(qa): stream gateway gauntlet prebuild output fix(cli): route plugin packaging recovery hints · openclaw/openclaw@56633e4 perf(agents): reuse model manifest context · openclaw/openclaw@ea2496b fix(diagnostics): expose missing telemetry signals (#86682) · openclaw/openclaw@ef8619d perf: avoid extra session snapshot cloning · openclaw/openclaw@71e9eaa fix: avoid compaction checkpoint transcript copies (#86666) · openclaw/openclaw@c59635a fix: preserve code mode failure output test: avoid message tool discovery in send helper · openclaw/openclaw@1514cc8 fix(scripts): bound guard inventory file reads · openclaw/openclaw@6defcb0 fix(test): isolate kitchen sink rpc home env feat(signal): support reaction approvals (#85894) fix(scripts): bound source scan file reads · openclaw/openclaw@57748a6 test(ollama): support cloud api live smoke · openclaw/openclaw@2a6b4ed test: serialize agents tools vitest files · openclaw/openclaw@978a2d0 fix(auto-reply): use context-aware overflow reserve hints (#84399) · openclaw/openclaw@3a4f2b1 feat(gateway): forward OpenAI sampling params (#84094) · openclaw/openclaw@6c7b3f3 perf: cache model cost indexes · openclaw/openclaw@068924e fix: hide unsupported best effort message option · openclaw/openclaw@5dc7043 refactor: reuse realtime output activity in google meet (#86665) fix(test): harden bundled plugin install sweep · openclaw/openclaw@84929e4 fix: prefer source public artifacts in source checkouts · openclaw/openclaw@c87957d test: type child process spawn mock · openclaw/openclaw@65a2105 test(installer): cover rocky cli installs · openclaw/openclaw@fe33747 docs: update changelog for landed fixes · openclaw/openclaw@da831e2 fix: dampen repeated device-required probes · openclaw/openclaw@399c692 fix(ui): keep local file markdown links inert · openclaw/openclaw@fc2d2d5 fix(update): avoid duplicate plugin smoke failures · openclaw/openclaw@342bde2 fix(gateway): cap retained compaction checkpoint bytes · openclaw/openclaw@d7361ef fix: stabilize tests and reduce plugin memory churn · openclaw/openclaw@c1a026a perf: reduce runtime metadata hotpath churn · openclaw/openclaw@1d21224 refactor: share realtime output activity tracking (#86661) fix(memory-wiki): bound compile page reads (#86660) · openclaw/openclaw@acbdb8c test(qa-matrix): use larger media coverage jpeg fix(cli): reject unknown command help roots (#81083) (thanks @YB0y) · openclaw/openclaw@bec7d56 test: improve test profiling helpers · openclaw/openclaw@68ab48b perf: reduce fuzzy matching allocations · openclaw/openclaw@ec7ad3b perf: reduce runtime cache churn · openclaw/openclaw@1531fe2 refactor: reuse forced consult coordinator in discord voice (#86656) · openclaw/openclaw@0164fd5 fix(scripts): drain codex-cli metadata stdout (#84239) (thanks @Iftek… fix(test): avoid discord voice tts activation tax · openclaw/openclaw@75ac0b5 fix(codex): disable native thread personality (#85891) (thanks @lastg… · openclaw/openclaw@0f35ec2 Refactor realtime voice turn context tracking (#86650) fix(discord): surface silent reply-delivery skips and remove runtime.… · openclaw/openclaw@3a48366 test(discord): cover deliver-lambda abort-skip path via processDiscor… · openclaw/openclaw@48adcb1 docs: update changelog for landed bug fixes · openclaw/openclaw@75c6cf2 test(qa-matrix): use valid media coverage jpeg · openclaw/openclaw@0f54221 fix(gmail-watcher): strip listeners from old process after settleProc… · openclaw/openclaw@0a38932 fix(gmail-watcher): prevent TDZ in settleProcess and guard exit handl… · openclaw/openclaw@94968c8 fix(hooks): stop existing Gmail watcher before re-entry to prevent leaks fix(codex): honor yolo app-server approval policy · openclaw/openclaw@7b30291 fix(usage-cost): invalidate durable cache on missing-cost semantics c… · openclaw/openclaw@9c79a0f fix(usage-cost): preserve transport-recorded positive cost for unpric… · openclaw/openclaw@6e85869 fix(usage-cost): only flag catalog-default zeros, preserve operator-c… · openclaw/openclaw@1670249 fix: treat zero-rate usage cost as unknown · openclaw/openclaw@116c600 fix(usage-cost): surface unpriced-model spend as missingCostEntries i… · openclaw/openclaw@1cc0a96 fix(irc): normalize channel route ids · openclaw/openclaw@9cb1e47 test(irc): cover transient channel join · openclaw/openclaw@c4c80ce fix(irc): store inbound channel routes as channel:#name and join befo… · openclaw/openclaw@63dee51 fix(test): harden macos onboarding e2e · openclaw/openclaw@cd96542 fix(agents): strip markdown code spans from IDENTITY.md values and la… · openclaw/openclaw@55c9a6b perf: reduce runtime cache churn · openclaw/openclaw@5b6d03e fix(pi-runner): flush blocks after compaction retry (#85288) (thanks … · openclaw/openclaw@0d4575a fix(gateway): abort stale agent runs on restart · openclaw/openclaw@a122d80 fix(ui): harden control e2e browser setup · openclaw/openclaw@4424daf fix(telegram): keep overlapping DM replies deliverable (#85361) (than… · openclaw/openclaw@0f67dfd fix(openai): route compaction through Codex auth provider (#86408) · openclaw/openclaw@f4cfa01 refactor: share realtime forced consult coordination · openclaw/openclaw@5dccba7 test(qa-lab): add runtime confidence reports build: refresh dependency pins (#86628) · openclaw/openclaw@cda7c30 test: port release validation stabilizers · openclaw/openclaw@9f7485e fix(cron): stop forcing message tool for delivery · openclaw/openclaw@c51fa0d fix(google): omit request config with cached content test: stabilize release validation test harnesses fix(test): bound kitchen sink command output · openclaw/openclaw@f1197ed fix(discord): stabilize realtime wake-name feedback test(config): guard legacy agentRuntime regression perf: precompute audio resample kernels fix(codex): allow env api-key app-server bootstrap · openclaw/openclaw@009b18c refactor: reuse shared coercion helpers (#86419) · openclaw/openclaw@77d9ac3 fix(cron): preserve runtime snapshot for isolated delivery · openclaw/openclaw@a98660e fix(test): model active assistant failover attempts · openclaw/openclaw@c55bee5 docs: update changelog for bug sweep landings test: fix mock signatures for tsgo · openclaw/openclaw@aa05c5c
perf: speed up usage cost lookups · openclaw/openclaw@743bce2
steipete · 2026-05-26 · via Recent Commits to openclaw:main

@@ -1033,6 +1033,24 @@ const isModelPricingKnown = (cost: ReturnType<typeof resolveModelCostConfig>): b

10331033

return cost.input > 0 || cost.output > 0 || cost.cacheRead > 0 || cost.cacheWrite > 0;

10341034

};

103510351036+

type UsageCostResolver = (params: {

1037+

provider?: string;

1038+

model?: string;

1039+

}) => ReturnType<typeof resolveModelCostConfig>;

1040+1041+

function createUsageCostResolver(config?: OpenClawConfig): UsageCostResolver {

1042+

const cache = new Map<string, ReturnType<typeof resolveModelCostConfig>>();

1043+

return ({ provider, model }) => {

1044+

const key = `${provider ?? ""}\0${model ?? ""}`;

1045+

if (cache.has(key)) {

1046+

return cache.get(key);

1047+

}

1048+

const cost = resolveModelCostConfig({ provider, model, config });

1049+

cache.set(key, cost);

1050+

return cost;

1051+

};

1052+

}

1053+10361054

async function canReadJsonlFromOffset(filePath: string, startOffset: number): Promise<boolean> {

10371055

if (startOffset <= 0) {

10381056

return true;

@@ -1092,10 +1110,12 @@ async function* readJsonlRecords(

10921110

async function scanTranscriptFile(params: {

10931111

filePath: string;

10941112

config?: OpenClawConfig;

1113+

resolveCost?: UsageCostResolver;

10951114

startOffset?: number;

10961115

endOffset?: number;

10971116

onEntry: (entry: ParsedTranscriptEntry) => void;

10981117

}): Promise<void> {

1118+

const resolveCost = params.resolveCost ?? createUsageCostResolver(params.config);

10991119

for await (const parsed of readJsonlRecords(

11001120

params.filePath,

11011121

params.startOffset,

@@ -1107,10 +1127,9 @@ async function scanTranscriptFile(params: {

11071127

}

1108112811091129

if (entry.usage) {

1110-

const cost = resolveModelCostConfig({

1130+

const cost = resolveCost({

11111131

provider: entry.provider,

11121132

model: entry.model,

1113-

config: params.config,

11141133

});

11151134

if (cost?.tieredPricing && cost.tieredPricing.length > 0) {

11161135

// When tiered pricing is configured, always recompute to override

@@ -1146,13 +1165,15 @@ async function scanTranscriptFile(params: {

11461165

async function scanUsageFile(params: {

11471166

filePath: string;

11481167

config?: OpenClawConfig;

1168+

resolveCost?: UsageCostResolver;

11491169

startOffset?: number;

11501170

endOffset?: number;

11511171

onEntry: (entry: ParsedUsageEntry) => void;

11521172

}): Promise<void> {

11531173

await scanTranscriptFile({

11541174

filePath: params.filePath,

11551175

config: params.config,

1176+

resolveCost: params.resolveCost,

11561177

startOffset: params.startOffset,

11571178

endOffset: params.endOffset,

11581179

onEntry: (entry) => {

@@ -1260,6 +1281,7 @@ export async function loadCostUsageSummary(params?: {

1260128112611282

const dailyMap = new Map<string, CostUsageTotals>();

12621283

const totals = emptyTotals();

1284+

const resolveCost = createUsageCostResolver(params?.config);

1263128512641286

const sessionsDir = resolveSessionTranscriptsDirForAgent(params?.agentId);

12651287

const entries = await fs.promises.readdir(sessionsDir, { withFileTypes: true }).catch(() => []);

@@ -1286,6 +1308,7 @@ export async function loadCostUsageSummary(params?: {

12861308

await scanUsageFile({

12871309

filePath,

12881310

config: params?.config,

1311+

resolveCost,

12891312

onEntry: (entry) => {

12901313

const ts = entry.timestamp?.getTime();

12911314

if (!ts || ts < sinceTime || ts > untilTime) {

@@ -1329,6 +1352,7 @@ export async function loadCostUsageSummary(params?: {

13291352

async function scanUsageFileForCache(params: {

13301353

file: UsageCostTranscriptFile;

13311354

config?: OpenClawConfig;

1355+

resolveCost?: UsageCostResolver;

13321356

previous?: UsageCostCacheFileEntry;

13331357

includeSessionSummary?: boolean;

13341358

}): Promise<UsageCostCacheFileEntry> {

@@ -1364,6 +1388,7 @@ async function scanUsageFileForCache(params: {

13641388

await scanTranscriptFile({

13651389

filePath: params.file.filePath,

13661390

config: params.config,

1391+

resolveCost: params.resolveCost,

13671392

startOffset,

13681393

endOffset: params.file.size,

13691394

onEntry: (entry) => {

@@ -1519,11 +1544,13 @@ export async function refreshCostUsageCache(params?: {

15191544

return aSession - bSession || a.size - b.size || a.filePath.localeCompare(b.filePath);

15201545

})

15211546

.slice(0, maxFiles);

1547+

const resolveCost = createUsageCostResolver(params?.config);

1522154815231549

for (const file of staleFiles) {

15241550

cache.files[file.filePath] = await scanUsageFileForCache({

15251551

file,

15261552

config: params?.config,

1553+

resolveCost,

15271554

previous: cache.files[file.filePath],

15281555

includeSessionSummary: sessionSummaryFiles.has(file.filePath),

15291556

});

@@ -1975,10 +2002,12 @@ export async function loadSessionCostSummary(params: {

19752002

const latencyValues: number[] = [];

19762003

let lastUserTimestamp: number | undefined;

19772004

const MAX_LATENCY_MS = 12 * 60 * 60 * 1000;

2005+

const resolveCost = createUsageCostResolver(params.config);

1978200619792007

await scanTranscriptFile({

19802008

filePath: sessionFile,

19812009

config: params.config,

2010+

resolveCost,

19822011

onEntry: (entry) => {

19832012

const ts = entry.timestamp?.getTime();

19842013

@@ -2264,10 +2293,12 @@ export async function loadSessionUsageTimeSeries(params: {

22642293

const points: SessionUsageTimePoint[] = [];

22652294

let cumulativeTokens = 0;

22662295

let cumulativeCost = 0;

2296+

const resolveCost = createUsageCostResolver(params.config);

2267229722682298

await scanUsageFile({

22692299

filePath: sessionFile,

22702300

config: params.config,

2301+

resolveCost,

22712302

onEntry: (entry) => {

22722303

const ts = entry.timestamp?.getTime();

22732304

if (!ts) {

@@ -2374,6 +2405,7 @@ export async function loadSessionLogs(params: {

23742405

}

23752406

}

23762407

const limit = params.limit ?? 50;

2408+

const resolveCost = createUsageCostResolver(params.config);

2377240923782410

for await (const parsed of readJsonlRecords(sessionFile)) {

23792411

try {

@@ -2488,10 +2520,9 @@ export async function loadSessionLogs(params: {

24882520

if (breakdown?.total !== undefined) {

24892521

cost = breakdown.total;

24902522

} else {

2491-

const costConfig = resolveModelCostConfig({

2523+

const costConfig = resolveCost({

24922524

provider: message.provider as string | undefined,

24932525

model: message.model as string | undefined,

2494-

config: params.config,

24952526

});

24962527

cost = estimateUsageCost({ usage, cost: costConfig });

24972528

}