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

推荐订阅源

Jina AI
Jina AI
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
有赞技术团队
有赞技术团队
罗磊的独立博客
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
U
Unit 42
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
Recent Announcements
Recent Announcements
Y
Y Combinator Blog
Vercel News
Vercel News
Martin Fowler
Martin Fowler
V
V2EX
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
L
LangChain Blog
云风的 BLOG
云风的 BLOG
H
Hackread – Cybersecurity News, Data Breaches, AI and More
aimingoo的专栏
aimingoo的专栏
G
Google Developers Blog
The GitHub Blog
The GitHub Blog
N
Netflix TechBlog - Medium
Google DeepMind News
Google DeepMind News
雷峰网
雷峰网
阮一峰的网络日志
阮一峰的网络日志
F
Fortinet All Blogs

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
perf: speed up agent transcript lookup · openclaw/opencla...
steipete · 2026-05-25 · via Recent Commits to openclaw:main

@@ -11,7 +11,7 @@ const DEFAULT_ENTRY_MAX_CHARS = 6000;

11111212

function usage() {

1313

console.log(`Usage:

14-

agent-transcript find --query TEXT [--cwd PATH] [--since-days N] [--root PATH...]

14+

agent-transcript find --query TEXT [--cwd PATH] [--since-days N] [--max-files N] [--root PATH...]

1515

agent-transcript render --session FILE [--out FILE] [--max-chars N] [--entry-max-chars N] [--title TEXT] [--url URL]

1616

agent-transcript preview --session FILE [--out FILE] [--max-chars N] [--entry-max-chars N] [--title TEXT] [--url URL]

1717

agent-transcript append-body --body FILE --session FILE [--out FILE] [--max-chars N] [--entry-max-chars N]

@@ -425,17 +425,14 @@ function readBoundedText(file, maxBytes = 220000) {

425425

}

426426

}

427427428-

function sessionScanRecord(file) {

428+

function sessionScanRecord(file, maxBytes) {

429429

const stat = fs.statSync(file);

430-

let agent = "agent";

431-

try {

432-

agent = detectAgent(file, readJsonl(file, 50));

433-

} catch {}

430+

const agent = detectAgent(file, []);

434431

return {

435432

file,

436433

agent,

437434

mtime: new Date(stat.mtimeMs).toISOString(),

438-

haystack: `${file}\n${readBoundedText(file)}`.toLowerCase(),

435+

haystack: `${file}\n${readBoundedText(file, maxBytes)}`.toLowerCase(),

439436

};

440437

}

441438

@@ -461,6 +458,25 @@ function scoreScanRecord(record, terms, cwd) {

461458

return { file: record.file, score, reasons, mtime: record.mtime, agent: record.agent };

462459

}

463460461+

function recentFiles(files, maxFiles) {

462+

return files

463+

.map((file) => {

464+

try {

465+

return { file, mtimeMs: fs.statSync(file).mtimeMs };

466+

} catch {

467+

return null;

468+

}

469+

})

470+

.filter(Boolean)

471+

.sort((a, b) => b.mtimeMs - a.mtimeMs)

472+

.slice(0, maxFiles)

473+

.map((entry) => entry.file);

474+

}

475+476+

function candidateFiles(roots, terms, sinceMs, options = {}) {

477+

return recentFiles(roots.flatMap((root) => walkJsonl(root, sinceMs)), Number(options["max-files"] || 400));

478+

}

479+464480

function findSessions(options) {

465481

const sinceDays = Number(options["since-days"] || 14);

466482

const sinceMs = Date.now() - sinceDays * 24 * 60 * 60 * 1000;

@@ -470,9 +486,10 @@ function findSessions(options) {

470486

.split(/\s+/)

471487

.concat(query.match(/https?:\/\/\S+/g) || [])

472488

.filter(Boolean);

473-

const files = roots.flatMap((root) => walkJsonl(root, sinceMs));

489+

const files = candidateFiles(roots, terms, sinceMs, options);

490+

const scanBytes = Number(options["scan-bytes"] || 60000);

474491

const results = files

475-

.map((file) => scoreScanRecord(sessionScanRecord(file), terms, options.cwd))

492+

.map((file) => scoreScanRecord(sessionScanRecord(file, scanBytes), terms, options.cwd))

476493

.filter((result) => result.score > 0)

477494

.sort((a, b) => b.score - a.score || b.mtime.localeCompare(a.mtime))

478495

.slice(0, Number(options.limit || 10));

@@ -487,7 +504,7 @@ function sessionScanRecords(options) {

487504

return roots

488505

.flatMap((root) => walkJsonl(root, sinceMs))

489506

.filter((file) => !excluded.has(path.resolve(file)))

490-

.map(sessionScanRecord);

507+

.map((file) => sessionScanRecord(file, Number(options["scan-bytes"] || 90000)));

491508

}

492509493510

function replaceSection(body, section) {