-
Notifications
You must be signed in to change notification settings - Fork 6.6k
feat: shell snapshotting #7641
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
feat: shell snapshotting #7641
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
💡 Codex Review
Here are some automated review suggestions for this pull request.
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
@codex review |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
💡 Codex Review
Here are some automated review suggestions for this pull request.
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
|
||
| #[cfg(target_os = "windows")] | ||
| #[tokio::test] | ||
| async fn windows_powershell_snapshot_includes_sections() -> Result<()> { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we add an integration test that touches this feature?
|
@codex review |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
💡 Codex Review
Here are some automated review suggestions for this pull request.
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| match self.shell_type { | ||
| ShellType::Zsh | ShellType::Bash | ShellType::Sh => { | ||
| let mut args = self.derive_exec_args(". \"$1\" && shift && exec \"$@\"", false); | ||
| args.push(snapshot.path.to_string_lossy().to_string()); | ||
| args.extend_from_slice(command); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Preserve apply_patch detection with snapshot wrapping
When Feature::ShellSnapshot is enabled, wrap_command_with_snapshot prepends every exec command with an extra shell hop and snapshot file (e.g. bash -c '. "$1" && shift && exec "$@"' <snapshot> bash -lc 'apply_patch …'). intercept_apply_patch relies on maybe_parse_apply_patch_verified parsing argv shapes like [shell, flag, script] (see codex-rs/apply-patch/src/lib.rs lines 130‑142), so the wrapped argv now misses all apply_patch heredoc invocations and they run as raw shell commands or fail if the CLI is absent. As a result, exec_command-based patch requests are no longer intercepted/approved whenever shell snapshotting is on. Please keep argv parseable for apply_patch or unwrap before calling the interceptor.
Useful? React with 👍 / 👎.
No description provided.