[codex] Preserve zsh PATH in shell snapshots#16974
Draft
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fix zsh shell snapshot export filtering so tied parameters such as
PATH/pathare not dropped. zsh emitsPATHfromexport -pasexport -T PATH path=(...), and the previous parser treated-T PATH pathas 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 wrongPATH, and verifies the captured login-shellPATHis restored.Impact
This keeps shell snapshots from losing the login-shell
PATHon zsh. That matters for extension-host or other thin-parent-environment sessions where inheriting the parentPATHdoes not mask a missing snapshotPATHexport.Validation
just fmtcargo test -p codex-core zsh_snapshot_preserves_tied_path_exportcargo test -p codex-core shell_snapshot::testscargo test -p codex-corewas 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.