Skip to content

Use model catalog approval messages#31312

Merged
dylan-hurd-oai merged 2 commits into
mainfrom
feat/catalog-approval-messages
Jul 7, 2026
Merged

Use model catalog approval messages#31312
dylan-hurd-oai merged 2 commits into
mainfrom
feat/catalog-approval-messages

Conversation

@dylan-hurd-oai

@dylan-hurd-oai dylan-hurd-oai commented Jul 6, 2026

Copy link
Copy Markdown
Collaborator

Why

Approval guidance is currently assembled entirely by the client. Model Messages V2 needs model catalogs to provide model-specific on_request guidance for both user-reviewed and auto-reviewed approval flows while retaining the existing generated prompt as a compatibility fallback.

What changed

  • add nullable on_request and on_request_auto_review catalog messages
  • select the message matching the active approvals reviewer for on_request policies
  • replace the complete legacy approval section when the selected catalog value exists, including support for an empty string that suppresses the section
  • retain legacy rendering when the object or selected key is absent, and for non-on_request policies
  • preserve approval messages when base-instruction or personality overrides clear instruction templates
  • refresh permissions instructions when the active model changes
  • pass catalog messages through initial and incremental permissions construction

Relationship to reviewer persistence

PR #31309 independently persists the approvals reviewer in turn context and refreshes permissions when that reviewer changes. This PR is based directly on main and does not duplicate that rollout migration; once both land, reviewer switches will also select and append the new catalog variant.

Testing

  • just test -p codex-protocol
  • just test -p codex-prompts
  • just test -p codex-models-manager
  • just test -p codex-core permissions_messages

@dylan-hurd-oai dylan-hurd-oai requested a review from a team as a code owner July 6, 2026 22:54

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown
Contributor

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: 33768f93c2

ℹ️ 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/prompts/src/permissions_instructions.rs Outdated
Comment on lines 32 to 35
if prev.permission_profile() == next.permission_profile()
&& prev.approval_policy == next.approval_policy.value()
&& prev.model == next.model_info.slug
{

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

P2 Badge Refresh approvals when same-slug catalog text changes

When the model catalog refreshes in-session for the same model slug, this early return treats permissions as unchanged even if the model's catalog approval text changed. The next turn then persists the new TurnContextItem without appending the new approval guidance, so the updated same-slug catalog message never becomes model-visible until some unrelated model/profile/policy change occurs; include a persisted approval-message version/hash, or compare a catalog compatibility hash if it covers these messages.

AGENTS.md reference: AGENTS.md:L91-L100

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

@sayan-oai i'll defer to you here for world state work

Comment thread codex-rs/prompts/src/permissions_instructions.rs Outdated
@dylan-hurd-oai dylan-hurd-oai force-pushed the feat/catalog-approval-messages branch from 33768f9 to 2d079dd Compare July 6, 2026 23:00
dylan-hurd-oai added a commit that referenced this pull request Jul 7, 2026
@sayan-oai sayan-oai self-requested a review July 7, 2026 17:35
@dylan-hurd-oai dylan-hurd-oai merged commit 3585754 into main Jul 7, 2026
62 of 66 checks passed
@dylan-hurd-oai dylan-hurd-oai deleted the feat/catalog-approval-messages branch July 7, 2026 17:52
@github-actions github-actions Bot locked and limited conversation to collaborators Jul 7, 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