Skip to content

Commit e858de1

Browse files
chitcommitclaude
andauthored
fix(intent): mirror 'expired' status predicate in roux_ingest ON CONFLICT (#117)
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) <noreply@anthropic.com>
1 parent 16db06f commit e858de1

1 file changed

Lines changed: 1 addition & 0 deletions

File tree

meta/intent.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -279,6 +279,7 @@ export async function createRouxIngestIntentIdempotent(
279279
ON CONFLICT ((payload->'source'->>'message_id'))
280280
WHERE intent_type = 'roux_ingest'
281281
AND payload->'source'->>'message_id' IS NOT NULL
282+
AND status <> 'expired'
282283
DO NOTHING
283284
RETURNING *`;
284285
if (inserted[0]) {

0 commit comments

Comments
 (0)