From 0c6a8ff4431829597dcd4aa586c9ecdbd0e95cb9 Mon Sep 17 00:00:00 2001 From: chitcommit <208086304+chitcommit@users.noreply.github.com> Date: Wed, 10 Jun 2026 02:13:04 +0000 Subject: [PATCH] fix(intent): mirror 'expired' status predicate in roux_ingest ON CONFLICT MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit PR #115 / migration 0018 added `AND status <> 'expired'` to the partial unique index `cc_intents_roux_ingest_message_id_uidx` but did not update the upsert's ON CONFLICT WHERE clause in createRouxIngestIntentIdempotent. PostgreSQL requires predicate equality to match an index to ON CONFLICT — the mismatch caused the upsert to fail with "no unique or exclusion constraint matching the ON CONFLICT specification", breaking the Roux ingest path. Verified against a fresh Neon branch: - pre-fix: SQLSTATE 42P10 (no matching constraint) - post-fix: ON CONFLICT resolves cleanly to the index Co-Authored-By: Claude Opus 4.7 (1M context) --- meta/intent.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/meta/intent.ts b/meta/intent.ts index 308eb87..4a2ba3a 100644 --- a/meta/intent.ts +++ b/meta/intent.ts @@ -279,6 +279,7 @@ export async function createRouxIngestIntentIdempotent( ON CONFLICT ((payload->'source'->>'message_id')) WHERE intent_type = 'roux_ingest' AND payload->'source'->>'message_id' IS NOT NULL + AND status <> 'expired' DO NOTHING RETURNING *`; if (inserted[0]) {