Skip to content

Conversation

@jif-oai
Copy link
Collaborator

@jif-oai jif-oai commented Dec 5, 2025

No description provided.

Copy link
Contributor

@chatgpt-codex-connector chatgpt-codex-connector bot left a 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".

@jif-oai jif-oai changed the title WIP feat: shell snapshotting Dec 5, 2025
@jif-oai
Copy link
Collaborator Author

jif-oai commented Dec 5, 2025

@codex review

Copy link
Contributor

@chatgpt-codex-connector chatgpt-codex-connector bot left a 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<()> {
Copy link
Collaborator

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?

@jif-oai
Copy link
Collaborator Author

jif-oai commented Dec 5, 2025

@codex review

Copy link
Contributor

@chatgpt-codex-connector chatgpt-codex-connector bot left a 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".

Comment on lines +76 to +80
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);
Copy link
Contributor

Choose a reason for hiding this comment

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

P1 Badge 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 👍 / 👎.

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.

3 participants