Garry's Opinionated OpenClaw/Hermes Agent Brain
TypeScript
large pages #6722: Postgres twin of the size-gate recovery test expects keyword chunks; receipts test uses the allowlisted fake key
garrytane15bd15287c7
diff --git a/test/e2e/import-embed-skip-recovery.test.ts b/test/e2e/import-embed-skip-recovery.test.tsindex c6e1345de6..4fd00e6a98 100644--- a/test/e2e/import-embed-skip-recovery.test.ts+++ b/test/e2e/import-embed-skip-recovery.test.ts@@ -11,14 +11,15 @@ suite('local import size-gate recovery on Postgres', () => {beforeAll(async () => { engine = await setupDB(); });afterAll(async () => { await teardownDB(); });- test('unchanged source rebuilds chunks after a threshold increase and removes them after a decrease', async () => {+ test('unchanged source re-imports across threshold changes; an embed_skip page keeps keyword chunks without vectors (#6722)', async () => {const slug = 'test/size-gate-threshold';const content = '---\ntitle: Garden planning\ntype: note\n---\n\n' + 'Useful garden planning observations. '.repeat(100);await engine.setConfig('content_sanity.bytes_block', '1000');try {await importFromContent(engine, slug, content, { noEmbed: true, remote: false });expect(isEmbedSkipped((await engine.getPage(slug))!.frontmatter)).toBe(true);- expect(await engine.getChunks(slug)).toHaveLength(0);+ expect((await engine.getChunks(slug)).length).toBeGreaterThan(0);+ expect((await engine.getChunks(slug)).every(c => c.embedding == null)).toBe(true);await engine.setConfig('content_sanity.bytes_block', '10000');expect((await importFromContent(engine, slug, content, { noEmbed: true, remote: false })).status).toBe('imported');expect(isEmbedSkipped((await engine.getPage(slug))!.frontmatter)).toBe(false);@@ -26,7 +27,8 @@ suite('local import size-gate recovery on Postgres', () => {expect((await importFromContent(engine, slug, content, { noEmbed: true, remote: false })).status).toBe('skipped');await engine.setConfig('content_sanity.bytes_block', '1000');expect((await importFromContent(engine, slug, content, { noEmbed: true, remote: false })).status).toBe('imported');- expect(await engine.getChunks(slug)).toHaveLength(0);+ expect(isEmbedSkipped((await engine.getPage(slug))!.frontmatter)).toBe(true);+ expect((await engine.getChunks(slug)).length).toBeGreaterThan(0);} finally {await engine.unsetConfig('content_sanity.bytes_block');}diff --git a/test/size-state-receipts-6722.test.ts b/test/size-state-receipts-6722.test.tsindex d437db9b0f..a4cd37d46a 100644--- a/test/size-state-receipts-6722.test.ts+++ b/test/size-state-receipts-6722.test.ts@@ -46,7 +46,7 @@ beforeAll(async () => {engine = new PGLiteEngine();await engine.connect({});await engine.initSchema();- configureGateway({ embedding_model: MODEL, embedding_dimensions: DIMS, env: { OPENAI_API_KEY: 'synthetic-6722-fixture' } });+ configureGateway({ embedding_model: MODEL, embedding_dimensions: DIMS, env: { OPENAI_API_KEY: 'sk-test-fake' } });__setEmbedTransportForTests((async (input: { values: string[] }) => {providerTexts += input.values.length;return { embeddings: input.values.map(() => new Array(DIMS).fill(0.001)), usage: { tokens: input.values.length * 4 } };