Base: codex-main originale (prima del fork aKode)
This commit is contained in:
22
codex-rs/sandboxing/src/windows_mxc.rs
Normal file
22
codex-rs/sandboxing/src/windows_mxc.rs
Normal file
@@ -0,0 +1,22 @@
|
||||
//! Native Windows MXC capability discovery and availability metrics.
|
||||
//! Probing is cached upstream; reporting happens at most once per process.
|
||||
|
||||
use std::sync::atomic::AtomicBool;
|
||||
use std::sync::atomic::Ordering;
|
||||
|
||||
static AVAILABILITY_RECORDED: AtomicBool = AtomicBool::new(false);
|
||||
|
||||
pub(super) fn record_availability_once() {
|
||||
// Probe actual PSEC create/close support; symbol presence alone also
|
||||
// succeeds on transitional Windows builds where MXC is not enabled.
|
||||
let available = codex_mxc_sandbox::is_available();
|
||||
if let Some(metrics) = codex_otel::global()
|
||||
&& !AVAILABILITY_RECORDED.swap(true, Ordering::Relaxed)
|
||||
{
|
||||
let _ = metrics.counter(
|
||||
"codex.windows_mxc.available",
|
||||
/*inc*/ 1,
|
||||
&[("available", if available { "true" } else { "false" })],
|
||||
);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user