mirror of
https://github.com/openai/codex.git
synced 2026-11-27 23:50:52 +00:00
Preserve command approval items through turn interruption (#64349)
## Why The app server could show a command awaiting approval before core had recorded its start. Interrupting the turn or abandoning launch after approval could leave the live command item and saved history out of sync. ## What changed Have core publish the command item before prompting for approval and retain it across approval and sandbox retries until execution takes over. Complete abandoned items as declined when interrupted while awaiting approval, or as failed when interrupted after approval but before launch. Wait for pending approval item writes during shutdown. ## Testing Extend the app-server interrupt test to restart the server and verify that the interrupted turn contains exactly one declined command item with the original approval item ID. GitOrigin-RevId: c9f027fc7096d091dc8cf1936c88aa69d3eed8c1
This commit is contained in:
@@ -1776,13 +1776,9 @@ pub enum EventMsg {
|
||||
}
|
||||
|
||||
impl EventMsg {
|
||||
/// Returns the ID and start time of the command this approval opens.
|
||||
/// Stdin and network reviews have their own prompts for an existing operation.
|
||||
pub fn command_approval_start(&self) -> Option<(&str, i64)> {
|
||||
/// Returns the command item first exposed by a Guardian assessment.
|
||||
pub fn guardian_command_start(&self) -> Option<(&str, i64)> {
|
||||
match self {
|
||||
Self::ExecApprovalRequest(request) if request.starts_command() => {
|
||||
Some((&request.call_id, request.started_at_ms))
|
||||
}
|
||||
Self::GuardianAssessment(assessment)
|
||||
if assessment.status == GuardianAssessmentStatus::InProgress
|
||||
&& matches!(
|
||||
|
||||
Reference in New Issue
Block a user