Merge branch 'main' into feat/n8n-nodes-mem0
This commit is contained in:
@@ -28,7 +28,7 @@ This is a **polyglot monorepo** containing Python and TypeScript packages, CLIs,
|
||||
| `integrations/pi-agent-plugin/` | `@mem0/pi-agent-plugin` — Pi Agent plugin |
|
||||
| `integrations/vercel-ai-sdk/` | `@mem0/vercel-ai-provider` — Vercel AI SDK memory provider |
|
||||
| `integrations/n8n-nodes-mem0/` | `@mem0/n8n-nodes-mem0` — n8n community node; add / search / get / update / delete memories |
|
||||
| `integrations/zapier-mem0/` | `zapier-mem0` — Zapier Platform CLI app (deploys to Zapier, not npm); add / search / get / delete memories |
|
||||
| `integrations/zapier-mem0/` | `@mem0/zapier` — Zapier Platform CLI app (deploys to Zapier, not npm); add / search / get / delete memories |
|
||||
| `server/` | FastAPI REST server for self-hosted Mem0 (Docker: FastAPI + PostgreSQL/pgvector + Neo4j) |
|
||||
| `skills/` | Claude Code skill definitions. Reference skills (SDK knowledge, always-on): `mem0/`, `mem0-cli/`, `mem0-vercel-ai-sdk/`. Pipeline skills (run on demand): `mem0-integrate/`, `mem0-test-integration/`, `mem0-oss-to-platform/` |
|
||||
| `docs/` | Documentation site (Mintlify) |
|
||||
|
||||
@@ -2,8 +2,8 @@ import type { ZObject, Bundle, AddResponse, EventResponse } from '../types';
|
||||
import { captureEvent } from '../telemetry';
|
||||
|
||||
const POLL_INTERVAL_MS = 1500;
|
||||
// Bounded so the poll budget stays under Zapier's per-step execution timeout.
|
||||
const MAX_POLL_ATTEMPTS = 12;
|
||||
// Bounded to a 60s poll budget, under Zapier's per-step execution timeout.
|
||||
const MAX_POLL_ATTEMPTS = 40;
|
||||
|
||||
// Polls GET /v1/event/{id}/ until the async memory-addition event resolves.
|
||||
const pollEvent = async (z: ZObject, eventId: string): Promise<EventResponse> => {
|
||||
|
||||
@@ -58,6 +58,25 @@ describe('add_memory (offline)', () => {
|
||||
expect((res as any).status).toBe('SUCCEEDED');
|
||||
});
|
||||
|
||||
it('keeps polling past the old 12-attempt budget when the API is slow', async () => {
|
||||
jest.useFakeTimers();
|
||||
const pendingPolls = Array.from({ length: 20 }, () => ({ data: { status: 'PENDING' } }));
|
||||
const z = makeZ([
|
||||
{ data: { event_id: 'e1', status: 'PENDING' } },
|
||||
...pendingPolls,
|
||||
{ data: { status: 'SUCCEEDED', results: [{ id: 'm1' }] } },
|
||||
]);
|
||||
const resultPromise = addMemory.operation.perform(z, {
|
||||
inputData: { content: 'hi', user_id: 'u1', waitForCompletion: 'true' },
|
||||
} as any);
|
||||
for (let i = 0; i < pendingPolls.length; i++) {
|
||||
await jest.advanceTimersByTimeAsync(1500);
|
||||
}
|
||||
const res = await resultPromise;
|
||||
expect((res as any).status).toBe('SUCCEEDED');
|
||||
jest.useRealTimers();
|
||||
});
|
||||
|
||||
it('throws a clear error on invalid JSON metadata', async () => {
|
||||
const z = makeZ();
|
||||
await expect(
|
||||
|
||||
Reference in New Issue
Block a user