This commit is contained in:
Ahmed Ibrahim
2025-08-11 00:11:30 -07:00
parent c6cfdf705c
commit 3b90ca959b
5 changed files with 9 additions and 15 deletions

View File

@@ -8,16 +8,16 @@ use codex_core::protocol::AgentMessageEvent;
use codex_core::protocol::ApplyPatchApprovalRequestEvent;
use codex_core::protocol::Event;
use codex_core::protocol::EventMsg;
use codex_core::protocol::InputItem;
use codex_core::protocol::Op;
use codex_core::protocol::ExecApprovalRequestEvent;
use codex_core::protocol::FileChange;
use codex_core::protocol::InputItem;
use codex_core::protocol::Op;
use mcp_types::RequestId;
use tokio::sync::Mutex;
// no streaming watch channel; streaming is toggled via set_streaming on the struct
use tokio_util::sync::CancellationToken;
use tracing::error;
use uuid::Uuid;
use tokio_util::sync::CancellationToken;
use crate::exec_approval::handle_exec_approval_request;
use crate::mcp_protocol::CodexEventNotificationParams;
@@ -98,10 +98,7 @@ impl Conversation {
items: Vec<InputItem>,
) -> CodexResult<()> {
let _ = request_id; // request_id is not used to enforce uniqueness; Codex generates ids.
self.codex
.submit(Op::UserInput { items })
.await
.map(|_| ())
self.codex.submit(Op::UserInput { items }).await.map(|_| ())
}
async fn handle_event(&self, event: Event) {

View File

@@ -23,8 +23,8 @@ mod json_to_toml;
pub mod mcp_protocol;
pub(crate) mod message_processor;
mod outgoing_message;
mod request_id;
mod patch_approval;
mod request_id;
pub(crate) mod tool_handlers;
use crate::message_processor::MessageProcessor;

View File

@@ -678,10 +678,7 @@ impl MessageProcessor {
}
};
if let Err(e) = codex_arc
.submit(codex_core::protocol::Op::Interrupt)
.await
{
if let Err(e) = codex_arc.submit(codex_core::protocol::Op::Interrupt).await {
tracing::error!("Failed to submit interrupt to Codex: {e}");
return;
}

View File

@@ -62,7 +62,9 @@ pub(crate) async fn handle_send_message(
.send_response_with_optional_error(
id,
Some(ToolCallResponseResult::ConversationSendMessage(
ConversationSendMessageResult::Error { message: e.to_string() },
ConversationSendMessageResult::Error {
message: e.to_string(),
},
)),
Some(true),
)

View File

@@ -148,5 +148,3 @@ async fn shell_command_interruption() -> anyhow::Result<()> {
);
Ok(())
}