diff --git a/codex-rs/app-server/src/bespoke_event_handling.rs b/codex-rs/app-server/src/bespoke_event_handling.rs index c81cc2c8f2..27f90bb8ec 100644 --- a/codex-rs/app-server/src/bespoke_event_handling.rs +++ b/codex-rs/app-server/src/bespoke_event_handling.rs @@ -58,9 +58,6 @@ use codex_app_server_protocol::ReasoningSummaryTextDeltaNotification; use codex_app_server_protocol::ReasoningTextDeltaNotification; use codex_app_server_protocol::ServerNotification; use codex_app_server_protocol::ServerRequestPayload; -use codex_app_server_protocol::SkillApprovalDecision as V2SkillApprovalDecision; -use codex_app_server_protocol::SkillRequestApprovalParams; -use codex_app_server_protocol::SkillRequestApprovalResponse; use codex_app_server_protocol::SkillsUpdatedNotification; use codex_app_server_protocol::TerminalInteractionNotification; use codex_app_server_protocol::ThreadItem; @@ -2564,7 +2561,11 @@ mod tests { async fn test_handle_skills_updated_emits_notification_for_v2() -> Result<()> { let (tx, mut rx) = mpsc::channel(CHANNEL_CAPACITY); let outgoing = Arc::new(OutgoingMessageSender::new(tx)); - let outgoing = ThreadScopedOutgoingMessageSender::new(outgoing, vec![ConnectionId(1)]); + let outgoing = ThreadScopedOutgoingMessageSender::new( + outgoing, + vec![ConnectionId(1)], + ThreadId::new(), + ); handle_skills_updated(ApiVersion::V2, &outgoing).await; diff --git a/codex-rs/app-server/src/codex_message_processor.rs b/codex-rs/app-server/src/codex_message_processor.rs index 7f430b7975..bb940f3380 100644 --- a/codex-rs/app-server/src/codex_message_processor.rs +++ b/codex-rs/app-server/src/codex_message_processor.rs @@ -5539,6 +5539,7 @@ impl CodexMessageProcessor { match response { Ok(downloaded) => { + let connection_id = request_id.connection_id; self.thread_manager.skills_manager().clear_cache(); self.outgoing .send_response( @@ -5549,8 +5550,7 @@ impl CodexMessageProcessor { }, ) .await; - Self::send_skills_updated_notification(&self.outgoing, request_id.connection_id) - .await; + Self::send_skills_updated_notification(&self.outgoing, connection_id).await; } Err(err) => { self.send_internal_error( @@ -5576,6 +5576,7 @@ impl CodexMessageProcessor { match result { Ok(()) => { + let connection_id = request_id.connection_id; self.thread_manager.skills_manager().clear_cache(); self.outgoing .send_response( @@ -5585,8 +5586,7 @@ impl CodexMessageProcessor { }, ) .await; - Self::send_skills_updated_notification(&self.outgoing, request_id.connection_id) - .await; + Self::send_skills_updated_notification(&self.outgoing, connection_id).await; } Err(err) => { let error = JSONRPCErrorError {