Use model catalog approval messages#31312
Conversation
There was a problem hiding this comment.
💡 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".
| if prev.permission_profile() == next.permission_profile() | ||
| && prev.approval_policy == next.approval_policy.value() | ||
| && prev.model == next.model_info.slug | ||
| { |
There was a problem hiding this comment.
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 👍 / 👎.
There was a problem hiding this comment.
@sayan-oai i'll defer to you here for world state work
33768f9 to
2d079dd
Compare
2493163 to
9809404
Compare
Why
Approval guidance is currently assembled entirely by the client. Model Messages V2 needs model catalogs to provide model-specific
on_requestguidance for both user-reviewed and auto-reviewed approval flows while retaining the existing generated prompt as a compatibility fallback.What changed
on_requestandon_request_auto_reviewcatalog messageson_requestpolicieson_requestpoliciesRelationship 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
mainand 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-protocoljust test -p codex-promptsjust test -p codex-models-managerjust test -p codex-core permissions_messages