feat(search): add Querit provider
Summary
- Add a direct Querit web search integration using
POST https://api.querit.ai/v1/search. - Expose Querit as a selectable search engine alongside Managed, Parallel, and Brave.
- Add Querit API key configuration through search settings, env overrides, and
.env.example. - Register
querit_searchandweb_search_toolwhen Querit is the active configured engine. - Add focused Rust coverage for Querit request shaping, response parsing, missing-key behavior, and tool registration.
Problem
OpenHuman currently supports managed search and several BYO search providers, but not Querit. Users with a Querit API key cannot configure OpenHuman to use Querit for direct web search, including site, time range, country, and language filters.
Solution
This PR adds a Querit integration that follows the official Querit POST API shape and the local querit-web-search skill behavior. The implementation reuses the existing unified search engine settings model by storing Querit credentials under search.querit with the same SearchEngineCredentials structure used by other BYO engines.
Important choices:
- Keep Querit inside
SearchConfiginstead of adding a separate top-level config block. - Preserve existing Tauri command guards and existing search settings update response behavior.
- Accept both Querit-native
count/filtersand OpenHuman-friendly aliases such asmax_results,include_domains,time_range,countries, andlanguages. - Keep i18n changes scoped to adding Querit labels and fallback strings.
Submission Checklist
If a section does not apply to this change, mark the item as
N/Awith a one-line reason. Do not delete items.
- [x] Tests added or updated (happy path + at least one failure / edge case) per Testing Strategy
- [x] Diff coverage ≥ 80% — remote coverage workflow remains the source of truth; focused Rust tests were added and passed locally.
- [x] Coverage matrix updated — N/A: provider integration change, no feature row added/removed/renamed.
- [x] All affected feature IDs from the matrix are listed in the PR description under
## Related— N/A: no matrix feature IDs changed. - [x] No new external network dependencies introduced (mock backend used per Testing Strategy) — tests use a local Axum mock for Querit execution.
- [x] Manual smoke checklist updated if this touches release-cut surfaces — N/A: no release smoke checklist surface changed.
- [x] N/A: Linked issue closed via
Closes #NNNin the## Relatedsection — no issue provided.
Impact
Adds a new optional BYO search provider. Existing managed, Parallel, Brave, Seltz, and SearXNG paths are preserved.
Runtime impact:
- Desktop/Tauri settings UI can select Querit and store a Querit API key.
- Core registers Querit-backed
web_search_toolandquerit_searchonly whensearch.engine = "querit"and a Querit key is configured. - Pure Vite web mode still cannot save search settings because the existing Tauri command guard remains intact.
Security:
- Querit API keys are stored through the existing search settings config path and included in the existing secret encryption/decryption path.
- Search settings read API continues to expose only configured/not-configured booleans.
- Querit upstream error bodies are not logged verbatim.
Related
- Closes: N/A
- Follow-up PR(s)/TODOs: N/A
AI Authored PR Metadata (required for Codex/Linear PRs)
Keep this section for AI-authored PRs. For human-only PRs, mark each field
N/A.
Linear Issue
- Key: N/A
- URL: N/A
Commit & Branch
- Branch:
codex/querit-search - Commit SHA:
94bf886b347189f368b82f3a9d2dadd6669d2ea5
Validation Run
- [x]
pnpm --filter openhuman-app format:check - [x]
pnpm typecheck - [x] Focused tests:
GGML_NATIVE=OFF cargo test --manifest-path Cargo.toml querit --lib - [x] Rust fmt/check (if changed): root cargo fmt check passed via
cargo fmt --manifest-path Cargo.toml --check; focused Rust tests passed. - [x] N/A: Tauri fmt/check (if changed) — Tauri fmt passed; Tauri cargo check blocked locally by missing
cmakeand documented below.
Validation Blocked
command:pnpm rust:check/ pre-push hookcargo check --manifest-path app/src-tauri/Cargo.tomlerror:failed to execute command: No such file or directory (os error 2); is cmake not installed?impact:Local Tauri cargo check could not complete in this environment. Querit core tests, TypeScript typecheck, formatting checks, and manual local RPC smoke validation passed.
Behavior Changes
- Intended behavior change: Users can configure Querit as the active search engine and use Querit for web search.
- User-visible effect: Settings > Search engine shows Querit and a Querit API key editor.
Parity Contract
- Legacy behavior preserved: Existing Managed, Parallel, Brave, Seltz, and SearXNG search behavior remains unchanged.
- Guard/fallback/dispatch parity checks: Querit follows the existing
effective_engine()key-gated fallback pattern; without a Querit key, search falls back to Managed instead of registering unusable tools.
Duplicate / Superseded PR Handling
- Duplicate PR(s): N/A
- Canonical PR: N/A
- Resolution (closed/superseded/updated): N/A
Summary by CodeRabbit
-
New Features
- Added Querit as a selectable web search engine and UI to add/manage its API key.
- Querit can be used as an alternative to existing providers for web search results.
-
Documentation
- Environment example and settings guidance updated to show Querit configuration and optional env vars to enable it.
-
Tests
- UI and backend tests expanded to cover Querit configuration and search behavior.
[!NOTE]
Reviews paused
It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the
reviews.auto_review.auto_pause_after_reviewed_commitssetting.Use the following commands to manage reviews:
@coderabbitai resumeto resume automatic reviews.@coderabbitai reviewto trigger a single review.Use the checkboxes below for quick actions:
- [ ] ▶️ Resume reviews
- [ ] 🔍 Trigger review
📝 Walkthrough
Walkthrough
Adds Querit as a new web search provider across backend (tool, config, RPC), frontend (types, UI), translations, tests, and environment documentation.
Changes
Querit Search Engine Integration
| Layer / File(s) | Summary |
|---|---|
Querit Tool Implementation src/openhuman/integrations/querit.rs |
QueritSearchTool implements the Tool trait, including request/response models, filter normalization, response decoding (wrapped and direct shapes), plain and markdown rendering, HTTP error handling, and unit/e2e tests. |
Configuration Schema & Engine Selection src/openhuman/config/schema/tools.rs, src/openhuman/config/schema/mod.rs |
Adds SEARCH_ENGINE_QUERIT, a querit credentials block in SearchConfig, SearchEngine::Querit variant, default initialization, and effective_engine logic selecting Querit only when an API key is present (with unit test). |
Config Operations & Secrets / Env Overlay src/openhuman/config/ops.rs, src/openhuman/config/schema/load.rs |
Extends SearchSettingsPatch with querit_api_key; updates apply_search_settings and get_search_settings to persist/reflect Querit configuration (empty string clears); integrates querit API key into encrypt/decrypt flows and adds OPENHUMAN_QUERIT_API_KEY/QUERIT_API_KEY env overlay. |
Config Re-exports & RPC Schema src/openhuman/config/mod.rs, src/openhuman/config/schemas.rs |
Re-exports SEARCH_ENGINE_QUERIT; adds querit_api_key to RPC payloads and docs; extends update_search_settings schema and wires querit_api_key into the update handler. |
Tool Registry & RPC Handlers src/openhuman/integrations/mod.rs, src/openhuman/tools/ops.rs, src/openhuman/tools/schemas.rs |
Exports QueritSearchTool, registers Querit in the tool registry (web_search_tool + querit_search), adds tools_querit_search RPC controller, handler, schema, and tests; updates tool registration tests. |
Frontend Types & UI app/src/utils/tauriCommands/config.ts, app/src/components/settings/panels/SearchPanel.tsx |
Adds 'querit' to SearchEngineId, querit_api_key to SearchSettingsUpdate, querit_configured to SearchSettings; extends SearchPanel with Querit engine option, KeyEditor UI, local state, and persistence logic. |
Internationalization Support app/src/lib/i18n/chunks/*, app/src/lib/i18n/en.ts, app/src/lib/i18n/zh-CN.ts |
Adds Querit translation strings (label, description, key label, placeholder) and updates local-managed-unavailable messages across language chunks. |
Environment Configuration .env.example |
Documents Querit configuration and env vars QUERIT_API_KEY / OPENHUMAN_QUERIT_API_KEY and engine selection guidance. |
Estimated code review effort
🎯 4 (Complex) | ⏱️ ~45 minutes
Possibly related PRs
- tinyhumansai/openhuman#2516: Both PRs extend the unified search-engine selector/engine-driven tool registration in the backend;
#2516added thebraveengine while this PR addsquerit. - tinyhumansai/openhuman#2378: Both PRs touch i18n chunks (e.g., German) and localization wiring used by the search settings UI.
Suggested reviewers
- graycyrus
"🐰 I found a tiny key tonight,
Querit hops into the searchlight.
From Rust to UI the strings align,
Keys saved, docs updated—what a find!
Hop—new results take joyous flight."
🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
| Check name | Status | Explanation |
|---|---|---|
| Description Check | ✅ Passed | Check skipped - CodeRabbit’s high-level summary is enabled. |
| Title check | ✅ Passed | The title accurately and concisely describes the main change: adding a new Querit search provider to the system, which is the primary purpose of this pull request. |
| Docstring Coverage | ✅ Passed | Docstring coverage is 97.96% which is sufficient. The required threshold is 80.00%. |
| Linked Issues check | ✅ Passed | Check skipped because no linked issues were found for this pull request. |
| Out of Scope Changes check | ✅ Passed | Check skipped because no linked issues were found for this pull request. |
✏️ Tip: You can configure your own custom pre-merge checks in the settings.
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.
Comment @coderabbitai help to get the list of available commands and usage tips.
@MurphyZzzzz unresolved review feedback — please address before we review.
Unresolved review feedback from coderabbitai[bot] — please address before we review.
I've resolved the merge conflicts and pushed the updated branch. Could you please take another look when you have a chance? @graycyrus @oxoxDev
Code looks great — both security issues are fixed and fully verified by me and oxoxDev. However, the Rust Core Coverage job is failing. That needs to be resolved before I can approve.
Let me know what the coverage issue is and we can get this across the line!
Code looks great — both security issues are fixed and fully verified by me and oxoxDev. However, the Rust Core Coverage job is failing. That needs to be resolved before I can approve.
Let me know what the coverage issue is and we can get this across the line!
This looks like an unrelated flaky Rust test in the coverage job. I reproduced the focused test locally and it passed. Could someone with Actions permissions please re-run the failed job? @graycyrus
Code looks great — both security issues are fixed and fully verified by me and oxoxDev. However, the Rust Core Coverage job is failing. That needs to be resolved before I can approve. Let me know what the coverage issue is and we can get this across the line!
This looks like an unrelated flaky Rust test in the coverage job. I reproduced the focused test locally and it passed. Could someone with Actions permissions please re-run the failed job? @graycyrus
The failing coverage job is not failing because of diff coverage or the Querit changes directly. The command cargo llvm-cov -p openhuman --lcov --output-path lcov-core.info runs the Rust test suite before producing LCOV, and one unrelated Rust unit test failed during that phase:
openhuman::memory_tools::tools::put::tests::execute_success_path_persists_rule_in_isolated_workspace
Failure path:
- The test calls
MemoryToolsPutTool::execute(...)withtool_name = "bash". MemoryToolsPutToolcreates aToolMemoryRuleviaToolMemoryRule::new(...).ToolMemoryRule::new(...)generates a random UUID v4 string forrule.id.ToolMemoryStore::put_rule(...)stores the rule under:- namespace:
tool-bash - key:
rule/<uuid-v4>
- namespace:
- The memory document write path now rejects namespace/key values when
safety::pii::has_likely_pii(...)returns true. - In this CI run, the randomly generated UUID-derived key appears to have matched the PII detector, so the write failed with:
document namespace/key cannot contain personal identifiers
Relevant code path:
src/openhuman/memory_tools/tools/put.rssrc/openhuman/memory_tools/types.rsToolMemoryRule::generate_id()currently usesuuid::Uuid::new_v4().to_string()
src/openhuman/memory_tools/store.rs- stores with
ToolMemoryRule::storage_key(&rule.id)
- stores with
src/openhuman/memory_store/unified/documents.rs- rejects PII-like namespace/key values before persisting
I pulled the latest PR branch locally and ran the focused test:
GGML_NATIVE=OFF cargo test --manifest-path Cargo.toml execute_success_path_persists_rule_in_isolated_workspace --lib -- --nocapture
It passed locally, which supports that this is a randomness-triggered flake rather than a deterministic Querit regression.
I don't have permission to re-run the upstream GitHub Actions job.
This failure looks like CI runner disk exhaustion (No space left on device) rather than a code failure.
Could a maintainer please re-run the failed coverage job?
I don't have permission to re-run the upstream GitHub Actions job. This failure looks like CI runner disk exhaustion (
No space left on device) rather than a code failure. Could a maintainer please re-run the failed coverage job?
yes. i'll watch this and if it passes, will merge. thanks brother
Hi, #2753 has been merged into main last Friday. Do you know when the next release is planned, or which release version this change is expected to be included in? @senamakel @graycyrus