mirror of
https://github.com/openai/codex.git
synced 2026-11-15 21:50:46 +00:00
Merge remote-tracking branch 'origin/main' into dev/python-sdk-goal-turns
# Conflicts: # codex-rs/deny.toml
This commit is contained in:
@@ -2234,6 +2234,12 @@
|
||||
},
|
||||
"status": {
|
||||
"$ref": "#/definitions/McpServerStartupState"
|
||||
},
|
||||
"threadId": {
|
||||
"type": [
|
||||
"string",
|
||||
"null"
|
||||
]
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
|
||||
+6
@@ -11462,6 +11462,12 @@
|
||||
},
|
||||
"status": {
|
||||
"$ref": "#/definitions/v2/McpServerStartupState"
|
||||
},
|
||||
"threadId": {
|
||||
"type": [
|
||||
"string",
|
||||
"null"
|
||||
]
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
|
||||
+6
@@ -7964,6 +7964,12 @@
|
||||
},
|
||||
"status": {
|
||||
"$ref": "#/definitions/McpServerStartupState"
|
||||
},
|
||||
"threadId": {
|
||||
"type": [
|
||||
"string",
|
||||
"null"
|
||||
]
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
|
||||
+6
@@ -23,6 +23,12 @@
|
||||
},
|
||||
"status": {
|
||||
"$ref": "#/definitions/McpServerStartupState"
|
||||
},
|
||||
"threadId": {
|
||||
"type": [
|
||||
"string",
|
||||
"null"
|
||||
]
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
|
||||
+1
-1
@@ -3,4 +3,4 @@
|
||||
// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
|
||||
import type { McpServerStartupState } from "./McpServerStartupState";
|
||||
|
||||
export type McpServerStatusUpdatedNotification = { name: string, status: McpServerStartupState, error: string | null, };
|
||||
export type McpServerStatusUpdatedNotification = { threadId: string | null, name: string, status: McpServerStartupState, error: string | null, };
|
||||
|
||||
@@ -235,6 +235,7 @@ pub enum McpServerStartupState {
|
||||
#[serde(rename_all = "camelCase")]
|
||||
#[ts(export_to = "v2/")]
|
||||
pub struct McpServerStatusUpdatedNotification {
|
||||
pub thread_id: Option<String>,
|
||||
pub name: String,
|
||||
pub status: McpServerStartupState,
|
||||
pub error: Option<String>,
|
||||
|
||||
@@ -2040,6 +2040,33 @@ fn mcp_server_status_serializes_absent_server_info_as_null() {
|
||||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn mcp_server_status_updated_accepts_missing_thread_id() {
|
||||
let notification: McpServerStatusUpdatedNotification = serde_json::from_value(json!({
|
||||
"name": "optional_broken",
|
||||
"status": "failed",
|
||||
"error": "handshake failed",
|
||||
}))
|
||||
.expect("notification without threadId should deserialize");
|
||||
|
||||
let expected = McpServerStatusUpdatedNotification {
|
||||
thread_id: None,
|
||||
name: "optional_broken".to_string(),
|
||||
status: McpServerStartupState::Failed,
|
||||
error: Some("handshake failed".to_string()),
|
||||
};
|
||||
assert_eq!(notification, expected);
|
||||
assert_eq!(
|
||||
serde_json::to_value(notification).expect("notification should serialize"),
|
||||
json!({
|
||||
"threadId": null,
|
||||
"name": "optional_broken",
|
||||
"status": "failed",
|
||||
"error": "handshake failed",
|
||||
})
|
||||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn mcp_server_status_serializes_absent_server_info_metadata_as_null() {
|
||||
let response = ListMcpServerStatusResponse {
|
||||
|
||||
Reference in New Issue
Block a user