mirror of
https://github.com/openai/codex.git
synced 2026-12-06 01:10:58 +00:00
Resume queued prompts after blocked submit hook
This commit is contained in:
@@ -27,6 +27,7 @@ use codex_protocol::protocol::HookRunStatus;
|
||||
use codex_protocol::protocol::HookRunSummary;
|
||||
use codex_protocol::protocol::HookSource;
|
||||
use codex_protocol::protocol::HookStartedEvent;
|
||||
use codex_protocol::protocol::UserPromptSubmitStoppedEvent;
|
||||
use codex_protocol::user_input::UserInput;
|
||||
use serde_json::Value;
|
||||
|
||||
@@ -269,13 +270,23 @@ pub(crate) async fn run_user_prompt_submit_hooks(
|
||||
};
|
||||
let hooks = sess.hooks();
|
||||
let preview_runs = hooks.preview_user_prompt_submit(&request);
|
||||
run_context_injecting_hook(
|
||||
let outcome = run_context_injecting_hook(
|
||||
sess,
|
||||
turn_context,
|
||||
preview_runs,
|
||||
hooks.run_user_prompt_submit(request),
|
||||
)
|
||||
.await
|
||||
.await;
|
||||
if outcome.should_stop {
|
||||
sess.send_event(
|
||||
turn_context,
|
||||
EventMsg::UserPromptSubmitStopped(UserPromptSubmitStoppedEvent {
|
||||
turn_id: turn_context.sub_id.clone(),
|
||||
}),
|
||||
)
|
||||
.await;
|
||||
}
|
||||
outcome
|
||||
}
|
||||
|
||||
pub(crate) async fn inspect_pending_input(
|
||||
|
||||
@@ -1490,6 +1490,7 @@ pub(super) fn realtime_text_for_event(msg: &EventMsg) -> Option<String> {
|
||||
| EventMsg::ItemStarted(_)
|
||||
| EventMsg::HookStarted(_)
|
||||
| EventMsg::HookCompleted(_)
|
||||
| EventMsg::UserPromptSubmitStopped(_)
|
||||
| EventMsg::AgentMessageContentDelta(_)
|
||||
| EventMsg::PlanDelta(_)
|
||||
| EventMsg::ReasoningContentDelta(_)
|
||||
|
||||
Reference in New Issue
Block a user