Skip to content

Scope command approvals by execution environment#28738

Merged
jif-oai merged 4 commits into
mainfrom
jif/scope-exec-approvals-by-environment
Jun 17, 2026
Merged

Scope command approvals by execution environment#28738
jif-oai merged 4 commits into
mainfrom
jif/scope-exec-approvals-by-environment

Conversation

@jif-oai

@jif-oai jif-oai commented Jun 17, 2026

Copy link
Copy Markdown
Contributor

Why

Command approval cache keys included the command and working directory, but not the execution environment. An approval for /workspace locally could therefore be reused for the same command and path on an executor.

What changed

  • Include the selected environment ID in shell and unified-exec approval cache keys.
  • Carry that ID through the normal command approval request so clients can show which environment is being approved.
  • Expose the environment through app-server as a required nullable environmentId and show it in the inline TUI approval prompt.
  • Keep older recorded approval events compatible when the environment is absent.

For example, echo ok in local /workspace and echo ok in executor /workspace now produce different approval keys and separate prompts.

Scope

This PR does not change network approvals, Guardian review actions, MCP elicitation, full-screen TUI rendering, or environment-ID validation. Remote shell_command execution itself remains in #28722; this PR only makes its approval key environment-aware.

@jif-oai
jif-oai requested a review from a team as a code owner June 17, 2026 14:33

@chatgpt-codex-connector chatgpt-codex-connector 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.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 73f26f349a

ℹ️ 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 thread codex-rs/core/src/tools/network_approval.rs Outdated
Comment thread codex-rs/core/src/tools/runtimes/shell.rs
Comment thread codex-rs/mcp-server/src/codex_tool_runner.rs
@jif-oai
jif-oai force-pushed the jif/scope-exec-approvals-by-environment branch from 73f26f3 to 7761604 Compare June 17, 2026 15:33
@jif-oai

jif-oai commented Jun 17, 2026

Copy link
Copy Markdown
Contributor Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown
Contributor

Codex Review: Didn't find any major issues. Delightful!

Reviewed commit: 975833f5a8

ℹ️ 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 merged commit 1391d78 into main Jun 17, 2026
31 checks passed
@jif-oai
jif-oai deleted the jif/scope-exec-approvals-by-environment branch June 17, 2026 17:52
@github-actions github-actions Bot locked and limited conversation to collaborators Jun 17, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants