Revert "fix(app-server): set originator header from initialize JSON-RPC request" (#8986)

Reverts openai/codex#8873
This commit is contained in:
jif-oai
2026-01-09 17:00:53 +00:00
committed by GitHub
parent 46b0c4acbb
commit 5c380d5b1e
15 changed files with 27 additions and 294 deletions

View File

@@ -66,8 +66,6 @@ pub struct McpProcess {
pending_messages: VecDeque<JSONRPCMessage>,
}
pub const DEFAULT_CLIENT_NAME: &str = "codex-app-server-tests";
impl McpProcess {
pub async fn new(codex_home: &Path) -> anyhow::Result<Self> {
Self::new_with_env(codex_home, &[]).await
@@ -140,7 +138,7 @@ impl McpProcess {
pub async fn initialize(&mut self) -> anyhow::Result<()> {
let params = Some(serde_json::to_value(InitializeParams {
client_info: ClientInfo {
name: DEFAULT_CLIENT_NAME.to_string(),
name: "codex-app-server-tests".to_string(),
title: None,
version: "0.1.0".to_string(),
},
@@ -165,38 +163,6 @@ impl McpProcess {
Ok(())
}
/// Sends initialize with the provided client info and returns the response/error message.
pub async fn initialize_with_client_info(
&mut self,
client_info: ClientInfo,
) -> anyhow::Result<JSONRPCMessage> {
let params = Some(serde_json::to_value(InitializeParams { client_info })?);
let request_id = self.send_request("initialize", params).await?;
let request_id = RequestId::Integer(request_id);
loop {
let message = self.read_jsonrpc_message().await?;
match message {
JSONRPCMessage::Notification(notification) => {
self.enqueue_user_message(notification);
}
JSONRPCMessage::Response(response) => {
if response.id == request_id {
return Ok(JSONRPCMessage::Response(response));
}
}
JSONRPCMessage::Error(error) => {
if error.id == request_id {
return Ok(JSONRPCMessage::Error(error));
}
}
JSONRPCMessage::Request(_) => {
anyhow::bail!("unexpected JSONRPCMessage::Request: {message:?}");
}
}
}
}
/// Send a `newConversation` JSON-RPC request.
pub async fn send_new_conversation_request(
&mut self,