Skip to content

One set of permission modes for every harness - #146

Merged
m4rocks merged 1 commit into
gpui-returnfrom
universal-permission-modes
Nov 22, 2026
Merged

m4rocks merged 1 commit into
gpui-returnfrom
universal-permission-modes

Conversation

@m4rocks

@m4rocks m4rocks commented Nov 22, 2026

Copy link
Copy Markdown
Owner

Each harness showed its own permission modes under its own names, and the saved default was a mode id that only meant something to one harness, so a new Codex or OpenCode session didn't start in the mode picked in Settings. In the message box, the permission chip's text was also grey while the model and branch chips are not.

Fix

  • harness/permission.rs defines Read-only, Ask, Auto and Full Access, and the mode id each adapter uses for them:

    Read-only Ask Auto Full Access
    Claude Code plan default auto bypassPermissions
    Codex read-only workspace-write agent agent-full-access
    Antigravity plan default auto –
    OpenCode plan – – build
  • The chat picker and Shift+Tab only go through the modes the session's harness has. Claude's acceptEdits and dontAsk, and Antigravity's accept-edits, no longer appear in them. If a session ends up in one of those modes, the chip shows the harness's own name for it.

  • Settings stores a single default. A new session starts in that mode, or in the nearest safer one when its harness doesn't have it (OpenCode with Ask starts in plan). The same fallback runs again on the modes the live session lists, so an account without Claude's Auto gets Ask. Sessions started by another session still can't get Full Access; they now drop to Auto instead of the harness default.

  • Old saved defaults still load: manual and dontAsk become Ask, acceptEdits becomes Auto, plan becomes Read-only, bypassPermissions becomes Full Access, and the old per-harness mode_id values map back to these too. If no default has been picked, the Settings row says "Harness default", and closing Settings no longer saves one.

  • The mode chip's text now uses theme::TEXT, the color the model and branch chips use.

Evidence

  • cargo clippy --all-targets is clean, and cargo test passes (470), including new tests for the mapping, the safer fallback, the cycle and migration.
  • Headless tests run one at a time: 19 pass. The same 5 fail with or without this change (opencode session, hand-off, language servers, session-list scrolling, skills page).
  • I didn't check the chip color by eye; this machine has no screenshot tool.

Risk

  • The Codex and Antigravity ids are taken from what their adapters reported to this machine. If an adapter renames a mode, that mode disappears from the pickers. Nothing fails; the session keeps the adapter's own default.
  • The first prompt can still go out before the mode switch is confirmed. That was already the case before this change.

@vercel

vercel Bot commented Nov 22, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
claudiu Ready Ready Preview Nov 22, 2026 3:55pm UTC

…he message box's text color

Read-only, Ask, Auto and Full Access map to each adapter's own mode ids
(harness/permission.rs). Pickers show the ones a harness has; a default
it lacks starts the session in the nearest safer mode. The saved default
is one universal value, and old saved ids load into it.
@m4rocks
m4rocks force-pushed the universal-permission-modes branch from 2e516dd to 78099ac Compare November 22, 2026 15:55
@m4rocks
m4rocks merged commit 3f0b509 into gpui-return Nov 22, 2026
7 of 8 checks passed
@m4rocks
m4rocks deleted the universal-permission-modes branch November 22, 2026 16:07

This branch was successfully deployed

1 active deployment
Preview — 78099ac4 Deployed Nov 22, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant