Repository navigation
[MOD-11888] Return descriptive errors from VecSimIndex_ResolveParams - #1051
Merged
Merged
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #1051 +/- ##
==========================================
+ Coverage 97.54% 97.57% +0.03%
==========================================
Files 142 142
Lines 9405 9444 +39
==========================================
+ Hits 9174 9215 +41
+ Misses 231 229 -2 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
2 of 4 tasks
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>
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>
alonre24
force-pushed
the
MOD-11888-vecsim-resolve-params-error-messages
branch
from
October 7, 2026 14:39
d1c3eaa to
c85af41
Compare
Exercise the "only valid for SVS indexes" branches of the SEARCH_WINDOW_SIZE, SEARCH_BUFFER_CAPACITY and USE_SEARCH_HISTORY resolvers from the BF resolver test. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
nonirosenfeldredis
approved these changes
Oct 8, 2026
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 for VecSimIndex_ResolveParams requires all callers to pass the new argument; behavior on success is unchanged and err_msg is optional, but any missed call sites will fail to compile.
Overview
Query-time VecSim parameter resolution now exposes why a runtime param failed, not only a
VecSimResolveCode.VecSimIndex_ResolveParamstakes an optionalconst char **err_msg. On failure, helpers route through newSetResolveErr()(printf into a thread-local 256-byte buffer) instead of returning bare codes. Messages name params viaVecSimCommonStrings::*_STRINGand describe constraints (wrong index type, query type, duplicate param, bad value, unknown param, hybrid policy conflicts).HYBRID_POLICYinvalid values get a clearer message listing expected options.A contributor skill doc (
vecsim-error-messages) documents the pattern; RediSearch still uses canned errors and does not forwarderr_msgyet (follow-up under MOD-11888). Unit tests were updated for the new signature and assert representative error strings;nullptrforerr_msgremains safe.Reviewed by Cursor Bugbot for commit f7572c0. Bugbot is set up for automated code reviews on this repo. Configure here.