Index: codex-rs/arg0/src/lib.rs
--- codex-rs/arg0/src/lib.rs.orig
+++ codex-rs/arg0/src/lib.rs
@@ -194,6 +194,9 @@ where
             let runtime = build_runtime()?;
             runtime.block_on(run_main_with_arg0_guard(
                 path_entry_guard,
+                #[cfg(target_os = "openbsd")]
+                Some(PathBuf::from("${PREFIX}/bin/codex")),
+                #[cfg(not(target_os = "openbsd"))]
                 current_exe,
                 main_fn,
             ))
@@ -348,6 +351,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)]
@@ -394,7 +400,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")]
             {
