From 09754b91f85cc0418ab9bb5363fbc9da4b9fc565 Mon Sep 17 00:00:00 2001 From: rrader2890 Date: Thu, 2 Jul 2026 11:37:45 -0400 Subject: [PATCH] fix(consent): cap consent lookup limit at 500 (engine max) findActiveConsent listed memories with limit:1000, but the engine rejects any limit > 500 (querystring/limit must be <= 500), so every consent op (optOut/optIn/getStatus) hard-failed. Use 500, the max allowed. Co-Authored-By: Claude Opus 4.8 (1M context) --- src/resources/consent.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/resources/consent.ts b/src/resources/consent.ts index 94a5b61..5a53d66 100644 --- a/src/resources/consent.ts +++ b/src/resources/consent.ts @@ -175,7 +175,9 @@ export class ConsentResource { subject: ConsentSubject, options?: RequestOptions, ): Promise { - const all = await this.listMemories({ limit: 1000 }, options) + // The engine caps `limit` at 500 (querystring/limit must be <= 500); + // 1000 hard-fails every consent lookup. + const all = await this.listMemories({ limit: 500 }, options) const matches = all .filter((m) => m.type === MemoryItemType.CONSENT && this.subjectMatches(m, subject)) .sort((a, b) => new Date(b.created).getTime() - new Date(a.created).getTime())