test: tighten memory tool debug assertions · openclaw/openclaw@e588ead
shakkernerd
·
2026-05-11
·
via Recent Commits to openclaw:main
File tree
extensions/memory-core/src
| Original file line number | Diff line number | Diff line change |
|---|
@@ -113,19 +113,24 @@ describe("memory_search unavailable payloads", () => {
|
113 | 113 | agentSessionKey: "agent:main:main:active-memory:debug", |
114 | 114 | }); |
115 | 115 | const result = await tool.execute("debug", { query: "favorite food" }); |
116 | | -expect(result.details).toMatchObject({ |
117 | | -mode: "query", |
118 | | -debug: { |
119 | | -backend: "qmd", |
120 | | -configuredMode: "search", |
121 | | -effectiveMode: "query", |
122 | | -fallback: "unsupported-search-flags", |
123 | | -hits: 1, |
124 | | -}, |
125 | | -}); |
126 | | -expect( |
127 | | -(result.details as { debug?: { searchMs?: number } }).debug?.searchMs, |
128 | | -).toBeGreaterThanOrEqual(0); |
| 116 | +const details = result.details as { |
| 117 | +mode?: unknown; |
| 118 | +debug?: { |
| 119 | +backend?: unknown; |
| 120 | +configuredMode?: unknown; |
| 121 | +effectiveMode?: unknown; |
| 122 | +fallback?: unknown; |
| 123 | +hits?: unknown; |
| 124 | +searchMs?: number; |
| 125 | +}; |
| 126 | +}; |
| 127 | +expect(details.mode).toBe("query"); |
| 128 | +expect(details.debug?.backend).toBe("qmd"); |
| 129 | +expect(details.debug?.configuredMode).toBe("search"); |
| 130 | +expect(details.debug?.effectiveMode).toBe("query"); |
| 131 | +expect(details.debug?.fallback).toBe("unsupported-search-flags"); |
| 132 | +expect(details.debug?.hits).toBe(1); |
| 133 | +expect(details.debug?.searchMs).toBeGreaterThanOrEqual(0); |
129 | 134 | }); |
130 | 135 | }); |
131 | 136 | |
|
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。