Repository navigation
feat(agent): add Querit Python search tool - #2
Merged
Merged
Conversation
ethan7zhanghx
pushed a commit
that referenced
this pull request
Aug 7, 2026
…17937) Collapses three duplicated/dead code smells in the canvas debug-result path of `internal/ingestion/task` (remaining findings #2/#3/#4 from the package CTO review): - **#2 — vector-key stripping duplication.** `isVectorKey` (the full stripper: fixed legacy keys `vector`/`embedding`/`feature`/`q_vec` plus the `q_<dim>_vec` pattern) was re-implemented as a weaker inline copy in the golden-compare tool (`tool/compare_pipeline_golden.go`) that only matched `q_<dim>_vec` and let real vectors leak into the diff. Exported as `IsVectorKey` and reused by the tool. - **#3 — near-duplicate deep copy.** `deepCopy` and `deepCopyStrip` were identical walkers differing only in vector stripping. Parameterized `deepCopy(v any, stripVector bool) any` and deleted `deepCopyStrip`. - **#4 — redundant switch.** `lookupComponentOutput` had two switch cases with identical bodies (both the `map[string]map[string]any` and `map[string]any` state shapes). Unified into a single `found`/`ok` resolution; nested-state and flat-fallback semantics unchanged.
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
Add the Python Canvas tool implementation for Querit Search. This PR is limited to the Python runtime and its unit tests; it does not expose the frontend node or add the Go runtime implementation.
Request contract
queryquerycountcount10, minimum1chunks_per_docchunksPerDoc3, accepts1–3, omitted whenNonesite_includefilters.sites.includesite_excludefilters.sites.excludetime_rangefilters.timeRange.datecountry_includefilters.geo.countries.includelanguage_includefilters.languages.includeThe tool calls
POST https://api.querit.ai/v1/searchwith Bearer authentication. A node-levelapi_keytakes precedence, withQUERIT_API_KEYas the fallback. Empty filters are omitted.Response and error behavior
results.result[]usingtitle,url, andsnippet.formalized_content.json, including unknown fields and large integersearch_idvalues.429/500/502/503/504up to three total attempts.401,403, or other non-retryable HTTP errors._ERRORoutput and redacts the active API key from errors and logs.Tests
uv run --group test pytest test/unit_test/agent/tools/test_querit_unit.py -q— 23 passeduv run --group test pytest test/unit_test/agent/tools/test_querit_unit.py test/unit_test/agent/tools/test_http_timeout.py -q— 48 passeduv tool run ruff check agent/tools/querit.py test/unit_test/agent/tools/test_querit_unit.py— passeduv tool run ruff format --check agent/tools/querit.py test/unit_test/agent/tools/test_querit_unit.py— 2 files already formattedgit diff --cached --check— passed before commitAll API tests use mocks and do not require or access a real Querit API key.