Index: codex-rs/arg0/src/lib.rs
--- codex-rs/arg0/src/lib.rs.orig
+++ codex-rs/arg0/src/lib.rs
@@ -186,6 +186,9 @@ where
     // async entry-point.
     let runtime = build_runtime()?;
     runtime.block_on(async move {
+        #[cfg(target_os = "openbsd")]
+        let current_exe = Some(PathBuf::from("${PREFIX}/bin/codex"));
+        #[cfg(not(target_os = "openbsd"))]
         let current_exe = std::env::current_exe().ok();
         let paths = Arg0DispatchPaths {
             codex_self_exe: current_exe.clone(),
@@ -319,6 +322,9 @@ pub fn prepend_path_entry_for_codex_aliases() -> std::
         #[cfg(unix)]
         EXECVE_WRAPPER_ARG0,
     ] {
+        #[cfg(target_os = "openbsd")]
+        let exe = PathBuf::from("${PREFIX}/bin/codex");
+        #[cfg(not(target_os = "openbsd"))]
         let exe = std::env::current_exe()?;
 
         #[cfg(unix)]
@@ -365,7 +371,16 @@ pub fn prepend_path_entry_for_codex_aliases() -> std::
     }
 
     let paths = Arg0DispatchPaths {
-        codex_self_exe: std::env::current_exe().ok(),
+        codex_self_exe: {
+            #[cfg(target_os = "openbsd")]
+            {
+                Some(PathBuf::from("${PREFIX}/bin/codex"))
+            }
+            #[cfg(not(target_os = "openbsd"))]
+            {
+                std::env::current_exe().ok()
+            }
+        },
         codex_linux_sandbox_exe: {
             #[cfg(target_os = "linux")]
             {
