Skip to content

fix(multiquery): forward retrieve options to the underlying retriever - #1214

Open
serhiizghama wants to merge 2 commits into
cloudwego:mainfrom
serhiizghama:fix/multiquery-forward-retrieve-options
Open

fix(multiquery): forward retrieve options to the underlying retriever#1214
serhiizghama wants to merge 2 commits into
cloudwego:mainfrom
serhiizghama:fix/multiquery-forward-retrieve-options

Conversation

@serhiizghama

Copy link
Copy Markdown

The multi-query retriever drops any options passed to Retrieve. In multiQueryRetriever.Retrieve each RetrieveTask is built without RetrieveOptions, so WithTopK, WithScoreThreshold, WithEmbedding, WithDSLInfo etc. never reach the underlying retriever — the per-call knobs silently do nothing and you're stuck with whatever defaults the wrapped retriever was constructed with.

The router retriever handles the same fan-out correctly (flow/retriever/router/router.go sets RetrieveOptions: opts on its tasks), so this is just a missed forward on the multiquery path. Fixed by passing opts through, matching the router.

Added a test that calls Retrieve with WithTopK(7) and asserts the underlying retriever actually receives it. go test ./flow/retriever/multiquery/ -race passes; without the one-line change the new test fails.

@CLAassistant

CLAassistant commented Aug 25, 2026

Copy link
Copy Markdown

CLA assistant check
All committers have signed the CLA.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants