openhuman icon indicating copy to clipboard operation
openhuman copied to clipboard

feat(about_app): catalog entries for embedding provider selection (#2583 follow-up)

Open justinhsu1477 opened this issue 6 months ago • 2 comments

Closes the explicit follow-up listed in #2583's PR body:

Follow-up: about_app capability catalog entries for embeddings provider selection

#2583 added Settings > AI > Embeddings — users can now pick between managed cloud (Voyage), OpenAI, Cohere, local Ollama, or a custom OpenAI-compatible endpoint, with per-provider API key + model + dimension knobs. The in-app feature catalog (`about_app::catalog`) is how those affordances become discoverable to:

  • Users via Settings search
  • Agents via `openhuman.about_app_capabilities` RPC
  • The Privacy surface via per-capability `privacy` metadata

Without an entry, the new panel is invisible to that whole layer.

What's added

Two capability records under the new `embeddings` domain, slotted into the Intelligence category so they sit alongside `memory_tree_retrieval` / `mcp_server` rather than getting orphaned in a fresh domain bucket.

ID Privacy What it covers
`intelligence.embedding_provider_config` `LOCAL_CREDENTIALS` (`leaves_device = false`) The Settings panel itself — provider selection, API key entry (encrypted local keyring under `embeddings:`), model / dimension knobs.
`intelligence.embedding_provider_test` `DERIVED_TO_BACKEND` (`leaves_device = true`) The "Test Connection" action — fires a small probe at the configured provider before committing it to ingestion.

The privacy split matters: the in-app Privacy surface aggregates per-capability annotations to answer "what leaves my computer when I touch this screen?". Collapsing both into one annotation under-reports the probe-time network call.

Tests

3 new tests added to `src/openhuman/about_app/catalog_tests.rs`, all 23/23 pass:

  • `catalog_includes_additional_user_facing_surfaces` — extended with both new ids.
  • `embedding_provider_capabilities_share_domain_and_category` — pins both to `domain = "embeddings"`, asserts same category, and pins the `how_to` breadcrumbs at "Settings > … > Embeddings" so a UI rename surfaces here.
  • `embedding_provider_capabilities_split_privacy_correctly` — asserts config has `leaves_device == false` and test has `leaves_device == true`. Defends against an accidental consolidation that would flatten the two privacy signals.

Test plan

  • [x] `cargo test --lib about_app` — 23/23 pass (was 20, +3 new).
  • [x] `cargo check --lib` — clean.
  • [x] `cargo test --tests --no-run` — clean (no integration-test fallout, lesson from #2603 where I missed an integration-test fixture).
  • [x] `cargo fmt --check` — clean.

Pure metadata addition — no production-code change beyond two new const records and a regression test trio.

Refs #2583.

Summary by CodeRabbit

  • New Features

    • Added embedding provider configuration with local credential handling.
    • Added an embedding-provider test ("Test Connection") that can reach managed cloud, OpenAI, Cohere, and custom endpoints.
    • Clarified in-app descriptions and guidance under Settings → Embeddings.
  • Tests

    • Added tests validating embedding capability metadata, domain/category alignment, and privacy annotations/destinations.

Review Change Stack

justinhsu1477 avatar May 26 '26 02:05 justinhsu1477

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 47fd4f9d-7fe4-4472-86da-8bd68ffec0c9

📥 Commits

Reviewing files that changed from the base of the PR and between 0812514e9e046c5ae304605288768d4de473a643 and b914a1d15d83299337ead888569d82057ae12f8f.

📒 Files selected for processing (2)
  • src/openhuman/about_app/catalog.rs
  • src/openhuman/about_app/catalog_tests.rs
💤 Files with no reviewable changes (2)
  • src/openhuman/about_app/catalog.rs
  • src/openhuman/about_app/catalog_tests.rs

📝 Walkthrough

Walkthrough

Adds a privacy routing constant and two embedding-provider capabilities: intelligence.embedding_provider_config (LOCAL_CREDENTIALS) and intelligence.embedding_provider_test (probe routed to all configured embedding providers). Tests verify registration, domain/category/how-to text consistency, privacy leaves_device split, and expected probe destinations.

Changes

Embedding Provider Capabilities

Layer / File(s) Summary
Privacy routing constant
src/openhuman/about_app/catalog.rs
Introduces EMBEDDING_PROBE_TO_CONFIGURED_PROVIDER (a CapabilityPrivacy constant enumerating managed and selectable external/custom embedding destinations).
Capability entries for config and test
src/openhuman/about_app/catalog.rs
Adds intelligence.embedding_provider_config (marked LOCAL_CREDENTIALS) and intelligence.embedding_provider_test (marked with the new embedding-probe privacy constant) to CAPABILITIES with domain embeddings, category, and how-to text.
Catalog tests for registration and privacy
src/openhuman/about_app/catalog_tests.rs
Extends expected capability list and adds tests checking both capabilities are registered, share domain/category and how-to references, assert leaves_device split (config=false, test=true), and validate embedding_provider_test privacy destinations include openhuman, openai, cohere, custom endpoints, and meet a minimum count.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Suggested labels

feature, rust-core, working

Poem

🐰 In catalog glades I hop and test,
One keeps keys close, one probes the rest,
Destinations listed, privacy clear,
Tests check each hop with a twitching ear,
A rabbit's stamp of tidy cheer.

🚥 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 clearly and specifically describes the main change: adding catalog entries for embedding provider selection. It accurately reflects the core purpose of the PR.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% 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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

coderabbitai[bot] avatar May 26 '26 02:05 coderabbitai[bot]

@graycyrus heads up — rebased on current `main` (`b914a1d1`) to pick up #2737's `state.reset_for_test()` flake fix that was causing CI to red on the `memory_ingestion_status_*` test. The force-push auto-dismissed your earlier APPROVED — if you have a moment to re-approve, would really appreciate it. Three regression tests still pin the embedding-provider catalog entries and the destinations-list invariant; no behavioural changes from the rebase, just main catch-up.

justinhsu1477 avatar May 27 '26 12:05 justinhsu1477