Skip to content

refactor(shell): build every zsh startup wrapper from one shared builder - #15245

Merged
nwparker merged 2 commits into
mainfrom
nwparker/zsh-wrapper-shared-builder
Aug 18, 2026
Merged

nwparker merged 2 commits into
mainfrom
nwparker/zsh-wrapper-shared-builder

Conversation

@nwparker

@nwparker nwparker commented Aug 18, 2026 •

Copy link
Copy Markdown
Contributor
Files Added Deleted Net
Test 1 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​89 0 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​89
Prod 24 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​2181 $\color{#cf222e}{\Huge{\mathbf{−}}}$​242 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​1939

ELI5

Orca writes little zsh startup files so a shell it launches behaves normally and tells Orca when it's ready. There were three near-identical copies of that code (local terminals, the daemon/SSH path, and the relay), and they had quietly drifted apart. This PR folds them into one builder. The files it writes out are exactly the same bytes as before — nothing about how your shell starts changes.

What Changed

This is a pure refactor. No behavior change.

  • New src/main/zsh-startup-wrapper-builder.ts: buildZshStartupWrapperFiles(spec) returns the .zshenv / .zprofile / .zshrc / .zlogin contents, parameterised by ZshStartupWrapperSpec.
  • All three call sites now use it, each owning its own spec:
    • src/main/providers/local-pty-shell-ready-wrapper-generation.ts (local PTY)
    • src/main/daemon/daemon-zsh-shell-ready-wrapper-spec.ts + src/main/daemon/shell-ready.ts (daemon / SSH host) — the old daemon-zsh-shell-ready-rcfile.ts is renamed to the spec module
    • src/relay/pty-shell-overlay-wrappers.ts (relay overlay)
  • src/main/shell-templates.ts: getZshEnvTemplate now takes a full header label instead of a prefix, and the relay's .zshenv moved in beside it as getZshOverlayEnvTemplate.
  • New snapshot test + fixtures pinning every generated file for every transport.

Not in this PR (deliberately): no feature-selection channel, no change to which panes get wrapped, no change to ORCA_SHELL_COMMAND_MARKERS or any other gate, no fix for the stacked-ZDOTDIR issue.

Why

A follow-up needs to gate individual wrapper features (history restore, OSC 133 command markers, the shell-ready marker, startup identity, overlay restores) independently and per pane. Doing that against three drifted generators is how the previous attempt (#15197) shipped a new regression in each of three review rounds — a fix landed in one transport and silently missed the other two. Unify first with zero behavior change, gate second. That also makes this half separately revertable from the risky half.

Byte-identity proof

The generated text is unchanged byte for byte for every configuration each of the three call sites can produce. This was proven, not asserted:

  1. On unmodified origin/main, src/main/shell-wrapper-generated-file-snapshot.test.ts was written and run. It drives the real entry points (ensureShellReadyWrappersAt, the daemon's getShellReadyLaunchConfig with ORCA_USER_DATA_PATH pointed at a temp dir, and ensureOverlayRestoreWrappers), reads the files back off disk, and snapshots them. That produced 17 fixtures: .zshenv / .zprofile / .zshrc / .zlogin / bash/rcfile for each of local, daemon and relay, plus the fish --init-command text for local and daemon. Only the temp wrapper root is normalized (<WRAPPER_ROOT>), because that is the sole path-dependent byte in the output.
  2. Those fixtures were committed first, in da44b375a89, whose tree is origin/main source + the test. sha256 of every fixture was recorded at that point.
  3. The refactor landed in the second commit, c3f41e9edd4. The same test passes with the fixtures untouched — identical sha256 for all 17 files, no snapshot rewrite.
  4. The baseline commit was re-verified in isolation: the refactor was stashed, the test re-run against pristine origin/main source, and it passed against the already-committed fixtures. So git checkout da44b375a89 && npx vitest run --config config/vitest.config.ts src/main/shell-wrapper-generated-file-snapshot.test.ts reproduces the baseline independently.

One mismatch surfaced during the refactor and was fixed by preserving the original (the CODEX_HOME comment exists only in local's .zshrc, not its .zlogin) — no snapshot was ever accepted over a diff.

This matters for remote wire compatibility too: the wrapper text runs on a remote host that may be a different version than the client generating it. Byte-identity makes mixed versions a non-issue here.

Divergences preserved as parameters (follow-ups, not fixed here)

Real, pre-existing differences between the three generators. Each is now an explicit field instead of a silent copy-paste difference, and each is left exactly as it was:

  1. The relay .zshenv derives the user's ZDOTDIR differently (zshenvStrategy). Local and daemon source the user's .zshenv and read back what it exported, with %x self-discovery for WSL and the non-ASCII-username workaround ([Bug]: WSL terminal — zsh shell-ready wrapper exports ZDOTDIR as a raw Windows path, so user's .zshrc never loads #8003). The relay trusts the inherited ZDOTDIR and republishes it as ORCA_USER_ZDOTDIR, which is why the relay wrapper files also resolve _orca_home from a different expression (homeExpression). Reconciling these is a follow-up.
  2. The relay omits the agent-teams PATH restore, the CODEX_HOME restore, the codex launch preflight and the OSC 133 command hooks, and adds the remote CLI bin dir restore (restores, osc133CommandMarkers). Whether the relay should have the missing ones is a real question, and not this PR's.
  3. The relay .zshrc does not skip a user .zshrc whose dir is the wrapper ZDOTDIR (skipUserZshrcWhenHomeIsWrapperDir), and the relay .zlogin registers the ready marker after the final ZDOTDIR restore where local/daemon register it before (readyMarkerOrder).
  4. Two cosmetic drifts in local's .zshrc, grouped under legacyFormatting and documented as "normalize in a follow-up": the MIMOCODE_HOME restore lost its two-space indent, and a comment above the CODEX_HOME restore exists only there. Both are shell-semantically inert, but byte-identity is the contract of this PR, so they are preserved rather than tidied.

What the next PR will do

Add the per-pane feature-selection channel on top of this single builder: gate history restore, OSC 133 command markers, the shell-ready marker, startup identity and the overlay restores independently, per pane, across all three transports at once.

Linked Issue

N/A — refactor prerequisite for the wrapper feature-gating work, follow-up to the reverted #15197.

Visual Proof

N/A — no UI surface and no behavior change. The only output of this code is shell wrapper text, and it is proven byte-for-byte identical above; a screenshot would show nothing.

Testing

Platform: macOS 26.3.1 (arm64), zsh 5.9, real Git and real shells.

  • npx vitest run --config config/vitest.config.ts src/main/shell-wrapper-generated-file-snapshot.test.ts — 4 passed, 17 snapshots matched with no rewrite.
  • npx vitest run --config config/vitest.config.ts src/main/zsh-scoped-histfile.live-shell.test.ts — 3 passed (real-shell test, executed against the system zsh 5.9 on macOS).
  • npx vitest run --config config/vitest.config.ts over src/main/providers/, src/main/daemon/, src/relay/ — 3637 passed. The 10 failures in headless-emulator-fidelity.fuzz.test.ts, terminal-snapshot-color-parity.test.ts and terminal-snapshot-osc8-roundtrip.test.ts are pre-existing on origin/main: verified by stashing this branch's source changes and re-running those three files, which fail identically without any of this change.
  • Targeted wrapper/shell suites all pass: local-pty-shell-ready-* (wrapper generation, zsh startup-file behavior, ZDOTDIR discovery, ZDOTDIR normalization, launch environment), daemon/shell-ready.test.ts, repro-13767-shell-ready-marker-lost-to-exec.test.ts, relay/pty-shell-launch.test.ts, relay/pty-handler-spawn-environment.test.ts — 143 passed.
  • npx oxlint on all changed files — clean, no max-lines disable and no ratchet bump (the builder is a new file with its own responsibility; the daemon's zsh module was renamed to hold its spec).
  • npx tsc --noEmit -p config/tsconfig.node.json — clean.
  • npx oxfmt --check — clean.

Cross-platform: generation stays POSIX-gated exactly as before (both ensureShellReadyWrappers win32 early-returns and the relay's win32 branch are untouched), so Windows behavior is unchanged; the snapshot suite skips on win32 for that reason and because native path separators would make fixtures unstable. Local, daemon/SSH and relay transports are each covered by their own fixtures.

  • I manually tested these changes locally
  • Automated tests added/updated, or explained why not below

AI Disclosure

Review

Suggested reading order: the snapshot test and fixtures first (da44b375a89), then zsh-startup-wrapper-builder.ts, then the three specs. The interesting part of the review is whether the spec fields describe the real differences honestly — the fixtures already guarantee the bytes.

Agent skill upstream boundary

  • Not applicable, or this change follows docs/reference/agent-skill-sharing-upstream-boundary.md and copies or mechanically translates no upstream skill-installer source, tests, fixtures, registry entries, path tables, comments, or documentation.

Notes

Security: no new inputs; the only interpolated value is the wrapper dir, still single-quote escaped by the same quotePosixSingle. Cross-platform: unchanged win32 gating. Remote SSH: relay and daemon wrapper text byte-identical, so old hosts and new clients (and the reverse) behave exactly as today. Mobile: untouched. Performance: same string building, done once per wrapper write. Backwards compatibility: wrapper files on disk are rewritten only when their content differs (relay) or when missing (local/daemon), and the content does not differ.

Checklist

  • This PR is small and focused
  • I explained what changed and why (including ELI5)
  • Before/after screenshots or videos attached for UI changes, or N/A with reason
  • Self-reviewed for correctness, security, and performance
  • Cross-platform, SSH/remote, and path/shortcut impact considered (or N/A)
  • pnpm lint, pnpm typecheck, pnpm test, and pnpm build pass (or CI will cover; local preferred)

Captures .zshenv/.zprofile/.zshrc/.zlogin, the bash rcfile, and the fish
init command for all three transports (local PTY, daemon/SSH, relay) so the
upcoming wrapper unification can be proven byte-for-byte identical.
Local PTY, daemon/SSH, and relay each had their own copy of the zsh
ZDOTDIR wrapper templates, and the copies had drifted. buildZshStartupWrapperFiles
now produces .zshenv/.zprofile/.zshrc/.zlogin for all three, with every
real difference expressed as a field on ZshStartupWrapperSpec.

No behavior change: the generated text is byte-for-byte identical for
every configuration, pinned by the snapshots committed in the previous
commit (captured from the pre-refactor generators).
@coderabbitai

coderabbitai Bot commented Aug 18, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

📝 Walkthrough

Walkthrough

The change centralizes Zsh startup-wrapper generation in a shared builder with transport-specific specifications. Local PTY, daemon, and relay integrations now write builder-generated startup files. Zsh templates preserve directory discovery, startup-file sourcing, environment restoration, history handling, command wrappers, and OSC 133 markers. Bash and Fish wrapper snapshots add shell lifecycle and readiness behavior. Snapshot tests cover generated wrappers across transports.

Merge Risk: 🟡 Moderate · up to c3f41

The current head can prevent relay Bash sessions from starting for users with set -u and no ZDOTDIR, so that issue should be fixed before merge. Wrapper-owned printf calls also have a bounded risk of being overridden by user startup files and affecting readiness markers; path construction has a minor portability concern.

🚥 Pre-merge checks | ✅ 3 | ❌ 2

❌ Failed checks (2 warnings)

Check name Status Explanation Resolution
Description check ⚠️ Warning The description is detailed and follows the template, but it does not provide the required linked issue; it lists “N/A” instead. Add a valid issue reference in the Linked Issue section, such as “Fixes #1234,” or link the tracked follow-up issue.
Docstring Coverage ⚠️ Warning Docstring coverage is 28.57% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly describes the main change: consolidating zsh startup wrapper generation into one shared builder.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches 💡 1
📝 Generate docstrings 💡
  • Create stacked PR
  • Commit on current branch

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

🧹 Nitpick comments (1)
src/main/providers/local-pty-shell-ready-wrapper-generation.ts (1)

48-50: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Use join for wrapper paths.

Build zshDir, bashDir, and each wrapper file path with join. The template literals assume / and can create mixed separators when this exported helper runs on a non-POSIX host.

As per coding guidelines, “Use path.join or Electron/Node path utilities for file paths; never assume / or \.”

Also applies to: 65-69

Source: Coding guidelines


ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro Plus

Run ID: d9c231e9-c136-4a8f-9f18-c1bf33c01f45

📥 Commits

Reviewing files that changed from the base of the PR and between bb09dc1 and c3f41e9.

📒 Files selected for processing (25)
  • src/main/daemon/daemon-zsh-shell-ready-rcfile.ts
  • src/main/daemon/daemon-zsh-shell-ready-wrapper-spec.ts
  • src/main/daemon/shell-ready.ts
  • src/main/providers/local-pty-shell-ready-wrapper-generation.ts
  • src/main/shell-templates.ts
  • src/main/shell-wrapper-generated-file-snapshot.test.ts
  • src/main/shell-wrapper-snapshots/daemon-bash-rcfile.txt
  • src/main/shell-wrapper-snapshots/daemon-fish-init.txt
  • src/main/shell-wrapper-snapshots/daemon-zsh-zlogin.txt
  • src/main/shell-wrapper-snapshots/daemon-zsh-zprofile.txt
  • src/main/shell-wrapper-snapshots/daemon-zsh-zshenv.txt
  • src/main/shell-wrapper-snapshots/daemon-zsh-zshrc.txt
  • src/main/shell-wrapper-snapshots/local-bash-rcfile.txt
  • src/main/shell-wrapper-snapshots/local-fish-init.txt
  • src/main/shell-wrapper-snapshots/local-zsh-zlogin.txt
  • src/main/shell-wrapper-snapshots/local-zsh-zprofile.txt
  • src/main/shell-wrapper-snapshots/local-zsh-zshenv.txt
  • src/main/shell-wrapper-snapshots/local-zsh-zshrc.txt
  • src/main/shell-wrapper-snapshots/relay-bash-rcfile.txt
  • src/main/shell-wrapper-snapshots/relay-zsh-zlogin.txt
  • src/main/shell-wrapper-snapshots/relay-zsh-zprofile.txt
  • src/main/shell-wrapper-snapshots/relay-zsh-zshenv.txt
  • src/main/shell-wrapper-snapshots/relay-zsh-zshrc.txt
  • src/main/zsh-startup-wrapper-builder.ts
  • src/relay/pty-shell-overlay-wrappers.ts
💤 Files with no reviewable changes (1)
  • src/main/daemon/daemon-zsh-shell-ready-rcfile.ts

Included review availability: Your plan includes up to 10 reviews per rolling hour; 2 remain after this review.

Comment on lines +80 to +88
printf "\033]133;D;%s\007" "$exit_code"
unset __orca_in_command
fi
printf "\033]133;A\007"
# Why: emit the shell-ready marker here (not a trailing PROMPT_COMMAND entry)
# so a framework that must be last in PROMPT_COMMAND — bash-preexec — is not
# displaced by one of Orca's own hooks.
[[ "${ORCA_SHELL_READY_MARKER:-0}" == "1" ]] && printf "\033]777;orca-shell-ready\007"
return "$exit_code"

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🩺 Stability & Availability | 🟡 Minor | ⚡ Quick win

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
set -eu

for f in \
  src/main/shell-wrapper-snapshots/daemon-bash-rcfile.txt \
  src/main/shell-wrapper-snapshots/local-bash-rcfile.txt \
  src/main/shell-wrapper-snapshots/relay-bash-rcfile.txt
do
  echo "===== $f ====="
  wc -l "$f"
  rg -n -C 3 'printf|PROMPT_COMMAND|ORCA_SHELL_READY_MARKER|osc133|orca-shell-ready' "$f"
done

Repository: stablyai/orca

Length of output: 26888


🏁 Script executed:

#!/bin/bash
set -eu

echo '===== Bash command-resolution probe ====='
bash -c '
printf() { :; }
marker() { printf "\033]133;A\007"; }
value=
normalize() { printf -v value "%s" "$1"; }

printf "direct-output\n"
marker
normalize "normalized"
printf "value=<%s>\n" "$value"

unset -f printf
printf "builtin-output\n"
marker
value=
normalize "normalized"
printf "value=<%s>\n" "$value"
'

echo '===== Unqualified printf inventory ====='
for f in \
  src/main/shell-wrapper-snapshots/daemon-bash-rcfile.txt \
  src/main/shell-wrapper-snapshots/local-bash-rcfile.txt \
  src/main/shell-wrapper-snapshots/relay-bash-rcfile.txt
do
  echo "===== $f ====="
  rg -n '^[[:space:]]*printf([[:space:]]|$)' "$f"
done

Repository: stablyai/orca

Length of output: 1220


Use builtin printf for every wrapper-owned printf call in all three Bash snapshots.

A startup-file printf function overrides the Bash builtin. It can suppress OSC 133/777 markers and prevent printf -v from assigning normalized prompt values. Update all unqualified calls in daemon-bash-rcfile.txt, local-bash-rcfile.txt, and relay-bash-rcfile.txt.

📍 Affects 3 files
  • src/main/shell-wrapper-snapshots/daemon-bash-rcfile.txt#L80-L88 (this comment)
  • src/main/shell-wrapper-snapshots/local-bash-rcfile.txt#L80-L88
  • src/main/shell-wrapper-snapshots/relay-bash-rcfile.txt#L64-L72

Comment on lines +51 to +60
if [[ -n "${ORCA_HISTFILE:-}" ]]; then
HISTFILE="$ORCA_HISTFILE"
elif [[ "${HISTFILE:-}" == "$ZDOTDIR/.zsh_history" ]]; then
# Why also when Orca injected nothing: /etc/zshrc derived this from Orca's
# wrapper ZDOTDIR, so history would accumulate INSIDE the wrapper dir and the
# user's real history would be invisible — the plain #11044 bug, with no
# per-worktree scoping involved. Matching the exact clobbered value means a
# HISTFILE the user set deliberately is never touched.
HISTFILE="${ORCA_ORIG_ZDOTDIR:-$HOME}/.zsh_history"
fi

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🩺 Stability & Availability | 🟠 Major | ⚡ Quick win

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
set -eu

printf '%s\n' '--- candidate files ---'
git ls-files | rg '(^|/)(relay-bash-rcfile\.txt|pty-shell-launch\.ts|.*(bash|zsh).*(rc|overlay|snapshot).*)$' || true

printf '%s\n' '--- wrapper snapshot ---'
cat -n src/main/shell-wrapper-snapshots/relay-bash-rcfile.txt | sed -n '1,130p'

printf '%s\n' '--- launch selection and environment ---'
ast-grep outline src/relay/pty-shell-launch.ts --view expanded || true
cat -n src/relay/pty-shell-launch.ts | sed -n '50,145p'

printf '%s\n' '--- related history and rcfile generation references ---'
rg -n -C 4 'relay-bash-rcfile|ORCA_HISTFILE|ORCA_ORIG_ZDOTDIR|ZDOTDIR|zsh_history|HISTFILE|set -u|nounset' src test tests 2>/dev/null || true

Repository: stablyai/orca

Length of output: 50372


🏁 Script executed:

#!/bin/bash
set -eu

printf '%s\n' '--- Bash snapshot ---'
cat -n src/main/shell-wrapper-snapshots/relay-bash-rcfile.txt | sed -n '1,125p'

printf '%s\n' '--- PTY launcher references ---'
rg -n -C 8 --glob '*.ts' --glob '*.tsx' \
  'relay-bash-rcfile|bash.*--rcfile|--rcfile|ORCA_HISTFILE|ORCA_ORIG_ZDOTDIR' \
  src/relay src/main 2>/dev/null | head -n 500

printf '%s\n' '--- snapshot/generator references ---'
rg -n -C 5 --glob '*.ts' --glob '*.tsx' --glob '*.txt' \
  'relay-bash-rcfile|shell-wrapper-snapshots|HISTFILE.*ZDOTDIR|ZDOTDIR.*HISTFILE' \
  . 2>/dev/null | head -n 500

Repository: stablyai/orca

Length of output: 50369


🏁 Script executed:

#!/bin/bash
set -eu

printf '%s\n' '--- launcher source ---'
cat -n src/relay/pty-shell-launch.ts | sed -n '1,135p'

printf '%s\n' '--- wrapper generation source ---'
rg -n -C 12 --glob '*.ts' \
  'getBashShellReadyRcfileContent|getBash.*Rcfile|relay bash overlay|Orca relay bash overlay wrapper|bash.*rcfile' \
  src/relay src/main/providers src/main | head -n 350

printf '%s\n' '--- exact shell behavior: nounset and path comparison ---'
bash --noprofile --norc -c '
  set -u
  unset ZDOTDIR HISTFILE ORCA_HISTFILE
  if [[ -n "${ORCA_HISTFILE:-}" ]]; then
    HISTFILE="$ORCA_HISTFILE"
  elif [[ "${HISTFILE:-}" == "$ZDOTDIR/.zsh_history" ]]; then
    HISTFILE="${ORCA_ORIG_ZDOTDIR:-$HOME}/.zsh_history"
  fi
  printf "completed-without-error\n"
' 2>&1 || printf 'status=%s\n' "$?"

bash --noprofile --norc -c '
  set +u
  unset ORCA_HISTFILE
  ZDOTDIR=/tmp/orca-wrapper
  HISTFILE=/tmp/orca-wrapper/.zsh_history
  if [[ -n "${ORCA_HISTFILE:-}" ]]; then
    HISTFILE="$ORCA_HISTFILE"
  elif [[ "${HISTFILE:-}" == "$ZDOTDIR/.zsh_history" ]]; then
    HISTFILE="${ORCA_ORIG_ZDOTDIR:-$HOME}/.zsh_history"
  fi
  printf "matched-path=%s\n" "$HISTFILE"
'

Repository: stablyai/orca

Length of output: 40494


🏁 Script executed:

#!/bin/bash
set -eu

printf '%s\n' '--- Bash rcfile generator ---'
cat -n src/main/providers/local-pty-shell-ready-bash-rcfile.ts | sed -n '1,115p'

printf '%s\n' '--- relay overlay wrapper imports and Bash content path ---'
cat -n src/relay/pty-shell-overlay-wrappers.ts | sed -n '1,90p'
rg -n -C 8 --glob '*.ts' \
  'ensureOverlayRestoreWrappers|getBashShellReadyRcfileContent|bash/rcfile|relay-bash-rcfile' \
  src/relay src/main/providers | head -n 250

Repository: stablyai/orca

Length of output: 36085


🏁 Script executed:

#!/bin/bash
set -eu

printf '%s\n' '--- shared history block definition and uses ---'
rg -n -C 12 --glob '*.ts' \
  'ZSH_HISTFILE_RESTORE_BLOCK|zsh_history|HISTFILE.*ZDOTDIR|ZDOTDIR.*zsh_history' \
  src/main src/relay | head -n 300

printf '%s\n' '--- relay Bash history block context ---'
cat -n src/relay/pty-shell-overlay-wrappers.ts | sed -n '45,82p'

Repository: stablyai/orca

Length of output: 24704


Remove the zsh-only history block from the relay Bash wrapper.

When a user profile enables set -u and leaves ZDOTDIR unset, ${ZSH_HISTFILE_RESTORE_BLOCK} aborts Bash startup while evaluating ZDOTDIR. Remove this block from src/relay/pty-shell-overlay-wrappers.ts and regenerate the snapshot. Preserve it in the relay zsh wrapper.

@nwparker
nwparker merged commit 545b3fb into main Aug 18, 2026
55 of 56 checks passed
paidaxingyo666 pushed a commit to paidaxingyo666/Manta that referenced this pull request Aug 21, 2026
…der (stablyai#15245)

* test(shell): pin every generated shell wrapper file with byte snapshots

Captures .zshenv/.zprofile/.zshrc/.zlogin, the bash rcfile, and the fish
init command for all three transports (local PTY, daemon/SSH, relay) so the
upcoming wrapper unification can be proven byte-for-byte identical.

* refactor(shell): build every zsh startup wrapper from one shared builder

Local PTY, daemon/SSH, and relay each had their own copy of the zsh
ZDOTDIR wrapper templates, and the copies had drifted. buildZshStartupWrapperFiles
now produces .zshenv/.zprofile/.zshrc/.zlogin for all three, with every
real difference expressed as a field on ZshStartupWrapperSpec.

No behavior change: the generated text is byte-for-byte identical for
every configuration, pinned by the snapshots committed in the previous
commit (captured from the pre-refactor generators).
dallascrilley pushed a commit to dallascrilley/orca that referenced this pull request Aug 27, 2026
…der (stablyai#15245)

* test(shell): pin every generated shell wrapper file with byte snapshots

Captures .zshenv/.zprofile/.zshrc/.zlogin, the bash rcfile, and the fish
init command for all three transports (local PTY, daemon/SSH, relay) so the
upcoming wrapper unification can be proven byte-for-byte identical.

* refactor(shell): build every zsh startup wrapper from one shared builder

Local PTY, daemon/SSH, and relay each had their own copy of the zsh
ZDOTDIR wrapper templates, and the copies had drifted. buildZshStartupWrapperFiles
now produces .zshenv/.zprofile/.zshrc/.zlogin for all three, with every
real difference expressed as a field on ZshStartupWrapperSpec.

No behavior change: the generated text is byte-for-byte identical for
every configuration, pinned by the snapshots committed in the previous
commit (captured from the pre-refactor generators).
enrick-dev pushed a commit to enrick-dev/orca that referenced this pull request Oct 15, 2026
…der (stablyai#15245)

* test(shell): pin every generated shell wrapper file with byte snapshots

Captures .zshenv/.zprofile/.zshrc/.zlogin, the bash rcfile, and the fish
init command for all three transports (local PTY, daemon/SSH, relay) so the
upcoming wrapper unification can be proven byte-for-byte identical.

* refactor(shell): build every zsh startup wrapper from one shared builder

Local PTY, daemon/SSH, and relay each had their own copy of the zsh
ZDOTDIR wrapper templates, and the copies had drifted. buildZshStartupWrapperFiles
now produces .zshenv/.zprofile/.zshrc/.zlogin for all three, with every
real difference expressed as a field on ZshStartupWrapperSpec.

No behavior change: the generated text is byte-for-byte identical for
every configuration, pinned by the snapshots committed in the previous
commit (captured from the pre-refactor generators).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant