feat(grpc): proper tool result relay via tokio::select
session_chat_via_orchestrator now: - Spawns generation on a background task - Reads in_stream for client tool results in foreground - Forwards results to orchestrator.submit_tool_result() - Uses tokio::select! to handle both concurrently - Uses GenerateRequest + Metadata (no transport types in orchestrator) - Calls grpc::bridge (not orchestrator::grpc_bridge)
This commit is contained in:
@@ -307,6 +307,13 @@ async fn main() -> anyhow::Result<()> {
|
||||
if config.grpc.is_some() {
|
||||
let orchestrator_id = state.conversation_registry.get_agent_id().await
|
||||
.unwrap_or_default();
|
||||
let orch = Arc::new(orchestrator::Orchestrator::new(
|
||||
config.clone(),
|
||||
state.responder.tools(),
|
||||
state.mistral.clone(),
|
||||
state.conversation_registry.clone(),
|
||||
system_prompt_text.clone(),
|
||||
));
|
||||
let grpc_state = std::sync::Arc::new(grpc::GrpcState {
|
||||
config: config.clone(),
|
||||
tools: state.responder.tools(),
|
||||
@@ -315,6 +322,7 @@ async fn main() -> anyhow::Result<()> {
|
||||
matrix: matrix_client.clone(),
|
||||
system_prompt: system_prompt_text.clone(),
|
||||
orchestrator_agent_id: orchestrator_id,
|
||||
orchestrator: Some(orch),
|
||||
});
|
||||
tokio::spawn(async move {
|
||||
if let Err(e) = grpc::start_server(grpc_state).await {
|
||||
|
||||
Reference in New Issue
Block a user