Changing method in MCP notifications (#1684)

- Changing the codex/event type
This commit is contained in:
aibrahim-oai
2025-07-26 10:35:49 -07:00
committed by GitHub
parent c66c99c5b5
commit 5a0079fea2
3 changed files with 50 additions and 12 deletions

View File

@@ -83,11 +83,26 @@ impl OutgoingMessageSender {
let params = Some(serde_json::to_value(event).expect("Event must serialize"));
let outgoing_message = OutgoingMessage::Notification(OutgoingNotification {
method: "codex/event".to_string(),
params: params.clone(),
});
let _ = self.sender.send(outgoing_message).await;
self.send_event_as_notification_new_schema(event, params)
.await;
}
// should be backwards compatible.
// it will replace send_event_as_notification eventually.
async fn send_event_as_notification_new_schema(
&self,
event: &Event,
params: Option<serde_json::Value>,
) {
let outgoing_message = OutgoingMessage::Notification(OutgoingNotification {
method: event.msg.to_string(),
params,
});
let _ = self.sender.send(outgoing_message).await;
}
pub(crate) async fn send_error(&self, id: RequestId, error: JSONRPCErrorError) {
let outgoing_message = OutgoingMessage::Error(OutgoingError { id, error });
let _ = self.sender.send(outgoing_message).await;