mirror of
https://github.com/openai/codex.git
synced 2026-11-27 23:31:09 +00:00
Record the launched app-server executable identity in PID files (#43552)
## Why An installer can retarget the selected executable symlink or junction while an app server is running. Recording the launch-time identity preserves which binary was started after that path changes. ## What changed - Resolve the executable path before launching on all platforms and store an optional executable identity in app-server PID records. Continue accepting older records without this field and expose the identity only for an active process. - Use BLAKE3 for executable identity digests and make `ExecutableIdentity` serializable. - Schedule updater checks with an explicit deadline in `tokio::select!`, preserving persisted update intervals, settings-error retries, and termination handling. ## Testing Add a Unix test that verifies the recorded identity matches the resolved launch binary, differs from a retargeted symlink's binary, and remains optional when reading legacy PID records. GitOrigin-RevId: 4821130b9a5e75b417a8e39c583b30427a872ff8
This commit is contained in:
1 parent
b7ad941b1f
commit
769a6a5bcd
10 files changed
+123
-94
No files matched your search
@@ -8,8 +8,8 @@ use std::time::Duration;
|
||||
use anyhow::Context;
|
||||
use anyhow::Result;
|
||||
use anyhow::anyhow;
|
||||
use sha2::Digest;
|
||||
use sha2::Sha256;
|
||||
use serde::Deserialize;
|
||||
use serde::Serialize;
|
||||
use tokio::fs;
|
||||
use tokio::process::Command;
|
||||
use tokio::time::timeout;
|
||||
@@ -127,7 +127,7 @@ pub(crate) async fn managed_codex_version(codex_bin: &Path) -> Result<String> {
|
||||
parse_codex_version(&stdout)
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, PartialEq, Eq)]
|
||||
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
|
||||
pub(crate) struct ExecutableIdentity {
|
||||
digest: [u8; 32],
|
||||
}
|
||||
@@ -141,7 +141,7 @@ pub(crate) async fn executable_identity(executable: &Path) -> Result<ExecutableI
|
||||
|
||||
pub(crate) fn executable_identity_from_bytes(bytes: &[u8]) -> ExecutableIdentity {
|
||||
ExecutableIdentity {
|
||||
digest: Sha256::digest(bytes).into(),
|
||||
digest: *blake3::hash(bytes).as_bytes(),
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user