From 49919702271a4d3affc568867ba3d0bf5bc555af Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Mon, 2 Feb 2026 06:05:01 +0000 Subject: [PATCH 1/2] Initial plan From 7e48ad3945f64879887cb318cbb59412931bd791 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Mon, 2 Feb 2026 06:29:57 +0000 Subject: [PATCH 2/2] Fix Redis driver to throw error on duplicate ID creation Co-authored-by: hotlong <50353452+hotlong@users.noreply.github.com> --- packages/drivers/redis/src/index.ts | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/packages/drivers/redis/src/index.ts b/packages/drivers/redis/src/index.ts index 954e5583..e1c1fc11 100644 --- a/packages/drivers/redis/src/index.ts +++ b/packages/drivers/redis/src/index.ts @@ -394,7 +394,13 @@ export class RedisDriver implements Driver { }; const key = this.generateRedisKey(objectName, id); - await this.client.set(key, JSON.stringify(doc)); + + // Use SET with NX option to prevent overwriting existing records + const result = await this.client.set(key, JSON.stringify(doc), { NX: true }); + + if (!result) { + throw new Error(`Record with ID ${id} already exists in ${objectName}`); + } return doc; }