Repository navigation
Description
Overview
Define the EmbeddingsService protobuf service, implement the handler in nodespaced, and migrate commands/embeddings.rs in the Tauri app to a thin gRPC proxy.
Problem Statement
commands/embeddings.rs currently calls NodeEmbeddingService and EmbeddingProcessor directly via AppServices in the Tauri process. Under ADR-031, all services move to nodespaced. The GPU lifecycle complexity (release_gpu_context, drain-then-replace protocol on shutdown) must be managed in the daemon, not the Tauri process. Without this migration, embeddings and semantic search are unavailable when the UI window is closed.
Proposed Solution
Define EmbeddingsService in the nodespace proto, implement the handler in nodespaced wrapping the existing NodeEmbeddingService and EmbeddingProcessor, and replace AppServices calls in commands/embeddings.rs with gRPC client calls.
Technical Specifications
Proto addition (packages/daemon/proto/nodespace.proto)
service EmbeddingsService {
rpc GetEmbeddingStatus(GetEmbeddingStatusRequest) returns (EmbeddingStatusResponse);
rpc SearchSemantic(SearchSemanticRequest) returns (SearchSemanticResponse);
rpc RegenerateEmbedding(RegenerateEmbeddingRequest) returns (RegenerateEmbeddingResponse);
}Reference Files
packages/desktop-app/src-tauri/src/commands/embeddings.rs— current implementation to migratepackages/desktop-app/src-tauri/src/app_services.rs—EmbeddingStatestruct to remove once migratedpackages/daemon/src/main.rs— registerEmbeddingsServicealongsideNodeServicepackages/daemon/src/services/node_service.rs— follow this pattern for new handler
Implementation Details
packages/daemon/src/services/embeddings_service.rs— new handler wrappingNodeEmbeddingServiceandEmbeddingProcessor- GPU drain protocol (
release_gpu_context) handled on daemon shutdown, not Tauri shutdown EmbeddingsServiceClientinitialized in Tauri startup alongsideNodeServiceClient(pattern from Migrate Tauri command handlers to thin gRPC proxy wrappers #1113)EmbeddingStateremoved fromAppServicesonce migration complete
Acceptance Criteria
-
EmbeddingsServiceproto defined and compiled via tonic-build - nodespaced handler implemented; GPU drain protocol handled on daemon shutdown
-
commands/embeddings.rscalls nodespaced via gRPC; no directpackages/coreimports remain - Semantic search works end-to-end: Tauri UI → gRPC → nodespaced → response
- Embedding generation continues when Tauri window is closed
-
EmbeddingStateremoved fromAppServices -
cargo buildsucceeds -
bun run test:allpasses -
bun run quality:fixpasses
Dependencies
Related Issues
- Migrate Tauri command handlers to thin gRPC proxy wrappers #1113 (establishes gRPC client pattern in Tauri)
- Implement WatchNodes gRPC streaming to replace Tauri event system for UI reactivity #1114 (streaming pattern reference)
Activity
WIP: gRPC proxy migration for #1113 — Phases 2-4 of 5 complete
malibio commentedon May 18, 2026
Frontend baseline: 128 files, 3918 tests passed
Add EmbeddingsService gRPC: proto, daemon handler, Tauri proxy (closes …
Add EmbeddingsService gRPC: proto, daemon handler, Tauri proxy (closes …