mirror of
https://github.com/openai/codex.git
synced 2026-05-04 13:21:54 +03:00
emit a separate metric when the user cancels UAT during elevated setup (#10399)
Currently this shows up as elevated setup failure, which isn't quite accurate.
This commit is contained in:
@@ -65,6 +65,25 @@ pub fn elevated_setup_failure_details(_err: &anyhow::Error) -> Option<(String, S
|
||||
None
|
||||
}
|
||||
|
||||
#[cfg(target_os = "windows")]
|
||||
pub fn elevated_setup_failure_metric_name(err: &anyhow::Error) -> &'static str {
|
||||
if codex_windows_sandbox::extract_setup_failure(err).is_some_and(|failure| {
|
||||
matches!(
|
||||
failure.code,
|
||||
codex_windows_sandbox::SetupErrorCode::OrchestratorHelperLaunchCanceled
|
||||
)
|
||||
}) {
|
||||
"codex.windows_sandbox.elevated_setup_canceled"
|
||||
} else {
|
||||
"codex.windows_sandbox.elevated_setup_failure"
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(not(target_os = "windows"))]
|
||||
pub fn elevated_setup_failure_metric_name(_err: &anyhow::Error) -> &'static str {
|
||||
panic!("elevated_setup_failure_metric_name is only supported on Windows")
|
||||
}
|
||||
|
||||
#[cfg(target_os = "windows")]
|
||||
pub fn run_elevated_setup(
|
||||
policy: &SandboxPolicy,
|
||||
|
||||
Reference in New Issue
Block a user