Skip to content

fix(codex): do not pass exec-only hook-trust flag to app-server - #1310

Merged
currentbits merged 1 commit into
mainfrom
coder/fix-codex-appserver-hook-trust-1309
Sep 11, 2026
Merged

currentbits merged 1 commit into
mainfrom
coder/fix-codex-appserver-hook-trust-1309

Conversation

@currentbits

Copy link
Copy Markdown
Owner

Summary

  • Interactive Codex was dying on spawn with exit 2 because startCodexRun passed --dangerously-bypass-hook-trust to codex app-server. Live CLI 0.153.4 accepts that flag only on exec.
  • Keep the isolated CODEX_HOME overlay and -c features.hooks=true. Workflow/codex exec still uses the bypass flag.
  • Fake app-server now rejects the flag the same way as the live CLI so this cannot hide behind tests.

Fixes #1309.

Test plan

  • electron/test/codex.test.js overlay argv case
  • electron/test/codex-guardrail-remote.test.js
  • Nightly 202609110742-769984bf signed and notarized
  • After merge, Retry a local Codex thread with guardrails on

Made with Cursor

Live Codex 0.153.4 rejects --dangerously-bypass-hook-trust on
app-server (exit 2), so every local interactive turn died while
guardrails were on.
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 11, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-09-11T07:53:42.091679Z 769984b PR opened
ℹ️ 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" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@currentbits
currentbits merged commit 9b16b62 into main Sep 11, 2026
0 of 12 checks passed

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

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: 769984bfce

ℹ️ 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 electron/runner.js
// Isolated overlay + hooks=true. Do not pass
// --dangerously-bypass-hook-trust: that flag is exec-only and
// live Codex app-server exits 2 on it (#1309).
args.push("-c", "features.hooks=true");

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Preserve hook trust when switching to app-server

When guardrails are enabled for either SSH/WSL here or the local overlay below, features.hooks=true only enables hook discovery; it does not trust the freshly generated hook. Using this exact overlay with Codex, hooks/list reports "trustStatus":"untrusted", while codex exec --help describes the removed option as running enabled hooks “without requiring persisted hook trust.” Removing the CLI flag without supplying app-server's supported thread override (for example, config: { bypass_hook_trust: true }) therefore silently prevents the PreToolUse guardrail from running, allowing deny-tier commands that do not trigger an approval request; the modified fake masks this by assuming app-server plus the feature flag automatically trusts hooks.

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.

Codex app-server dies on --dangerously-bypass-hook-trust

1 participant