Skip to content

Delegate tracing hooks through BRAINTRUST_BT_BIN - #208

Open
Stephen Belanger (Qard) wants to merge 2 commits into
mainfrom
fix/hook-executable-delegation
Open

Stephen Belanger (Qard) wants to merge 2 commits into
mainfrom
fix/hook-executable-delegation

Conversation

@Qard

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

Copy link
Copy Markdown
Collaborator

Codex hooks resolve bt from PATH, which can select a stale unmanaged installation when a mise pin is inactive outside a project. Honor BRAINTRUST_BT_BIN at the start of hook dispatch, before reading stdin or loading settings, to delegate to an absolute CLI executable while leaving the marketplace hook definition unchanged.

The dispatcher preserves arguments, standard streams, and exit status, recognizes its own canonical path, rejects relative/missing targets, and detects wrapper loops. Unix replaces the process; Windows waits for the selected executable without allocating a console. Delegation is scoped to the mounted bt trace hook entry point; the standalone development frontend retains its existing adapter protocol.

The PATH-resolved CLI still needs a one-time upgrade to a release containing this behavior. Codex must inherit the variable, and it should name the actual executable rather than a version-manager shim. No config-file setting is added.

Validation: all 286 Rust library tests passed, including subprocess coverage for raw stdin, arguments, both output streams, status 23, paths with spaces, self-selection, invalid targets, and loop prevention. All-target/all-feature Clippy with warnings denied and git diff --check passed on macOS. The initial Windows CI job passed. The initial Unix CI jobs exposed re-entry through standalone Cursor test adapters; delegation is now scoped to the production mounted command, and all five Cursor pipeline tests pass locally. The corrected revision now passes CI on Linux, macOS, and Windows. The full all-feature Rust suite also passes locally.

Delivery requires updating the embedding bt CLI's daemon dependency and releasing it; no Codex plugin release is needed for the runtime change.

@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:17:26.287948Z 1a54daa 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: 1a54daad21

ℹ️ 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/trace_runtime.rs

This branch has not been deployed

No deployments
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.

1 participant