Repository navigation
Add LocalAgentService gRPC: proto, daemon handler, Tauri proxy (closes #1137) - #1160
Merged
Merged
Conversation
…#1137) Moves the local agent (ReAct loop + llama.cpp inference) from the Tauri process into nodespaced so sessions survive UI restarts and GPU resources are managed by the daemon. - proto/local_agent_service.proto: StartSession, SendMessage (streaming), GetStatus, CancelGeneration, EndSession, GetSessions, EnsureModelReady (streaming), ListModels - LocalAgentServiceImpl in daemon: wraps LocalAgentService + CompositeModelManager; Arc<inner> pattern keeps handler Clone for tonic - LocalAgentServiceServer registered in nodespaced (headless + tray paths) - GrpcClient gains LocalAgentServiceClient; in-process server registers LocalAgentServiceServer alongside existing services - commands/local_agent.rs rewritten as thin gRPC proxy; no direct packages/agent imports for session/inference logic remain - ManagedAgentState removed from Tauri app state and graceful shutdown - chat_models::chat_model_unload simplified (no longer resets agent state) - tests.rs: removed ManagedAgentState shutdown tests (moved to daemon) Co-Authored-By: Claude <[email protected]>
…onal client - Filter StreamingChunk::Done in on_chunk callback to prevent double "done" event (agent loop emits Done + we emit our own with token counts from result) - Check active_model_id (in-memory) instead of catalog Loaded status for GGUF "already loaded" fast path — catalog persists across restarts but engine doesn't - Move model_manager.load() to after spawn_blocking succeeds so catalog only reflects Loaded when llama.cpp context is actually live - Handle Loaded catalog status as fall-through to re-load path (daemon restart case) - Return LocalAgentServiceClient directly from local_agent_client() instead of Option — it is always present, unlike embeddings_client - Fix GgufModelManager init to use expect() instead of warn + panic Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
malibio
added a commit
that referenced
this pull request
May 31, 2026
LocalAgentServiceServer was accidentally dropped in ea8849a (PR #1161, Add SettingsService) when the diff removed it while adding SettingsService. This caused ListModels, EnsureModelReady, StartSession, and all other LocalAgent RPCs to return Unimplemented for 13 days. Also clones node_service before ImportServiceImpl::new() consumes it, matching the original pattern from PR #1160. Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
malibio
added a commit
that referenced
this pull request
Jun 22, 2026
…#1137) (#1160) * Add LocalAgentService gRPC: proto, daemon handler, Tauri proxy (closes #1137) Moves the local agent (ReAct loop + llama.cpp inference) from the Tauri process into nodespaced so sessions survive UI restarts and GPU resources are managed by the daemon. - proto/local_agent_service.proto: StartSession, SendMessage (streaming), GetStatus, CancelGeneration, EndSession, GetSessions, EnsureModelReady (streaming), ListModels - LocalAgentServiceImpl in daemon: wraps LocalAgentService + CompositeModelManager; Arc<inner> pattern keeps handler Clone for tonic - LocalAgentServiceServer registered in nodespaced (headless + tray paths) - GrpcClient gains LocalAgentServiceClient; in-process server registers LocalAgentServiceServer alongside existing services - commands/local_agent.rs rewritten as thin gRPC proxy; no direct packages/agent imports for session/inference logic remain - ManagedAgentState removed from Tauri app state and graceful shutdown - chat_models::chat_model_unload simplified (no longer resets agent state) - tests.rs: removed ManagedAgentState shutdown tests (moved to daemon) Co-Authored-By: Claude <[email protected]> * Fix review issues: double-done chunk, GGUF stale-status bug, non-Optional client - Filter StreamingChunk::Done in on_chunk callback to prevent double "done" event (agent loop emits Done + we emit our own with token counts from result) - Check active_model_id (in-memory) instead of catalog Loaded status for GGUF "already loaded" fast path — catalog persists across restarts but engine doesn't - Move model_manager.load() to after spawn_blocking succeeds so catalog only reflects Loaded when llama.cpp context is actually live - Handle Loaded catalog status as fall-through to re-load path (daemon restart case) - Return LocalAgentServiceClient directly from local_agent_client() instead of Option — it is always present, unlike embeddings_client - Fix GgufModelManager init to use expect() instead of warn + panic Co-Authored-By: Claude Sonnet 4.6 <[email protected]> --------- Co-authored-by: Michael Libio <[email protected]> Co-authored-by: Claude <[email protected]>
malibio
added a commit
that referenced
this pull request
Jun 22, 2026
LocalAgentServiceServer was accidentally dropped in b88096c (PR #1161, Add SettingsService) when the diff removed it while adding SettingsService. This caused ListModels, EnsureModelReady, StartSession, and all other LocalAgent RPCs to return Unimplemented for 13 days. Also clones node_service before ImportServiceImpl::new() consumes it, matching the original pattern from PR #1160. Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
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
local_agent_service.protowith 8 RPCs (StartSession, SendMessage, GetStatus, CancelGeneration, EndSession, GetSessions, EnsureModelReady, ListModels)LocalAgentServiceImplinnodespaceddaemon — ownsLocalAgentService+CompositeModelManager, no longer in the Tauri processcommands/local_agent.rswith a thin gRPC proxy that forwards streaming chunks as Tauri events (local-agent://chunk,local-agent://tool,model://status, etc.)ManagedAgentStatefrom Tauri managed state;CompositeModelManageris retained only forchat_models.rslocal_agent_client()accessor toGrpcClientand registersLocalAgentServiceServeron the in-process serverArchitecture notes
LocalAgentServiceImplusesArc<Inner>+#[derive(Clone)]pattern (same asAgentSessionHandler) to satisfy tonic's Clone bound without cloning non-Clone stateget_service()clones theArc<AgentService>out of theRwLockbefore any.await, avoidingRwLockReadGuardacross await pointsTest plan
cargo buildpasses for bothnodespace-daemonandnodespace-desktop-appbun run quality:fixclean🤖 Generated with Claude Code