Skip to content

[codex] Preserve zsh PATH in shell snapshots#16974

Draft
sayan-oai wants to merge 1 commit intomainfrom
codex/fix-zsh-shell-snapshot-path
Draft

[codex] Preserve zsh PATH in shell snapshots#16974
sayan-oai wants to merge 1 commit intomainfrom
codex/fix-zsh-shell-snapshot-path

Conversation

@sayan-oai
Copy link
Copy Markdown
Collaborator

Summary

Fix zsh shell snapshot export filtering so tied parameters such as PATH/path are not dropped. zsh emits PATH from export -p as export -T PATH path=(...), and the previous parser treated -T PATH path as the variable name and filtered it out as invalid.

Add a macOS regression test that captures a zsh snapshot from a temporary .zshrc, sources the snapshot in a fresh zsh process with a deliberately wrong PATH, and verifies the captured login-shell PATH is restored.

Impact

This keeps shell snapshots from losing the login-shell PATH on zsh. That matters for extension-host or other thin-parent-environment sessions where inheriting the parent PATH does not mask a missing snapshot PATH export.

Validation

  • just fmt
  • cargo test -p codex-core zsh_snapshot_preserves_tied_path_export
  • cargo test -p codex-core shell_snapshot::tests
  • cargo test -p codex-core was also run locally, but failed in unrelated integration/approval tests after the shell snapshot unit tests passed. Failures included approval/otel cases plus shell snapshot integration tests timing out while waiting for zsh snapshot creation in this local environment.

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