fix: shared ws_tx across reconnects, spawned workflow task, Arc<ServiceManager>

This commit is contained in:
Fam Zheng 2026-04-06 21:10:32 +01:00
parent 2066a727b0
commit c6c03224b1

View File

@ -62,7 +62,7 @@ async fn connect_and_run(
server_url: &str,
worker_name: &str,
llm_config: &crate::LlmConfig,
svc_mgr: &ServiceManager,
svc_mgr: &Arc<ServiceManager>,
shared_ws_tx: &SharedWsTx,
comment_tx: &Arc<tokio::sync::Mutex<Option<mpsc::Sender<AgentEvent>>>>,
) -> anyhow::Result<()> {
@ -178,7 +178,7 @@ async fn connect_and_run(
let (evt_tx, mut evt_rx) = mpsc::channel::<AgentEvent>(32);
*comment_tx.lock().await = Some(evt_tx);
let svc = svc_mgr.clone();
let svc = Arc::clone(svc_mgr);
let wf_id = workflow_id.clone();
let pid = project_id.clone();
tokio::spawn(async move {