From 7734c15a7573b6806706f373fdb40d4afa49fca5 Mon Sep 17 00:00:00 2001 From: Neil <4138956+nwparker@users.noreply.github.com> Date: Fri, 21 Aug 2026 23:29:50 -0700 Subject: [PATCH] test(pty): refresh shell wrapper snapshots for the codex alias-safe wrapper Regenerated fixtures still carried the pre-alias command -v codex snippet, so the file-snapshot test failed in CI. --- .../shell-wrapper-snapshots/daemon-bash-rcfile.txt | 9 +++++++-- .../shell-wrapper-snapshots/daemon-zsh-zshenv.txt | 9 +++++++-- .../shell-wrapper-snapshots/local-bash-rcfile.txt | 9 +++++++-- .../shell-wrapper-snapshots/local-zsh-zshenv.txt | 9 +++++++-- 4 files changed, 28 insertions(+), 8 deletions(-) diff --git a/src/main/__fixtures__/shell-wrapper-snapshots/daemon-bash-rcfile.txt b/src/main/__fixtures__/shell-wrapper-snapshots/daemon-bash-rcfile.txt index 03453cb33d3..d5fe9e9a153 100644 --- a/src/main/__fixtures__/shell-wrapper-snapshots/daemon-bash-rcfile.txt +++ b/src/main/__fixtures__/shell-wrapper-snapshots/daemon-bash-rcfile.txt @@ -65,9 +65,14 @@ fi # Why: Codex must keep using Orca's runtime CODEX_HOME after profile scripts. [[ -n "${ORCA_CODEX_HOME:-}" ]] && export CODEX_HOME="${ORCA_CODEX_HOME}" # Why: a typed alias expands inside the shell, after pane launch prep. -__orca_codex_binary="$(command -v codex 2>/dev/null || :)" +# Why unalias inside the substitution: an alias named codex makes command -v +# report the alias text, and the subshell leaves the user's own alias intact. +# Why the trailing || : — zsh, unlike bash, inherits errexit into substitutions. +__orca_codex_binary="$(unalias codex 2>/dev/null || :; command -v codex 2>/dev/null || :)" if [[ -n "${ORCA_CODEX_LAUNCH_PREFLIGHT:-}" && -n "${__orca_codex_binary:-}" && -x "${__orca_codex_binary}" ]]; then - codex() { + # Why the function reserved word: it suppresses alias expansion of the name, + # which otherwise rewrites this header at parse time and aborts the whole file. + function codex { "${ORCA_CODEX_LAUNCH_PREFLIGHT}" agent hooks prepare-codex >/dev/null 2>&1 || : command codex "$@" } diff --git a/src/main/__fixtures__/shell-wrapper-snapshots/daemon-zsh-zshenv.txt b/src/main/__fixtures__/shell-wrapper-snapshots/daemon-zsh-zshenv.txt index 1b89c740f2b..dc44746ad74 100644 --- a/src/main/__fixtures__/shell-wrapper-snapshots/daemon-zsh-zshenv.txt +++ b/src/main/__fixtures__/shell-wrapper-snapshots/daemon-zsh-zshenv.txt @@ -103,9 +103,14 @@ __orca_deferred_init() { # Why: Codex must keep using Orca's runtime CODEX_HOME after rc files. [[ -n "${ORCA_CODEX_HOME:-}" ]] && export CODEX_HOME="${ORCA_CODEX_HOME}" # Why: a typed alias expands inside the shell, after pane launch prep. - __orca_codex_binary="$(command -v codex 2>/dev/null || :)" + # Why unalias inside the substitution: an alias named codex makes command -v + # report the alias text, and the subshell leaves the user's own alias intact. + # Why the trailing || : — zsh, unlike bash, inherits errexit into substitutions. + __orca_codex_binary="$(unalias codex 2>/dev/null || :; command -v codex 2>/dev/null || :)" if [[ -n "${ORCA_CODEX_LAUNCH_PREFLIGHT:-}" && -n "${__orca_codex_binary:-}" && -x "${__orca_codex_binary}" ]]; then - codex() { + # Why the function reserved word: it suppresses alias expansion of the name, + # which otherwise rewrites this header at parse time and aborts the whole file. + function codex { "${ORCA_CODEX_LAUNCH_PREFLIGHT}" agent hooks prepare-codex >/dev/null 2>&1 || : command codex "$@" } diff --git a/src/main/__fixtures__/shell-wrapper-snapshots/local-bash-rcfile.txt b/src/main/__fixtures__/shell-wrapper-snapshots/local-bash-rcfile.txt index 3041e85391d..d203217598f 100644 --- a/src/main/__fixtures__/shell-wrapper-snapshots/local-bash-rcfile.txt +++ b/src/main/__fixtures__/shell-wrapper-snapshots/local-bash-rcfile.txt @@ -68,9 +68,14 @@ fi # Why: Codex must keep using Orca's runtime CODEX_HOME after profile scripts. [[ -n "${ORCA_CODEX_HOME:-}" ]] && export CODEX_HOME="${ORCA_CODEX_HOME}" # Why: a typed alias expands inside the shell, after pane launch prep. -__orca_codex_binary="$(command -v codex 2>/dev/null || :)" +# Why unalias inside the substitution: an alias named codex makes command -v +# report the alias text, and the subshell leaves the user's own alias intact. +# Why the trailing || : — zsh, unlike bash, inherits errexit into substitutions. +__orca_codex_binary="$(unalias codex 2>/dev/null || :; command -v codex 2>/dev/null || :)" if [[ -n "${ORCA_CODEX_LAUNCH_PREFLIGHT:-}" && -n "${__orca_codex_binary:-}" && -x "${__orca_codex_binary}" ]]; then - codex() { + # Why the function reserved word: it suppresses alias expansion of the name, + # which otherwise rewrites this header at parse time and aborts the whole file. + function codex { "${ORCA_CODEX_LAUNCH_PREFLIGHT}" agent hooks prepare-codex >/dev/null 2>&1 || : command codex "$@" } diff --git a/src/main/__fixtures__/shell-wrapper-snapshots/local-zsh-zshenv.txt b/src/main/__fixtures__/shell-wrapper-snapshots/local-zsh-zshenv.txt index d73f2d4c4c9..05321e97fa9 100644 --- a/src/main/__fixtures__/shell-wrapper-snapshots/local-zsh-zshenv.txt +++ b/src/main/__fixtures__/shell-wrapper-snapshots/local-zsh-zshenv.txt @@ -103,9 +103,14 @@ __orca_deferred_init() { # Why: Codex must keep using Orca's runtime CODEX_HOME after rc files. [[ -n "${ORCA_CODEX_HOME:-}" ]] && export CODEX_HOME="${ORCA_CODEX_HOME}" # Why: a typed alias expands inside the shell, after pane launch prep. - __orca_codex_binary="$(command -v codex 2>/dev/null || :)" + # Why unalias inside the substitution: an alias named codex makes command -v + # report the alias text, and the subshell leaves the user's own alias intact. + # Why the trailing || : — zsh, unlike bash, inherits errexit into substitutions. + __orca_codex_binary="$(unalias codex 2>/dev/null || :; command -v codex 2>/dev/null || :)" if [[ -n "${ORCA_CODEX_LAUNCH_PREFLIGHT:-}" && -n "${__orca_codex_binary:-}" && -x "${__orca_codex_binary}" ]]; then - codex() { + # Why the function reserved word: it suppresses alias expansion of the name, + # which otherwise rewrites this header at parse time and aborts the whole file. + function codex { "${ORCA_CODEX_LAUNCH_PREFLIGHT}" agent hooks prepare-codex >/dev/null 2>&1 || : command codex "$@" }