Skip to content

Fix auto-review config compatibility across protocol and SDK#19113

Merged
won-openai merged 1 commit intomainfrom
hotfixpythonsdk
Apr 23, 2026
Merged

Fix auto-review config compatibility across protocol and SDK#19113
won-openai merged 1 commit intomainfrom
hotfixpythonsdk

Conversation

@won-openai
Copy link
Copy Markdown
Collaborator

@won-openai won-openai commented Apr 23, 2026

Why

This keeps the partial Guardian subagent -> Auto-review rename forward-compatible across mixed Codex installations. Newer binaries need to understand the new auto_review spelling, but they cannot write it to shared ~/.codex/config.toml yet because older CLI/app-server bundles only know user and guardian_subagent and can fail during config load before recovering.

The Python SDK had the opposite compatibility gap: app-server responses can contain approvalsReviewer: "auto_review", but the checked-in generated SDK enum did not accept that value.

What Changed

  • Keep ApprovalsReviewer::AutoReview readable from both guardian_subagent and auto_review, while serializing it as guardian_subagent in both protocol crates.
  • Update TUI Auto-review persistence tests so enabling Auto-review writes approvals_reviewer = "guardian_subagent" while UI copy still says Auto-review.
  • Map managed/cloud feature_requirements.auto_review to the existing Feature::GuardianApproval gate without adding a broad local [features].auto_review key or changing config writes.
  • Add auto_review to the Python SDK ApprovalsReviewer enum and cover ThreadResumeResponse validation.

Testing

  • cargo test -p codex-protocol approvals_reviewer
  • cargo test -p codex-app-server-protocol approvals_reviewer
  • cargo test -p codex-tui update_feature_flags_enabling_guardian_selects_auto_review
  • cargo test -p codex-tui update_feature_flags_enabling_guardian_in_profile_sets_profile_auto_review_policy
  • cargo test -p codex-core feature_requirements_auto_review_disables_guardian_approval
  • pytest sdk/python/tests/test_client_rpc_methods.py::test_thread_resume_response_accepts_auto_review_reviewer
  • git diff --check

@won-openai won-openai marked this pull request as ready for review April 23, 2026 09:04
@won-openai won-openai requested a review from a team as a code owner April 23, 2026 09:04
@won-openai
Copy link
Copy Markdown
Collaborator Author

@codex Review

@won-openai won-openai changed the title Fix auto-review compatibility across config, protocol, and SDK Fix auto-review config compatibility across protocol and SDK Apr 23, 2026
@chatgpt-codex-connector
Copy link
Copy Markdown
Contributor

Codex Review: Didn't find any major issues. 🚀

ℹ️ 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".

if key == "auto_review" {
pinned_features.insert(Feature::GuardianApproval, enabled);
continue;
}
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

why is this specifically needed?

@won-openai won-openai merged commit 17ae906 into main Apr 23, 2026
35 of 36 checks passed
@won-openai won-openai deleted the hotfixpythonsdk branch April 23, 2026 10:12
@github-actions github-actions Bot locked and limited conversation to collaborators Apr 23, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants