This PR adds a new approval option for app/MCP tool calls: “Allow and remember” (session-scoped). When selected, Codex stores a temporary approval and auto-approves matching future calls for the rest of the session. Added a session-scoped approval key (`server`, `connector_id`, `tool_name`) and persisted it in `tool_approvals` as `ApprovedForSession`. On subsequent matching calls, approval is skipped and treated as accepted. - Updated the approval question options to conditionally include: - Accept - Allow and remember (conditional) - Decline - Cancel The new “Allow and remember” option is only shown when all of these are true: 1. The call is routed through the Codex Apps MCP server (codex_apps). 2. The tool requires approval based on annotations: - read_only_hint == false, and - destructive_hint == true or open_world_hint == true. 3. The tool includes a connector_id in metadata (used to build the remembered approval key). If no `connector_id` is present, the prompt still appears (when approval is required), but only with the existing choices (Accept / Decline / Cancel). Approval prompting in this path has an explicit early return unless server == `codex_apps`.
codex-core
This crate implements the business logic for Codex. It is designed to be used by the various Codex UIs written in Rust.
Dependencies
Note that codex-core makes some assumptions about certain helper utilities being available in the environment. Currently, this support matrix is:
macOS
Expects /usr/bin/sandbox-exec to be present.
When using the workspace-write sandbox policy, the Seatbelt profile allows
writes under the configured writable roots while keeping .git (directory or
pointer file), the resolved gitdir: target, and .codex read-only.
Linux
Expects the binary containing codex-core to run the equivalent of codex sandbox linux (legacy alias: codex debug landlock) when arg0 is codex-linux-sandbox. See the codex-arg0 crate for details.
All Platforms
Expects the binary containing codex-core to simulate the virtual apply_patch CLI when arg1 is --codex-run-as-apply-patch. See the codex-arg0 crate for details.