Skip to content

Respect hook trust bypass during TUI startup#24317

Open
etraut-openai wants to merge 4 commits into
mainfrom
etraut/tui-bypass-hook-trust-startup-review
Open

Respect hook trust bypass during TUI startup#24317
etraut-openai wants to merge 4 commits into
mainfrom
etraut/tui-bypass-hook-trust-startup-review

Conversation

@etraut-openai
Copy link
Copy Markdown
Collaborator

@etraut-openai etraut-openai commented May 24, 2026

Fixes #24093.

Why

--dangerously-bypass-hook-trust is a supported CLI flag intended for headless or automated runs where enabled hooks should be allowed to run without requiring persisted trust. In the TUI, startup hook review still opened whenever hooks looked untrusted, so a launch using the bypass could block on the interactive "Hooks need review" prompt.

The tricky case is persistent app-server resume: a resume may attach to an already-running thread, where resume config overrides are ignored. In that path, hiding the startup review would be wrong because the existing hook engine may still filter untrusted hooks.

What Changed

  • Startup hook review now skips the prompt only when hook trust bypass is actually safe for that launch.
  • The TUI forwards bypass_hook_trust through the app-server request config for fresh thread start/resume/fork paths, and the app-server applies it as a runtime-only ConfigOverrides value rather than treating it like a config.toml setting.
  • Persistent app-server resumes keep the startup review prompt so users still have a chance to trust hooks when the running thread cannot receive the bypass override.

Verification

  • Added focused coverage for startup hook review with and without bypass_hook_trust.
  • Extended existing TUI/app-server config override tests to cover forwarding and applying bypass_hook_trust.

Copy link
Copy Markdown
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.

Reviewed commit: 6ef38eb18a

ℹ️ 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/tui/src/startup_hooks_review.rs Outdated
Copy link
Copy Markdown
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.

Reviewed commit: 35b5ab1279

ℹ️ 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/tui/src/startup_hooks_review.rs Outdated
@etraut-openai etraut-openai changed the title Fix TUI hook trust bypass startup prompt Respect hook trust bypass during TUI startup May 24, 2026
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.

--dangerously-bypass-hook-trust is ignored in TUI mode (codex 0.131.0–0.133.0): "Hooks need review" prompt still blocks startup

1 participant