Skip to content

Codex Desktop drops approvals_reviewer=auto_review after context compaction/resume #23875

Open

Description

@roberdorfer

Summary

Codex Desktop appears to drop approvals_reviewer = auto_review from the regenerated permissions developer message after context compaction / resumed turns. After this happens, require_escalated tool calls are surfaced as manual approval prompts even though the thread originally started with auto-review enabled.

Environment

  • Codex Desktop app: 26.513.31313
  • Codex CLI: 0.131.0-alpha.9
  • macOS
  • Config:
approval_policy = "on-request"
approvals_reviewer = "auto_review"
sandbox_mode = "workspace-write"

Observed Behavior

In affected threads:

  1. The initial permissions developer message contains:

    `approvals_reviewer` is `auto_review`: Sandbox escalations with require_escalated will be reviewed for compliance with the policy.
    
  2. A context compaction event occurs.

  3. The permissions developer message is regenerated after compaction.

  4. The regenerated permissions message still contains sandbox settings, writable roots, and approved command prefixes, but no longer contains approvals_reviewer.

  5. Subsequent require_escalated calls are shown as manual user approval prompts instead of being routed through auto-review.

Expected Behavior

If a thread/session is configured with approvals_reviewer = auto_review, regenerated permissions/runtime context after compaction or resume should preserve it. Auto-review should continue to handle eligible require_escalated requests after compaction.

Actual Behavior

After compaction/resume, the regenerated permissions context often omits approvals_reviewer, and the thread behaves as if approval review had fallen back to manual user approval.

Local Pattern

Across local session logs, this is not isolated to a single thread:

  • Full permissions messages before compaction can include approvals_reviewer = auto_review.
  • Regenerated permissions messages after compaction often omit it.
  • In affected threads, fresh/new contexts may work, but older/resumed/compacted contexts lose the auto-review routing.

This suggests the problem is in the context rebuild / resume path, not in the user config file.

Related Issues

This may be related to other reports where old/resumed threads lose approval/auth/orchestration state while fresh threads behave correctly:

Activity

  1. added
    bugSomething isn't working
    appIssues related to the Codex desktop app
    contextIssues related to context management (including compaction)
    sessionIssues involving session (thread) management, resuming, forking, naming, archiving
    sandboxIssues related to permissions or sandboxing
    on May 21, 2026
  2. github-actions commented on May 21, 2026

    @github-actions
    Contributor
  3. jshaofa-ui commented on May 21, 2026

    @jshaofa-ui

    Proposed Solution: approvals_reviewer Persistence Fix

    Root Cause

    The approvals_reviewer setting is not persisted in the session state that survives context compaction. The permissions developer message is regenerated from a template that omits this field.

    Key Fix

    // Persist in session state
    interface SessionState {
      approvalsReviewer: string | null;  // survives compaction
    }
    
    // Include in permissions message template
    function generatePermissionsMessage(session: Session): string {
      const reviewer = session.approvalsReviewer ?? getConfigValue('approvals_reviewer');
      if (reviewer) {
        lines.push(`\`approvals_reviewer\` is \`${reviewer}\`: Sandbox escalations will be ${reviewer === 'auto_review' ? 'auto-reviewed' : 'manually approved'}.`);
      }
    }

    Full solution: solutions/codex-23875-approvals-reviewer-dropped-compaction-fix.md
    Estimated effort: 4 hours | Quote: $1,500–$3,000

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    appIssues related to the Codex desktop appbugSomething isn't workingcontextIssues related to context management (including compaction)sandboxIssues related to permissions or sandboxingsessionIssues involving session (thread) management, resuming, forking, naming, archiving

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions