fix(intent): mirror 'expired' predicate in roux_ingest ON CONFLICT - #118
Conversation
…LICT 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>
Deploying with
|
| Status | Name | Latest Commit | Updated (UTC) |
|---|---|---|---|
| ✅ Deployment successful! View logs |
chittycommand | 0c6a8ff | Jun 10 2026, 07:01 AM |
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
|
|
Caution Review failedThe pull request is closed. ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughModified the ChangesRoux Ingest Idempotency
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~3 minutes Possibly related PRs
Poem
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
To use Codex here, create a Codex account and connect to github. |
What
Adds
AND status <> 'expired'to the ON CONFLICT inference predicate increateRouxIngestIntentIdempotent(meta/intent.ts), mirroring the partial unique index.Why
PR #115 (Roux intent decay cron, migration
0018_intent_decay.sql) recreatedcc_intents_roux_ingest_message_id_uidxwith a narrowed predicate:The idempotent-insert path's
ON CONFLICT (...) WHERE ...was not updated to match. Postgres requires the ON CONFLICT inference predicate to exactly match a partial unique index'sWHERE. Without this clause, everycreateRouxIngestIntentIdempotentcall would fail with:i.e. the Roux ingest idempotency path was broken the moment #115 deployed.
Verification
Predicate confirmed against the authoritative migration source
migrations/0018_intent_decay.sql:20-24— the code WHERE now matches the live index WHERE exactly (3 clauses, same order).🤖 Generated with Claude Code
Summary by CodeRabbit