mirror of
https://github.com/openai/codex.git
synced 2026-11-05 20:10:33 +00:00
Surface interactive requests in realtime conversations (#39113)
## What changed - Mirror execution, permission, and patch approval requests into active realtime conversations with a prompt to review them in the app. - Mirror user-input and elicitation requests with a prompt to respond in the app. - Include the serialized request event so the realtime handoff retains the request details. GitOrigin-RevId: 56fefa70b9ecaaad2fcf83592f20e8b4514a004a
This commit is contained in:
@@ -1736,6 +1736,23 @@ pub(super) fn realtime_text_for_event(msg: &EventMsg) -> Option<(String, Option<
|
||||
TurnItem::AgentMessage(item) => Some((agent_message_text(item), item.phase.clone())),
|
||||
_ => None,
|
||||
},
|
||||
EventMsg::ExecApprovalRequest(_)
|
||||
| EventMsg::RequestPermissions(_)
|
||||
| EventMsg::ApplyPatchApprovalRequest(_)
|
||||
| EventMsg::RequestUserInput(_)
|
||||
| EventMsg::ElicitationRequest(_) => {
|
||||
let message = if matches!(
|
||||
msg,
|
||||
EventMsg::RequestUserInput(_) | EventMsg::ElicitationRequest(_)
|
||||
) {
|
||||
"I need your input. Please respond in the app."
|
||||
} else {
|
||||
"I need your approval to continue. Please review the request in the app."
|
||||
};
|
||||
serde_json::to_string(msg)
|
||||
.ok()
|
||||
.map(|request| (format!("{message}\n\n{request}"), None))
|
||||
}
|
||||
EventMsg::Error(_)
|
||||
| EventMsg::Warning(_)
|
||||
| EventMsg::GuardianWarning(_)
|
||||
@@ -1778,14 +1795,9 @@ pub(super) fn realtime_text_for_event(msg: &EventMsg) -> Option<(String, Option<
|
||||
| EventMsg::ImageGenerationBegin(_)
|
||||
| EventMsg::ImageGenerationEnd(_)
|
||||
| EventMsg::ViewImageToolCall(_)
|
||||
| EventMsg::ExecApprovalRequest(_)
|
||||
| EventMsg::RequestPermissions(_)
|
||||
| EventMsg::RequestUserInput(_)
|
||||
| EventMsg::DynamicToolCallRequest(_)
|
||||
| EventMsg::DynamicToolCallResponse(_)
|
||||
| EventMsg::GuardianAssessment(_)
|
||||
| EventMsg::ElicitationRequest(_)
|
||||
| EventMsg::ApplyPatchApprovalRequest(_)
|
||||
| EventMsg::DeprecationNotice(_)
|
||||
| EventMsg::StreamError(_)
|
||||
| EventMsg::TurnDiff(_)
|
||||
|
||||
Reference in New Issue
Block a user