Wire --context flag through to query expansion#628
Open
n0vakovic wants to merge 1 commit into
Open
Conversation
The --context flag was parsed by parseCLI() but never assigned to the opts object passed downstream, so qmd query --context "..." accepted the flag silently with zero effect on query expansion or HyDE. Adds the missing one-line wiring inside the opts literal in parseCLI().
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.
The
--contextflag is parsed byparseCLI()(declared in theparseArgsoptions block) but never assigned to theoptsobject passed downstream. As a result,qmd query --context "..."accepts the flag silently and has zero effect on query expansion or the HyDE prompt —expandQueryStructured(query, true, opts.context)always receivesundefined.This patch adds the missing one-line wiring inside the
optsliteral inparseCLI():Verification
Smoke-tested on Bun 1.3.13 against a local collection:
--context: HyDE expansion is generic ("psychological description of fear and anxiety…").--context "in the Joe Hudson AoA podcast, fear and anxiety often refer to vulnerability, what wants to be felt, or unprocessed grief": HyDE expansion is corpus-aware ("In the Joe Hudson AoA podcast, fear and anxiety are often discussed in the context of…"), top result shifts, downstream rerank ordering changes meaningfully.Notes
--contextis omitted (values.contextisundefined, threads through asundefined, no-op inexpandQueryStructured).intentparameter,--no-expandPR feat: add --no-expand flag to qmd query #622) suggested the maintainer is iterating in this area — happy to rebase if needed.