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

推荐订阅源

D
DataBreaches.Net
N
Netflix TechBlog - Medium
F
Fortinet All Blogs
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
宝玉的分享
宝玉的分享
Y
Y Combinator Blog
博客园 - 聂微东
WordPress大学
WordPress大学
酷 壳 – CoolShell
酷 壳 – CoolShell
B
Blog RSS Feed
小众软件
小众软件
The GitHub Blog
The GitHub Blog
S
SegmentFault 最新的问题
Hugging Face - Blog
Hugging Face - Blog
Jina AI
Jina AI
Microsoft Azure Blog
Microsoft Azure Blog
V
V2EX
B
Blog
H
Help Net Security
D
Docker
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
罗磊的独立博客
月光博客
月光博客
博客园 - 司徒正美

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
fix(memory): default non-finite lancedb text limits · ope...
steipete · 2026-05-29 · via Recent Commits to openclaw:main

File tree

  • extensions/memory-lancedb

Original file line numberDiff line numberDiff line change

@@ -2408,13 +2408,15 @@ describe("memory plugin e2e", () => {

24082408

const customTooLong = `I always prefer this style. ${"x".repeat(1600)}`;

24092409

expect(shouldCapture(customAllowed, { maxChars: 1500 })).toBe(true);

24102410

expect(shouldCapture(customTooLong, { maxChars: 1500 })).toBe(false);

2411+

expect(shouldCapture(defaultTooLong, { maxChars: Number.NaN })).toBe(false);

24112412

});

24122413
24132414

test("normalizeRecallQuery trims whitespace and bounds embedding input", () => {

24142415

expect(normalizeRecallQuery(" remember the blue mug ", 100)).toBe(

24152416

"remember the blue mug",

24162417

);

24172418

expect(normalizeRecallQuery(`look up ${"x".repeat(200)}`, 120)).toHaveLength(120);

2419+

expect(normalizeRecallQuery(`look up ${"x".repeat(2000)}`, Number.NaN)).toHaveLength(1000);

24182420

});

24192421
24202422

test("normalizeEmbeddingVector accepts float arrays and base64 float32 responses", () => {

Original file line numberDiff line numberDiff line change

@@ -139,10 +139,16 @@ export function normalizeRecallQuery(

139139

maxChars: number = DEFAULT_RECALL_MAX_CHARS,

140140

): string {

141141

const normalized = text.replace(/\s+/g, " ").trim();

142-

const limit = Math.max(0, Math.floor(maxChars));

142+

const limit = normalizeMaxChars(maxChars, DEFAULT_RECALL_MAX_CHARS);

143143

return normalized.length > limit ? truncateUtf16Safe(normalized, limit).trimEnd() : normalized;

144144

}

145145
146+

function normalizeMaxChars(value: number | undefined, fallback: number): number {

147+

return typeof value === "number" && Number.isFinite(value)

148+

? Math.max(0, Math.floor(value))

149+

: fallback;

150+

}

151+
146152

function messageFingerprint(message: unknown): string {

147153

const msgObj = asRecord(message);

148154

if (!msgObj) {

@@ -572,7 +578,7 @@ export function shouldCapture(

572578

text: string,

573579

options?: { customTriggers?: string[]; maxChars?: number },

574580

): boolean {

575-

const maxChars = options?.maxChars ?? DEFAULT_CAPTURE_MAX_CHARS;

581+

const maxChars = normalizeMaxChars(options?.maxChars, DEFAULT_CAPTURE_MAX_CHARS);

576582

if (text.length > maxChars) {

577583

return false;

578584

}