Skip to content

fix(core/exec): run project hooks outside the command sandbox - #623

Open
voarsh2 wants to merge 1 commit into
just-every:mainfrom
voarsh2:pr/project-hooks-sandbox-20260925
Open

voarsh2 wants to merge 1 commit into
just-every:mainfrom
voarsh2:pr/project-hooks-sandbox-20260925

Conversation

@voarsh2

@voarsh2 voarsh2 commented Sep 25, 2026

Copy link
Copy Markdown

Summary

Run configured project hooks through a full-access execution boundary instead of inheriting the model-tool command sandbox.

This keeps project hooks usable from subagent turns when they need networking or access to external local integrations, while preserving the existing sandbox behavior for ordinary model-generated commands and project commands.

Why

The upstream codex-rs hook runtime executes configured hooks separately from the model-tool sandbox. code-rs does not yet have that split runtime, so this applies the equivalent policy at the existing hook execution boundary.

Previously, hooks inherited the active session sandbox. In restricted modes, that could prevent hooks from accessing networking or other external state even though the hook was explicitly configured by the project.

Scope

  • Project hooks use SandboxType::None with DangerFullAccess.
  • Ordinary model commands are unchanged.
  • Project commands are unchanged.
  • No new config.toml setting is introduced.
  • Adds a focused regression test for the hook execution policy.
  • Documents the intentional compatibility boundary between code-rs and codex-rs.

Validation

  • ./build-fast.sh --workspace code
  • Rust 1.90.0
  • dev-fast profile
  • Build completed without errors or warnings

Lets trusted local integrations use networking and
external state without inheriting model-tool restrictions.

Adds regression coverage to keep hooks independent from
read-only and workspace-write policies.
@chatgpt-codex-connector

Copy link
Copy Markdown

Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits.
Repo admins can enable using credits for code reviews in their settings.

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.

2 participants