feat(codex): expose Approve for me as a permission mode (#2016) (#2090)

* feat(codex): expose Approve for me as a permission mode (#2016)

Add autoReview to the Codex permission catalog. It keeps the
workspace-write sandbox with on-request approvals and routes escalations
to Codex's native reviewer (approvals_reviewer = "auto_review"), the same
config as `hapi codex --approve-for-me`. It works at launch and mid-session
via thread/settings/update; explicit modes now reset the reviewer to user,
and sessions report autoReview from the native reviewer setting.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* test(native): expect Auto-review in the Codex permission lists (#2016)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* feat(modes): label autoReview as Auto, matching Claude's auto mode (#2016)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
SSU-WEI HUANG
2026-10-26 09:59:47 +08:00
committed by GitHub
co-authored by Claude Opus 5.5
parent 60a4971087
commit 878ca2058c
17 changed files with 80 additions and 36 deletions
+10
View File
@@ -201,6 +201,16 @@ async function completePlan(f: Awaited<ReturnType<typeof fixture>>, status = 'co
return codexPlanProposalId('thread', turn.id, 'plan-item');
}
describe('shared permission modes', () => {
it('switches native auto-review on and back to the human reviewer', async () => {
const f = await fixture();
expect((await f.root.applySettings({ permissionMode: 'autoReview' })).applied.permissionMode).toBe('autoReview');
expect(f.root.client).toMatchObject({ settings: { approvalPolicy: 'on-request', approvalsReviewer: 'auto_review', sandboxPolicy: { type: 'workspaceWrite' } } });
expect((await f.root.applySettings({ permissionMode: 'default' })).applied.permissionMode).toBe('default');
expect(f.root.client).toMatchObject({ settings: { approvalsReviewer: 'user' } });
});
});
describe('shared plan actions', () => {
it('applies remote change_title as metadata.name then lets native terminal rename win', async () => {
const f = await fixture();