Repository navigation
Tolerate null Codex feature flags during hook activation - #325
Closed
Erik Weathers (erikdw) wants to merge 1 commit into
Closed
Erik Weathers (erikdw) wants to merge 1 commit into
Erik Weathers (erikdw) wants to merge 1 commit into
Conversation
Codex's config/read reports every feature flag, and leaves some unset flags as null (for example network_proxy). Setup decoded the whole map as bool, so one null failed the response and `bt trace update codex` reported "Codex plugin installed, but hook activation failed". Decode only the two flags setup reads, as Option<bool>. Null and absent both mean Codex's default; only an explicit false disables hooks. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Member
|
thanks for the pr Erik Weathers (@erikdw) - I fixed this with #339 Will release asap |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
bt trace update codex(bt 0.33.0) fails with:Hook activation calls Codex's
config/read, which reports every feature flag. Codex leaves some unset flags asnull. With Codex 0.171 and 0.172 it returns"network_proxy": nulleven when the user's config never sets it.Config.featureswas aBTreeMap<String, bool>, so that onenullfailed to decode the whole response. The real cause (invalid type: null, expected a boolean) is hidden behind the outer context message.Fix
Decode only the two flags setup reads,
hooksandcodex_hooks, asOption<bool>. Other flags are ignored.nulland an absent flag both mean Codex's default, matching how an absent flag was already treated. Only an explicitfalsedisables hooks.This follows the repo rule to model known config fields with concrete types rather than
serde_json::Value.Testing
config_read_tolerates_null_feature_flagscovers anullunrelated flag,nullhook flags, a non-bool unrelated flag, explicitfalseon each hook flag, and a missingfeaturesobject. It fails onmainwithinvalid type: null, expected a boolean.cargo test --all-features --lib codex_hooks,cargo fmt --check, andcargo clippy --all-features --all-targets -D warningspass locally.[patch].bt trace update codexnow succeeds against a real Codex 0.172.0 that returnsnetwork_proxy: null. The released 0.33.0 fails on the same machine.Follow-ups (not in this PR)
activate()reports only the outer context, so every activation failure looks the same. Printing the full error chain would have made this a one-step diagnosis.--no-daemon. Activation fails on older CLIs with the same opaque message, so a version check or a clearer error would help.🤖 Generated with Claude Code