fix ci (#1739)
I think this commit broke the CI because it changed the
`McpToolCallBeginEvent` type:
347c81ad00
This commit is contained in:
@@ -219,7 +219,7 @@ pub struct ConversationSummary {
|
|||||||
pub enum ServerNotification {
|
pub enum ServerNotification {
|
||||||
InitialState(InitialStateNotificationParams),
|
InitialState(InitialStateNotificationParams),
|
||||||
StreamDisconnected(StreamDisconnectedNotificationParams),
|
StreamDisconnected(StreamDisconnectedNotificationParams),
|
||||||
CodexEvent(CodexEventNotificationParams),
|
CodexEvent(Box<CodexEventNotificationParams>),
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
|
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
|
||||||
@@ -304,6 +304,8 @@ pub enum ClientNotification {
|
|||||||
#[allow(clippy::unwrap_used)]
|
#[allow(clippy::unwrap_used)]
|
||||||
mod tests {
|
mod tests {
|
||||||
use super::*;
|
use super::*;
|
||||||
|
use codex_core::protocol::McpInvocation;
|
||||||
|
use codex_core::protocol::McpToolCallBeginEvent;
|
||||||
use pretty_assertions::assert_eq;
|
use pretty_assertions::assert_eq;
|
||||||
use serde::Serialize;
|
use serde::Serialize;
|
||||||
use serde_json::Value;
|
use serde_json::Value;
|
||||||
@@ -727,7 +729,7 @@ mod tests {
|
|||||||
}),
|
}),
|
||||||
};
|
};
|
||||||
|
|
||||||
let observed = to_val(&ServerNotification::CodexEvent(params));
|
let observed = to_val(&ServerNotification::CodexEvent(Box::new(params)));
|
||||||
let expected = json!({
|
let expected = json!({
|
||||||
"method": "notifications/agent_message",
|
"method": "notifications/agent_message",
|
||||||
"params": {
|
"params": {
|
||||||
@@ -753,7 +755,7 @@ mod tests {
|
|||||||
msg: EventMsg::TaskStarted,
|
msg: EventMsg::TaskStarted,
|
||||||
};
|
};
|
||||||
|
|
||||||
let observed = to_val(&ServerNotification::CodexEvent(params));
|
let observed = to_val(&ServerNotification::CodexEvent(Box::new(params)));
|
||||||
let expected = json!({
|
let expected = json!({
|
||||||
"method": "notifications/task_started",
|
"method": "notifications/task_started",
|
||||||
"params": {
|
"params": {
|
||||||
@@ -776,7 +778,7 @@ mod tests {
|
|||||||
}),
|
}),
|
||||||
};
|
};
|
||||||
|
|
||||||
let observed = to_val(&ServerNotification::CodexEvent(params));
|
let observed = to_val(&ServerNotification::CodexEvent(Box::new(params)));
|
||||||
let expected = json!({
|
let expected = json!({
|
||||||
"method": "notifications/agent_message_delta",
|
"method": "notifications/agent_message_delta",
|
||||||
"params": {
|
"params": {
|
||||||
@@ -800,7 +802,7 @@ mod tests {
|
|||||||
}),
|
}),
|
||||||
};
|
};
|
||||||
|
|
||||||
let observed = to_val(&ServerNotification::CodexEvent(params));
|
let observed = to_val(&ServerNotification::CodexEvent(Box::new(params)));
|
||||||
let expected = json!({
|
let expected = json!({
|
||||||
"method": "notifications/agent_message",
|
"method": "notifications/agent_message",
|
||||||
"params": {
|
"params": {
|
||||||
@@ -823,7 +825,7 @@ mod tests {
|
|||||||
}),
|
}),
|
||||||
};
|
};
|
||||||
|
|
||||||
let observed = to_val(&ServerNotification::CodexEvent(params));
|
let observed = to_val(&ServerNotification::CodexEvent(Box::new(params)));
|
||||||
let expected = json!({
|
let expected = json!({
|
||||||
"method": "notifications/agent_reasoning",
|
"method": "notifications/agent_reasoning",
|
||||||
"params": {
|
"params": {
|
||||||
@@ -847,7 +849,7 @@ mod tests {
|
|||||||
msg: EventMsg::TokenCount(usage),
|
msg: EventMsg::TokenCount(usage),
|
||||||
};
|
};
|
||||||
|
|
||||||
let observed = to_val(&ServerNotification::CodexEvent(params));
|
let observed = to_val(&ServerNotification::CodexEvent(Box::new(params)));
|
||||||
let expected = json!({
|
let expected = json!({
|
||||||
"method": "notifications/token_count",
|
"method": "notifications/token_count",
|
||||||
"params": {
|
"params": {
|
||||||
@@ -881,7 +883,7 @@ mod tests {
|
|||||||
}),
|
}),
|
||||||
};
|
};
|
||||||
|
|
||||||
let observed = to_val(&ServerNotification::CodexEvent(params));
|
let observed = to_val(&ServerNotification::CodexEvent(Box::new(params)));
|
||||||
let expected = json!({
|
let expected = json!({
|
||||||
"method": "notifications/session_configured",
|
"method": "notifications/session_configured",
|
||||||
"params": {
|
"params": {
|
||||||
@@ -909,7 +911,7 @@ mod tests {
|
|||||||
}),
|
}),
|
||||||
};
|
};
|
||||||
|
|
||||||
let observed = to_val(&ServerNotification::CodexEvent(params));
|
let observed = to_val(&ServerNotification::CodexEvent(Box::new(params)));
|
||||||
let expected = json!({
|
let expected = json!({
|
||||||
"method": "notifications/exec_command_begin",
|
"method": "notifications/exec_command_begin",
|
||||||
"params": {
|
"params": {
|
||||||
@@ -928,24 +930,28 @@ mod tests {
|
|||||||
fn serialize_notification_codex_event_mcp_tool_call_begin_full_json() {
|
fn serialize_notification_codex_event_mcp_tool_call_begin_full_json() {
|
||||||
let params = CodexEventNotificationParams {
|
let params = CodexEventNotificationParams {
|
||||||
meta: None,
|
meta: None,
|
||||||
msg: EventMsg::McpToolCallBegin(codex_core::protocol::McpToolCallBeginEvent {
|
msg: EventMsg::McpToolCallBegin(McpToolCallBeginEvent {
|
||||||
call_id: "m1".into(),
|
call_id: "m1".into(),
|
||||||
server: "calc".into(),
|
invocation: McpInvocation {
|
||||||
tool: "add".into(),
|
server: "calc".into(),
|
||||||
arguments: Some(json!({"a":1,"b":2})),
|
tool: "add".into(),
|
||||||
|
arguments: Some(json!({"a":1,"b":2})),
|
||||||
|
},
|
||||||
}),
|
}),
|
||||||
};
|
};
|
||||||
|
|
||||||
let observed = to_val(&ServerNotification::CodexEvent(params));
|
let observed = to_val(&ServerNotification::CodexEvent(Box::new(params)));
|
||||||
let expected = json!({
|
let expected = json!({
|
||||||
"method": "notifications/mcp_tool_call_begin",
|
"method": "notifications/mcp_tool_call_begin",
|
||||||
"params": {
|
"params": {
|
||||||
"msg": {
|
"msg": {
|
||||||
"type": "mcp_tool_call_begin",
|
"type": "mcp_tool_call_begin",
|
||||||
"call_id": "m1",
|
"call_id": "m1",
|
||||||
"server": "calc",
|
"invocation": {
|
||||||
"tool": "add",
|
"server": "calc",
|
||||||
"arguments": { "a": 1, "b": 2 }
|
"tool": "add",
|
||||||
|
"arguments": { "a": 1, "b": 2 }
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@@ -964,7 +970,7 @@ mod tests {
|
|||||||
}),
|
}),
|
||||||
};
|
};
|
||||||
|
|
||||||
let observed = to_val(&ServerNotification::CodexEvent(params));
|
let observed = to_val(&ServerNotification::CodexEvent(Box::new(params)));
|
||||||
let expected = json!({
|
let expected = json!({
|
||||||
"method": "notifications/patch_apply_end",
|
"method": "notifications/patch_apply_end",
|
||||||
"params": {
|
"params": {
|
||||||
|
|||||||
Reference in New Issue
Block a user