From 52ceb92a96a138f66cbb7ddb38347d18bc4eba9c Mon Sep 17 00:00:00 2001 From: Merge Sim Date: Mon, 31 Aug 2026 18:46:13 -0700 Subject: [PATCH] Allow CLAUDE_CONFIG_DIR as a wrapper contract global The wrapper guard permits each agent's per-account home export by name (CODEX_HOME, MIMOCODE_HOME, OPENCODE_CONFIG_DIR); CLAUDE_CONFIG_DIR is the same contract and joins them. Snapshots regenerated after verifying the only content change is the Claude restore line. --- .../__fixtures__/shell-wrapper-snapshots/daemon-zsh-zshenv.txt | 2 ++ .../__fixtures__/shell-wrapper-snapshots/local-bash-rcfile.txt | 2 ++ .../__fixtures__/shell-wrapper-snapshots/local-zsh-zshenv.txt | 2 ++ src/main/shell-wrapper-generated-file-snapshot.test.ts | 1 + 4 files changed, 7 insertions(+) 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 3d3403ad099..78685e1a0d6 100644 --- a/src/main/__fixtures__/shell-wrapper-snapshots/daemon-zsh-zshenv.txt +++ b/src/main/__fixtures__/shell-wrapper-snapshots/daemon-zsh-zshenv.txt @@ -136,6 +136,8 @@ __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: Claude must keep using Orca's runtime config directory after rc files. + [[ -n "${ORCA_CLAUDE_CONFIG_DIR:-}" ]] && export CLAUDE_CONFIG_DIR="${ORCA_CLAUDE_CONFIG_DIR}" # Why: a typed alias expands inside the shell, after pane launch prep. # 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. 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 dc14486cdb7..bedfb9fc3b9 100644 --- a/src/main/__fixtures__/shell-wrapper-snapshots/local-bash-rcfile.txt +++ b/src/main/__fixtures__/shell-wrapper-snapshots/local-bash-rcfile.txt @@ -101,6 +101,8 @@ 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: Claude must keep using Orca's runtime config directory after profile scripts. +[[ -n "${ORCA_CLAUDE_CONFIG_DIR:-}" ]] && export CLAUDE_CONFIG_DIR="${ORCA_CLAUDE_CONFIG_DIR}" # Why: a typed alias expands inside the shell, after pane launch prep. # 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. 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 10e9e144fc0..17a5fab62f1 100644 --- a/src/main/__fixtures__/shell-wrapper-snapshots/local-zsh-zshenv.txt +++ b/src/main/__fixtures__/shell-wrapper-snapshots/local-zsh-zshenv.txt @@ -136,6 +136,8 @@ __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: Claude must keep using Orca's runtime config directory after rc files. + [[ -n "${ORCA_CLAUDE_CONFIG_DIR:-}" ]] && export CLAUDE_CONFIG_DIR="${ORCA_CLAUDE_CONFIG_DIR}" # Why: a typed alias expands inside the shell, after pane launch prep. # 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. diff --git a/src/main/shell-wrapper-generated-file-snapshot.test.ts b/src/main/shell-wrapper-generated-file-snapshot.test.ts index ddbf1537984..f3a2dcd7987 100644 --- a/src/main/shell-wrapper-generated-file-snapshot.test.ts +++ b/src/main/shell-wrapper-generated-file-snapshot.test.ts @@ -67,6 +67,7 @@ async function expectWrapperFiles(transport: string, root: string): Promise