Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion codex-rs/app-server/src/bespoke_event_handling.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2059,7 +2059,7 @@ async fn maybe_emit_raw_response_item_completed(
.await;
}

async fn maybe_emit_hook_prompt_item_completed(
pub(crate) async fn maybe_emit_hook_prompt_item_completed(
api_version: ApiVersion,
conversation_id: ThreadId,
turn_id: &str,
Expand Down
20 changes: 16 additions & 4 deletions codex-rs/app-server/src/codex_message_processor.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
use crate::bespoke_event_handling::apply_bespoke_event_handling;
use crate::bespoke_event_handling::maybe_emit_hook_prompt_item_completed;
use crate::command_exec::CommandExecManager;
use crate::command_exec::StartCommandExecParams;
use crate::config_api::apply_runtime_feature_enablement;
Expand Down Expand Up @@ -7435,15 +7436,26 @@ impl CodexMessageProcessor {
let subscribed_connection_ids = thread_state_manager
.subscribed_connection_ids(conversation_id)
.await;
if let EventMsg::RawResponseItem(_) = &event.msg && !raw_events_enabled {
continue;
}

let thread_outgoing = ThreadScopedOutgoingMessageSender::new(
outgoing_for_task.clone(),
subscribed_connection_ids,
conversation_id,
);

if let EventMsg::RawResponseItem(raw_response_item_event) = &event.msg
&& !raw_events_enabled
{
maybe_emit_hook_prompt_item_completed(
api_version,
conversation_id,
&event.id,
&raw_response_item_event.item,
&thread_outgoing,
)
.await;
continue;
}

apply_bespoke_event_handling(
event.clone(),
conversation_id,
Expand Down
Loading