🤯 LobeHub - Super-Agents on Your Team. Add super-agents to the chats your team already uses.They take on work by themselves and get better every week.
TypeScript agentagent-collaborationagent-harnessloop-engineeringmcppersonal-assistantproactive-agentskillssuper-agenttask-management
🐛 fix: support Serverless indices without internal UUIDs (#19381)
YuTengjing2d481065b58a
diff --git a/apps/server/src/services/ftsSearch/elasticsearch.test.ts b/apps/server/src/services/ftsSearch/elasticsearch.test.tsindex e8f352d09f8..39a6a33d5ba 100644--- a/apps/server/src/services/ftsSearch/elasticsearch.test.ts+++ b/apps/server/src/services/ftsSearch/elasticsearch.test.ts@@ -604,6 +604,35 @@ describe('ElasticsearchFtsSearchHttpClient', () => {});});+ it('allows sync when Serverless omits the internal index UUID', async () => {+ const index = identityIndex('agents', 'unused', { schema_fingerprint: undefined });+ const { uuid: _uuid, ...settings } = index.settings.index;+ vi.stubGlobal(+ 'fetch',+ vi+ .fn()+ .mockImplementation(async (url: URL) =>+ Response.json(+ url.pathname.startsWith('/_alias/')+ ? { 'lobehub-agents-v1': { aliases: { 'lobehub-agents': {} } } }+ : { 'lobehub-agents-v1': { ...index, settings: { index: settings } } },+ ),+ ),+ );+ const client = new ElasticsearchFtsSearchHttpClient({+ apiKey: 'test-api-key',+ indexNamespace: 'lobehub',+ url: 'https://search.example.com',+ });++ await expect(client.assertFtsSearchSyncAliases(['lobehub-agents'])).resolves.toBeUndefined();+ await expect(client.getFtsSearchSyncIndexIdentities(['lobehub-agents'])).resolves.toMatchObject(+ {+ 'lobehub-agents': { indexUuid: null, schemaFingerprint: null, schemaVersion: 1 },+ },+ );+ });+it('rejects a runtime identity response with missing reindex metadata', async () => {vi.stubGlobal('fetch',diff --git a/apps/server/src/services/ftsSearch/elasticsearch.ts b/apps/server/src/services/ftsSearch/elasticsearch.tsindex 26c2848aad6..ae613a5c7e0 100644--- a/apps/server/src/services/ftsSearch/elasticsearch.ts+++ b/apps/server/src/services/ftsSearch/elasticsearch.ts@@ -97,7 +97,9 @@ const indexIdentityResponseSchema = z.record(index: z.object({analysis: z.record(z.string(), z.unknown()),- uuid: z.string().trim().min(1),+ // Serverless omits internal settings; sync still validates the stamped generation below.+ // https://www.elastic.co/docs/reference/elasticsearch/index-settings/serverless+ uuid: z.string().trim().min(1).optional(),}).passthrough(),}),@@ -126,7 +128,8 @@ export interface ElasticsearchFtsSearchHttpClientOptions {}export interface ElasticsearchFtsSearchSyncIndexIdentity {- indexUuid: string;+ /** Null when the deployment does not expose its internal index UUID. */+ indexUuid: string | null;mappingSha256: string;physicalIndex: string;reindexRunId: string;@@ -584,7 +587,7 @@ export class ElasticsearchFtsSearchHttpClient implements ElasticsearchFtsSearchC}identities.set(alias, {- indexUuid: index.settings.index.uuid,+ indexUuid: index.settings.index.uuid ?? null,mappingSha256: sha256Json(index.mappings),physicalIndex,reindexRunId: index.mappings._meta.reindex_run_id,