Skip to content

Automatically activate Codex tracing hooks - #211

Merged
Stephen Belanger (Qard) merged 10 commits into
mainfrom
fix/codex-hook-readiness
Oct 26, 2026
Merged

Stephen Belanger (Qard) merged 10 commits into
mainfrom
fix/codex-hook-readiness

Conversation

@Qard

@Qard Stephen Belanger (Qard) commented Oct 20, 2026 •

Copy link
Copy Markdown
Collaborator

Codex skips untrusted plugin hooks before Braintrust receives their events. This PR makes bt trace enable codex and bt trace update codex enforce the installed-and-trusted state automatically. If the plugin is missing, setup installs it. If its packaged hook definitions are untrusted or modified, setup trusts the current Codex-reported hashes and verifies the result. Setup fails if it cannot establish that state.

Codex's /hooks UI uses config/batchWrite to upsert hooks.state entries containing the exact key and trusted_hash supplied by hooks/list. Setup verifies the complete installed hook file against this bt build, including Windows commands, before writing trust. Unrelated hook trust and configuration are preserved. Doctor no longer duplicates plugin installation and trust status.

bt trace run codex uses the same packaged definitions and invocation-scoped trust without changing persistent Codex configuration. Managed runs load all 12 packaged hook overrides, obtain their exact keys and hashes from Codex, and pass trust as a CLI-only config override. The invocation-wide --dangerously-bypass-hook-trust flag is not used.

SDK-583

Validation on macOS:

  • All 45 bt-daemon pipeline integration tests passed, including managed_run_flushes_and_preserves_agent_exit_status, which failed in CI because its fake Codex executable did not implement the new app-server trust-preparation protocol. The fixture now responds to initialization and hook-list requests.
  • cargo check --manifest-path bt-daemon/Cargo.toml --all-features --locked, Clippy with all targets/features and warnings denied, cargo fmt -- --check, and git diff --check passed.
  • Earlier isolated Codex smoke tests confirmed automatic trust, preservation of unrelated trust, idempotent repeated setup, refusal of altered hook definitions, and invocation-only trust for all 12 run hooks.
  • CI for the current commit is pending.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 20, 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-10-20T18:52:31.418045Z 3f136c6 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

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

@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: 3f136c6e82

ℹ️ 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 (@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 (@codex) address that feedback".

Comment thread bt-daemon/src/codex_hooks.rs
Comment thread bt-daemon/src/codex_hooks.rs Outdated
@Qard Stephen Belanger (Qard) changed the title Report Codex hook readiness and document managed activation Automatically activate Braintrust Codex hook trust Oct 23, 2026
@Qard Stephen Belanger (Qard) changed the title Automatically activate Braintrust Codex hook trust Automatically activate Codex tracing hooks Oct 23, 2026
@Qard
Stephen Belanger (Qard) merged commit bd5f742 into main Oct 26, 2026
22 checks passed
@Qard
Stephen Belanger (Qard) deleted the fix/codex-hook-readiness branch October 26, 2026 16:03
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