Conversation
Query-time parameter rejections (EPSILON, EF_RUNTIME, RERANK, hybrid policy, etc.) only ever returned a bare VecSimResolveCode, so callers had no way to explain to users why a specific parameter/value was rejected. Add an optional err_msg out-param that each resolver helper fills with a message describing the actual constraint that failed. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #1051 +/- ##
==========================================
+ Coverage 97.40% 97.52% +0.11%
==========================================
Files 141 141
Lines 8686 9050 +364
==========================================
+ Hits 8461 8826 +365
+ Misses 225 224 -1 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
The previous commit threaded the new err_msg out-param through every existing test call site but always passed nullptr, so nothing actually exercised SetResolveErr()'s message content. Capture it for a representative case per resolver (unknown param, already-set, bad value, invalid policy, hybrid-adhoc interactions) and assert on the exact text. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
EPSILON,EF_RUNTIME,RERANK, hybrid policy) only ever surfaced a bareVecSimResolveCode, giving callers no way to explain why a specific parameter or value was rejected (e.g. the classic "Error parsing vector similarity parameters: Invalid option" with no further detail).VecSimIndex_ResolveParamsgains an optionalconst char **err_msgout-param; each_ResolveParams_*helper now returns through a newSetResolveErr()helper that formats a specific message (e.g."EPSILON is only valid for HNSW or SVS indexes") into a thread-local buffer instead of a bare error code..claude/skills/vecsim-error-messages/SKILL.mddocumenting the pattern for future additions.Index-creation-time error reporting (
VecSimIndex_NewreturningNULLwith no message) was considered under the same ticket but is descoped from this PR.Test plan
test_common,test_bruteforce,test_hnsw,test_svs) updated for the newVecSimIndex_ResolveParamssignature and pass on CIcheck-format.sh/ clang-format cleanVecSim_ResolveQueryParamsto forward these messages into the client-facing error, and update RediSearch's tests accordingly🤖 Generated with Claude Code
Note
Medium Risk
Breaking C API signature change for VecSimIndex_ResolveParams requires all callers to pass the new err_msg argument; query-param validation behavior is unchanged aside from richer optional messages.
Overview
Query-time VecSim parameter resolution now exposes why a runtime param failed, not only a
VecSimResolveCode.VecSimIndex_ResolveParamsgains an optionalconst char **err_msgout-parameter (documented invec_sim.h). Rejection paths invec_sim.cppgo through a newSetResolveErr()helper that formats into a thread-local 256-byte buffer; passingnullptrforerr_msgremains safe. Messages name params viaVecSimCommonStrings::*_STRINGand describe constraints (wrong index type, query type, duplicate param, bad value, unknown param, hybrid policy conflicts). HYBRID_POLICY invalid values now get a message listing expectedbatches/adhoc_bfinstead of a bare code.A
.claude/skills/vecsim-error-messages/SKILL.mdskill documents the pattern for future rejections. Unit tests (test_common,test_bruteforce,test_hnsw,test_svs) pass the new argument and assert specificerr_msgstrings where relevant.Not in this PR: RediSearch still maps resolve codes to canned client errors and does not forward
err_msg(noted as MOD-11888 follow-up).Reviewed by Cursor Bugbot for commit d1c3eaa. Bugbot is set up for automated code reviews on this repo. Configure here.