Skip to content

feat: add "Auto" runtime mode — AI-reviewed approvals for Codex and Claude#4272

Open
t3dotgg wants to merge 2 commits into
mainfrom
t3code/plan-auto-approve-permissions
Open

feat: add "Auto" runtime mode — AI-reviewed approvals for Codex and Claude#4272
t3dotgg wants to merge 2 commits into
mainfrom
t3code/plan-auto-approve-permissions

Conversation

@t3dotgg

@t3dotgg t3dotgg commented Jul 22, 2026

Copy link
Copy Markdown
Member

Summary

Adds a new "auto" runtime mode between Auto-accept edits and Full access. Both native backends recently shipped a model-reviewed approval mode that is strictly safer than full access — risky actions can still be denied or escalated, and (for Codex) the sandbox stays on:

  • Codex: keeps approvalPolicy: "on-request" + sandbox: workspace-write, and sets approvalsReviewer: "auto_review" on thread/start and turn/start — a reviewer subagent decides approval requests (sandbox escapes, network access, MCP prompts) instead of routing them to the user.
  • Claude: passes permissionMode: "auto" (no allowDangerouslySkipPermissions), where a classifier model approves/denies each permission prompt. Escalations still flow through canUseTool into the existing approval UI; classifier denials surface via the already-handled permission_deniedtool.denied event.
  • Other adapters (Cursor, Grok, OpenCode): fall through to their existing non-full-access behavior.

Changes

  • packages/contracts: add "auto" to RuntimeMode
  • apps/server: Codex + Claude adapter mappings
  • apps/web: mode picker entries (full + compact composer)
  • apps/mobile: runtime options in ThreadComposer and NewTaskDraftScreen
  • Tests for both adapters' wire params

Notes for reviewers

  • No DB migration needed: runtime_mode is a TEXT column with no CHECK constraint; mid-thread mode changes already restart the session via ProviderCommandReactor.
  • approvalsReviewer exists in the generated app-server schema (effect-codex-app-server), so no regeneration was needed. Requires a codex binary recent enough to know the field (verified in 0.145.0).
  • Older mobile clients pinned to the previous contract will fail to decode threads set to "auto" — same skew consideration as any enum addition.

🤖 Generated with Claude Code


Note

Medium Risk
Changes approval routing and sandbox/permission semantics for agent sessions; incorrect mapping could weaken supervision or strand users on sticky reviewers after mode changes.

Overview
Adds auto as a new RuntimeMode between auto-accept edits and full access, exposed in web, mobile, and compact composer pickers.

Codex maps auto to on-request approvals with workspace-write sandbox and sets approvalsReviewer: auto_review on every thread/turn start (including non-auto modes with explicit user) so mode switches do not leave the auto reviewer sticky on resume.

Claude maps auto to permissionMode: "auto" without allowDangerouslySkipPermissions.

Adapter tests cover the new wire params for both backends.

Reviewed by Cursor Bugbot for commit 8c2ff69. Bugbot is set up for automated code reviews on this repo. Configure here.

Note

Add 'Auto' runtime mode with AI-reviewed approvals for Codex and Claude

  • Adds 'auto' as a valid RuntimeMode in orchestration.ts, wiring it through the full stack: web/mobile UI menus, Claude adapter, and Codex session runtime.
  • In Claude, runtimeMode: 'auto' maps to permissionMode: 'auto' in outgoing query options via ClaudeAdapter.ts.
  • In Codex, 'auto' mode sets approvalsReviewer: 'auto_review', approvalPolicy: 'on-request', and uses the workspaceWrite sandbox policy via CodexSessionRuntime.ts.
  • All other runtime modes now explicitly set approvalsReviewer: 'user' in thread and turn start params.

Macroscope summarized 8c2ff69.

…laude

Adds a new "auto" RuntimeMode between auto-accept-edits and full-access.
Both native agent backends recently shipped a model-reviewed approval
mode that is strictly safer than full access:

- Codex: keeps the workspace-write sandbox and on-request approvals but
  sets approvalsReviewer: "auto_review", so a reviewer subagent decides
  approval requests (sandbox escapes, network access) instead of the user.
- Claude: passes permissionMode: "auto", where a classifier model
  approves/denies each permission prompt; escalations still flow through
  canUseTool into the existing approval UI, and classifier denials
  already surface via the permission_denied -> tool.denied event.

Other adapters (Cursor, Grok, OpenCode) fall through to their existing
non-full-access behavior for the new mode.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Jul 22, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: 46401bd4-c7a4-4f37-95d0-8a591a77f040

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch t3code/plan-auto-approve-permissions

Comment @coderabbitai help to get the list of available commands.

@github-actions github-actions Bot added vouch:trusted PR author is trusted by repo permissions or the VOUCHED list. size:S 10-29 changed lines (additions + deletions). labels Jul 22, 2026

@cursor cursor 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.

Cursor Bugbot has reviewed your changes using high effort and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit b742293. Configure here.

Comment thread apps/server/src/provider/Layers/CodexSessionRuntime.ts Outdated
@macroscopeapp

macroscopeapp Bot commented Jul 22, 2026

Copy link
Copy Markdown
Contributor

Approvability

Verdict: Needs human review

This PR introduces a new user-facing feature ('Auto' runtime mode) that routes approval decisions to an AI reviewer instead of the user. New features with significant workflow changes warrant human review.

You can customize Macroscope's approvability policy. Learn more.

…itch

thread/resume treats an omitted approvalsReviewer as "keep current", so
switching a thread out of Auto would leave auto_review sticky. Send
"user" explicitly for every non-auto mode.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@github-actions github-actions Bot added size:M 30-99 changed lines (additions + deletions). and removed size:S 10-29 changed lines (additions + deletions). labels Jul 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

needs-julius size:M 30-99 changed lines (additions + deletions). vouch:trusted PR author is trusted by repo permissions or the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant