Skip to content

Fix content recommender SQL parameter binding - #5

Closed
cursor[bot] wants to merge 1 commit into
mainfrom
cursor/critical-correctness-bugs-0d5c
Closed

Fix content recommender SQL parameter binding#5
cursor[bot] wants to merge 1 commit into
mainfrom
cursor/critical-correctness-bugs-0d5c

Conversation

@cursor

@cursor cursor Bot commented May 18, 2026

Copy link
Copy Markdown

Summary

  • Fix pgvector recommendation queries so SQL placeholders receive parameters in the correct order.
  • Add regression tests for content recommendations with and without excluded recipe IDs.

Validation

  • python3 -m pytest tests/test_recommend.py (apps/ml-service)
  • python3 -m pytest (apps/ml-service)

Bug and impact

Trained users hitting the ML /recommend endpoint could trigger a database error because content-based recommendation queries sent the LIMIT value where the second %s::vector placeholder expected the preference vector, breaking personalized recommendations.

Root cause

The parameter list was initialized with both the preference vector and limit, then appended the order-by vector and limit again, creating too many parameters and misaligning the placeholders.

Open in Web View Automation 

Co-authored-by: Vasanth Panuganti <vpanuga2@asu.edu>
@vasanthpanuganti
vasanthpanuganti deleted the cursor/critical-correctness-bugs-0d5c branch June 11, 2026 05:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants