mirror of
https://github.com/openai/codex.git
synced 2026-11-13 06:45:07 +00:00
## What changed - Add the `codex-windows-sandbox-service` workspace crate and Windows-only build target. - Integrate `CodexSandboxService` with the Windows Service Control Manager, including start, stop, shutdown, status reporting, and event-log handling. - Support service mode by default and a debug-only `--foreground` mode. Keep provisioning IPC disabled until authenticated request handling is available. ## Testing - Add argument-parsing tests for service, foreground, unknown, and multiple arguments. GitOrigin-RevId: 1c84f0a593b65e5cf97ab7606cde03675542b0b0
31 lines
595 B
Rust
31 lines
595 B
Rust
use anyhow::Result;
|
|
|
|
#[cfg(windows)]
|
|
mod ipc;
|
|
#[cfg(windows)]
|
|
mod service;
|
|
|
|
#[derive(Clone, Copy, Debug, Eq, PartialEq)]
|
|
pub enum RunMode {
|
|
Service,
|
|
#[cfg(debug_assertions)]
|
|
Foreground,
|
|
}
|
|
|
|
pub fn run(mode: RunMode) -> Result<()> {
|
|
#[cfg(windows)]
|
|
{
|
|
match mode {
|
|
RunMode::Service => service::run(),
|
|
#[cfg(debug_assertions)]
|
|
RunMode::Foreground => service::run_foreground(),
|
|
}
|
|
}
|
|
|
|
#[cfg(not(windows))]
|
|
{
|
|
let _ = mode;
|
|
anyhow::bail!("the Codex sandbox service is only available on Windows")
|
|
}
|
|
}
|