Add Smart Approvals guardian review across core, app-server, and TUI#13860
Add Smart Approvals guardian review across core, app-server, and TUI#13860charley-oai merged 144 commits intomainfrom
Conversation
|
@codex review this |
|
Codex Review: Didn't find any major issues. Chef's kiss. ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
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". |
27cccec to
79dbe1c
Compare
358819f to
47ca29b
Compare
|
@codex review this |
|
Codex Review: Didn't find any major issues. Nice work! ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
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". |
05060d9 to
04f5f35
Compare
3f70d55 to
f2629ed
Compare
04f5f35 to
cc0c948
Compare
ac3a101 to
e426c16
Compare
37d856f to
14e462a
Compare
14e462a to
5d63cd8
Compare
05bc7dd to
c7cc802
Compare
|
@codex review this |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: c7cc80234b
ℹ️ 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".
c7cc802 to
550cdc6
Compare
|
@codex review this |
aa95be6 to
1a90b01
Compare
|
Codex Review: Didn't find any major issues. Hooray! ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
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". |
|
@codex review this |
|
Codex Review: Didn't find any major issues. Can't wait for the next one! ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
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". |
Co-authored-by: Codex <noreply@openai.com>
Co-authored-by: Codex <noreply@openai.com>
Co-authored-by: Codex <noreply@openai.com>
Co-authored-by: Codex <noreply@openai.com>
Co-authored-by: Codex <noreply@openai.com>
Co-authored-by: Codex <noreply@openai.com>
Co-authored-by: Codex <noreply@openai.com>
Co-authored-by: Codex <noreply@openai.com>
Co-authored-by: Codex <noreply@openai.com>
Co-authored-by: Codex <noreply@openai.com>
Co-authored-by: Codex <noreply@openai.com>
Co-authored-by: Codex <noreply@openai.com>
Co-authored-by: Codex <noreply@openai.com>
Co-authored-by: Codex <noreply@openai.com>
Co-authored-by: Codex <noreply@openai.com>
Co-authored-by: Codex <noreply@openai.com>
Co-authored-by: Codex <noreply@openai.com>
Co-authored-by: Codex <noreply@openai.com>
Co-authored-by: Codex <noreply@openai.com>
Co-authored-by: Codex <noreply@openai.com>
Remove the legacy guardian background-event footer path and rely on typed in-progress guardian assessments for the live TUI status. This keeps the branch aligned with the latest unshipped design instead of carrying compatibility code for an intermediate PR state. Co-authored-by: Codex <noreply@openai.com>
Backfill approvals_reviewer when migrating the deprecated guardian_approval feature alias so legacy configs preserve their original guardian-enabled behavior without changing plain smart_approvals startup semantics. Co-authored-by: Codex <noreply@openai.com>
Mark the config-backed approvals reviewer field as unstable in the app-server protocol and regenerate the stable schema artifacts. Simplify delegate event forwarding and approval handling by deduplicating fallback paths and wrapping guardian versus parent approval waits. Co-authored-by: Codex <noreply@openai.com>
Remove the short-lived guardian and parent approval await wrappers in codex_delegate and call await_approval_with_cancel directly at the use sites. Co-authored-by: Codex <noreply@openai.com>
Add the missing approvals_reviewer field to the remaining OverrideTurnContext test initializers so codex-core test builds match the current Op shape. Co-authored-by: Codex <noreply@openai.com>
Co-authored-by: Codex <noreply@openai.com>
e88d969 to
22eeedf
Compare
Summary
approvals_reviewer = "user" | "guardian_subagent"as the runtime control for who reviews approval requestsitem/autoApprovalReview/{started,completed}notifications carryingtargetItemId,review, andaction/experimental, aligned with the matching/approvalsmode, and surfaced clearly while reviews are pending or resolvedRuntime model
This PR does not introduce a new
approval_policy.Instead:
approval_policystill controls when approval is neededapprovals_reviewercontrols who reviewable approval requests are routed to:userguardian_subagentguardian_subagentis a carefully prompted reviewer subagent that gathers relevant context and applies a risk-based decision framework before approving or denying the request.The
smart_approvalsfeature flag is a rollout/UI gate. Core runtime behavior keys offapprovals_reviewer.When Smart Approvals is enabled from the TUI, it also switches the current
/approvalssettings to the matching Smart Approvals mode so users immediately see guardian review in the active thread:approval_policy = on-requestapprovals_reviewer = guardian_subagentsandbox_mode = workspace-writeUsers can still change
/approvalsafterward.Config-load behavior stays intentionally narrow:
smart_approvals = trueinconfig.tomlremains just the rollout/UI gate and does not auto-setapprovals_reviewerguardian_approval = truealias migration does backfillapprovals_reviewer = "guardian_subagent"in the same scope when that reviewer is not already configured there, so old configs preserve their original guardian-enabled behaviorARC remains a separate safety check. For MCP tool approvals, ARC escalations now flow into the configured reviewer instead of always bypassing guardian and forcing manual review.
Config stability
The runtime reviewer override is stable, but the config-backed app-server protocol shape is still settling.
thread/start,thread/resume, andturn/startkeep stableapprovalsRevieweroverridesapprovals_reviewerexposure returned viaconfig/read(including profile-level config) is now marked[UNSTABLE]/ experimental in the app-server protocol until we are more confident in that config surfaceApp-server surface
This PR intentionally keeps the guardian app-server shape narrow and temporary.
It adds generic unstable lifecycle notifications:
item/autoApprovalReview/starteditem/autoApprovalReview/completedwith payloads of the form:
{ threadId, turnId, targetItemId, review, action? }reviewis currently:{ status, riskScore?, riskLevel?, rationale? }statusis one ofinProgress,approved,denied, orabortedactioncarries the guardian action summary payload from core when available. This lets clients render temporary standalone pending-review UI, including parallel reviews, even when the underlying tool item has not been emitted yet.These notifications are explicitly documented as
[UNSTABLE]and expected to change soon.This PR does not persist guardian review state onto
thread/readtool items. The intended follow-up is to attach guardian review state to the reviewed tool item lifecycle instead, which would improve consistency with manual approvals and allow thread history / reconnect flows to replay guardian review state directly.TUI behavior
/experimentalexposes the rollout gate asSmart Approvals/approvalsmodeapprovals_revieweroverride when appropriate and returns the session to default manual review when the effective reviewer changes/approvalsstill exposes the reviewer choice directlyScope notes
This PR includes the supporting core/runtime work needed to make Smart Approvals usable end-to-end:
smart_approvals,guardian_approvalalias migration, andapprovals_reviewerOut of scope for this PR:
ThreadItemsRequestUserInputpath)codex resume 019ce3ee-69e2-7d62-bb67-0bc5792ebc31