mirror of
https://github.com/openai/codex.git
synced 2026-04-24 14:45:27 +00:00
fix app-server shutdown cleanup and schema fixtures
This commit is contained in:
@@ -649,6 +649,12 @@
|
||||
"call_id": {
|
||||
"type": "string"
|
||||
},
|
||||
"name": {
|
||||
"type": [
|
||||
"string",
|
||||
"null"
|
||||
]
|
||||
},
|
||||
"output": {
|
||||
"$ref": "#/definitions/FunctionCallOutputBody"
|
||||
},
|
||||
|
||||
@@ -607,6 +607,12 @@
|
||||
"call_id": {
|
||||
"type": "string"
|
||||
},
|
||||
"name": {
|
||||
"type": [
|
||||
"string",
|
||||
"null"
|
||||
]
|
||||
},
|
||||
"output": {
|
||||
"$ref": "#/definitions/FunctionCallOutputBody"
|
||||
},
|
||||
|
||||
@@ -680,6 +680,12 @@
|
||||
"call_id": {
|
||||
"type": "string"
|
||||
},
|
||||
"name": {
|
||||
"type": [
|
||||
"string",
|
||||
"null"
|
||||
]
|
||||
},
|
||||
"output": {
|
||||
"$ref": "#/definitions/FunctionCallOutputBody"
|
||||
},
|
||||
|
||||
@@ -2276,6 +2276,12 @@
|
||||
"call_id": {
|
||||
"type": "string"
|
||||
},
|
||||
"name": {
|
||||
"type": [
|
||||
"string",
|
||||
"null"
|
||||
]
|
||||
},
|
||||
"output": {
|
||||
"$ref": "#/definitions/FunctionCallOutputBody"
|
||||
},
|
||||
|
||||
@@ -421,6 +421,10 @@ impl CodexMessageProcessor {
|
||||
self.thread_state_manager.clone()
|
||||
}
|
||||
|
||||
pub(crate) fn clear_runtime_references(&self) {
|
||||
self.thread_manager.set_delegated_model_transport(None);
|
||||
}
|
||||
|
||||
pub(crate) fn clear_plugin_related_caches(&self) {
|
||||
self.thread_manager.plugins_manager().clear_cache();
|
||||
self.thread_manager.skills_manager().clear_cache();
|
||||
|
||||
@@ -279,6 +279,7 @@ impl MessageProcessor {
|
||||
}
|
||||
|
||||
pub(crate) fn clear_runtime_references(&self) {
|
||||
self.codex_message_processor.clear_runtime_references();
|
||||
self.auth_manager.clear_external_auth_refresher();
|
||||
}
|
||||
|
||||
|
||||
@@ -744,11 +744,14 @@ async fn command_exec_process_ids_are_connection_scoped_and_disconnect_terminate
|
||||
)
|
||||
.await?;
|
||||
|
||||
let delta = read_command_exec_delta_ws(&mut ws1).await?;
|
||||
assert_eq!(delta.process_id, "shared-process");
|
||||
assert_eq!(delta.stream, CommandExecOutputStream::Stdout);
|
||||
let delta_text = String::from_utf8(STANDARD.decode(&delta.delta_base64)?)?;
|
||||
assert!(delta_text.contains("ready"));
|
||||
let stdout = read_command_exec_output_ws_until_contains(
|
||||
&mut ws1,
|
||||
"shared-process",
|
||||
CommandExecOutputStream::Stdout,
|
||||
"ready",
|
||||
)
|
||||
.await?;
|
||||
assert!(stdout.contains("ready"));
|
||||
wait_for_process_marker(&marker, true).await?;
|
||||
|
||||
send_request(
|
||||
@@ -839,6 +842,37 @@ async fn read_command_exec_delta_ws(
|
||||
}
|
||||
}
|
||||
|
||||
async fn read_command_exec_output_ws_until_contains(
|
||||
stream: &mut super::connection_handling_websocket::WsClient,
|
||||
process_id: &str,
|
||||
expected_stream: CommandExecOutputStream,
|
||||
expected: &str,
|
||||
) -> Result<String> {
|
||||
let deadline = Instant::now() + DEFAULT_READ_TIMEOUT;
|
||||
let mut collected = String::new();
|
||||
|
||||
loop {
|
||||
let remaining = deadline.saturating_duration_since(Instant::now());
|
||||
let delta = timeout(remaining, read_command_exec_delta_ws(stream))
|
||||
.await
|
||||
.with_context(|| {
|
||||
format!(
|
||||
"timed out waiting for {expected:?} in websocket command/exec output for {process_id}; collected {collected:?}"
|
||||
)
|
||||
})??;
|
||||
assert_eq!(delta.process_id, process_id);
|
||||
if delta.stream != expected_stream {
|
||||
continue;
|
||||
}
|
||||
|
||||
let delta_text = String::from_utf8(STANDARD.decode(&delta.delta_base64)?)?;
|
||||
collected.push_str(&delta_text.replace('\r', ""));
|
||||
if collected.contains(expected) {
|
||||
return Ok(collected);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
fn decode_delta_notification(
|
||||
notification: JSONRPCNotification,
|
||||
) -> Result<CommandExecOutputDeltaNotification> {
|
||||
|
||||
Reference in New Issue
Block a user