fix: update integration tests for v3 search response format
v3 search returns {results: [...]} instead of a bare array.
Updated waitForSearchResults helper and search edge case tests
to unwrap the v3 envelope.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 4.6
parent
78cc11ef1f
commit
b9d7ae5fa7
@@ -92,8 +92,12 @@ export async function waitForSearchResults(
|
||||
maxRetries = 4,
|
||||
): Promise<Memory[]> {
|
||||
for (let attempt = 1; attempt <= maxRetries; attempt++) {
|
||||
const results = await withRetry(() => client.search(query, options));
|
||||
if (Array.isArray(results) && results.length > 0) {
|
||||
const response = await withRetry(() => client.search(query, options));
|
||||
// v3 returns { results: [...] }, unwrap for backward compat
|
||||
const results = Array.isArray(response)
|
||||
? response
|
||||
: (response?.results ?? []);
|
||||
if (results.length > 0) {
|
||||
return results;
|
||||
}
|
||||
if (attempt < maxRetries) {
|
||||
|
||||
Reference in New Issue
Block a user